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.
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.
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
- Download and install Eclipse plus in CDT.
- 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.
- 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.
- Run Eclipse.File->Create->C
- click on project
- For example, enter the project name my_kernel.
- Uncheck “Use default location” and enter the kernel root phonebook in the “Location” field.
- In the Project Type: section, open the Makefile project and select Empty Project.
- Select Linux GCC on the right.
- Click “Advanced Settings…” and the Properties dialog box will appear.
- 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.
- Open the general C/C++ solution on the left.
- Click Enable preprocessor paths.
- ChooseSelect GNU C from the list of languages.
- Select custom CDT settings entries from the list of settings entries
- 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
- Also add any other macro file types you use.
- Click indexers
- Check Enable Project-Specific Settings often.
- Disable source index files not included in shared assembly.
- Click “Paths and Symbols” on the left.
- Also select the “Contains” tab and then GNU C.
- Click “Add”…
- Press Workspace… then select the kernel directories and include include/uapi
- 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)
- Click the # Symbols tab.
- Click “Add”…
- Set the new name to __KERNEL__
- Set the value to 1 and click OK.
- Go to the Source Location tab.
- Click the plus sign next to your project name.
- Select a filter element and click Edit Filter…
- 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). >
- Click OK and then OK again to close this dialog.
- In the General section, select c/c++ for the Include paths, macros, etc. preprocessor.
- Click on the “Suppliers” tab and youselect “CDT GCC Embedded Compiler Options”.
- Uncheck Use Global Enterprise Shared by Projects.
- 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.
- 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.
- Check Assign Console in Console View, make sure it works fine.
- Click OK in the Properties dialog box.
- 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”.
- Click to close the C project dialog.
- The project should be automatically indexed.
- Disk listing takes up to 20 free minutes on disk, about 5 minutes on SSD.
- 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.