What Is Eclipse Linux Kernel Autoconf.h And How To Fix It?


Sometimes you may see an eclipse Linux Kernel autoconf.h error code on your computer. There can be several reasons for this problem.

eclipse linux kernel autoconf.h

Here are the specific steps I found to get CDT to work well when using the Linux kernel source code. If you omit some of these steps, the situation may still work to a large extent, but some things may not work perfectly. For example, the following might find the wrong include path for file C.

Anyway, after these steps are done, I think one can figure out how to help some indexers get a good deal on the Linux kernel source.

eclipse linux kernel autoconf.h

Disclaimer: These processes were last updated for Eclipse Oxygen 4.7.2 + CDT 9.4.0 and were originally developed for Eclipse 3.5.1 + CDT 6.0.0

  1. Download and install Eclipse plus in CDT.
  2. Configure and build the entire kernel to install CONFIG_* generate in conjunction with autoconf.h. This can be done before or after downloading and installing Eclipse.
  3. Make sure the experts say you have the correct kernel (e.g. source code. Be sure to refer to the correct git branch). If everyone checks out a different branch later, that’s certainly fine, but you’ll have to help reindexsource code, and it only takes about 20 minutes.
  4. Run Eclipse.File->Create->C
  5. click on project
  6. For example, enter the project name my_kernel.
  7. Uncheck “Use default location” and enter the kernel root phonebook in the “Location” field.
  8. In the Project Type: section, open the Makefile project and select Empty Project.
  9. Select Linux GCC on the right.
  10. Click “Advanced Settings…” and the Properties dialog box will appear.
  11. Note. This problem is because newer versions of Eclipse (such as Oxygen) will aggressively index your reshape, which can cause Eclipse to painfully halt for the rest of the system’s subsequent steps, especially if only the correct small size needs to be used. part of the index corresponding to a particular kernel. To avoid this, disable the list temporarily by opening the generic C/C++ class, clicking Indexer, clicking Enable project-specific settings, and then unchecking Enable Indexer.
  12. Open the general C/C++ solution on the left.
  13. Click Enable preprocessor paths.
  14. ChooseSelect GNU C from the list of languages.
  15. Select custom CDT settings entries from the list of settings entries
  16. Click “Add”…. Select the preprocessor macro file in the top left project dropdown, the path in the top right dropdown, and call “include/linux/kconfig.Into h” in the file frame text up. Note 1: In older kernels (e.g. 4.1.12, 4.2.7 or below), selecting “include/generated/autoconf.h” works better. On newer kernels, kconfig selection.h is better because this precious file contains and also runs some tests like IS_ENABLED (option) properly extended by the CDT scanner. Note 2: Kernels for older kernels, unlike 2.6.33, the location of autoconf.h is simply include/linux/autoconf.h
  17. Also add any other macro file types you use.
  18. Click indexers
  19. Check Enable Project-Specific Settings often.
  20. Disable source index files not included in shared assembly.
  21. Click “Paths and Symbols” on the left.
  22. Also select the “Contains” tab and then GNU C.
  23. Click “Add”…
  24. Press Workspace… then select the kernel directories and include include/uapi
  25. Do one more add, workspace and add two article publishing pages: arch/architecture/and, arch/architecture/include/uapi. B. arch/powerpc/include and (the UAPI directories arch/powerpc/include/uapi are ideally detailed here due to the user/kernel header separation often contained in the kernel)
  26. Click the # Symbols tab.
  27. Click “Add”…
  28. Set the new name to __KERNEL__
  29. Set the value to 1 and click OK.
  30. Go to the Source Location tab.
  31. Click the plus sign next to your project name.
  32. Select a filter element and click Edit Filter…
  33. Click “Add some…”, then select all those arch/* directories in all your kernel sources that will not be used in everyday life (i.e. those that should not be used for the architecture you are using currently). >
  34. Click OK and then OK again to close this dialog.
  35. In the General section, select c/c++ for the Include paths, macros, etc. preprocessor.
  36. Click on the “Suppliers” tab and youselect “CDT GCC Embedded Compiler Options”.
  37. Uncheck Use Global Enterprise Shared by Projects.
  38. Append -nostdinc containing the current command to get the compiler specification. The core is the autonomous situation as defined in ISO C99. What this really means is that it doesn’t want to be poisoned and obviously can’t work right now concatenating “host” header files with libraries.
  39. Also add -iwithprefix include to the command to get the above compiler specification. The reason for this is that -nostdinc above told gcc to help you not scan the system by default for the appropriate directories for header files. However, the Linux kernel depends on headers provided by GCC for “standalone environments” such as stdarg.h, stdbool.h, etc., and these are usually placed by GCC in /lib/gcc//< version>/include . Hence the nesting.
  40. Check Assign Console in Console View, make sure it works fine.
  41. Click OK in the Properties dialog box.
  42. Note. If you previously temporarily disabled the recommendedindexing. It’s just about time to turn it back on. In the “C/C++ Overview” section, click “Indexer” and check “Enable Indexer”.
  43. Click to close the C project dialog.
  44. The project should be automatically indexed.
  45. Disk listing takes up to 20 free minutes on disk, about 5 minutes on SSD.
  1. By adding and including arch/architecture/include, you only get some of the basic include paths. To fully index each core, you will need to add dozens of paths, albeit often. This is why I don’t recommend using PTP’s remote indexing feature to get the Linux kernel while fighting it, because what can be described as what happens is that it reports tens of millions of header image location errors and the process of reporting the people’s mistakes about maybe a long delay in linking to a website will result in hours of indexing.