-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ extractor giving multiple compilation errors when trying to compile the linux kernel #16908
Comments
Hi, Thanks for the report. Would you be able to check that a preprocessed copy of verifier.c has the same problem, and if so could you share the preprocessed file? That would make it significantly easier to potentially reproduce and fix this. |
Here it is. FWIW the compilation errors are actually not on verifier.c but on other header files like (./include/linux/topology.h, ./arch/x86/include/asm/tlbflush.h", ) Also please note that for this pre processed file I had to re attach the #include statements otherwise the compilation process was broken for some reason... Also as I have said, this issue seems to happen quite a bit, If I grep for the string "Extractor exiting with code 1", which seems to indicate error, I have >2000 log files that match. |
That's immaterial, as the preprocessing should pull in those headers.
Unfortunately this means this will not be helpful for reproducing the problem. |
How did you preprocess the file? You will still need to pass all flags that are passed during normal compilation of the file, and not just |
It was generated with the kernel build system |
Would you mind re-running manually to see if that gives better results? Assuming you've done a complete build already, go to the directory that has the subdirectory
|
The problem is caused by:
#ifdef CONFIG_X86_64
#define __percpu_seg_override
#else
#define __percpu_seg_override
#endif I've reported the problem to our frontend provider. |
I can confirm, the suggested workaround works wonders; CodeQL can now analyze the linux kernel. Thanks for helping out! |
I also confirm that this seems to fix most of the issues :) There are a few compilation errors left but they seem to be unrelated. For now most of the kernel seems indexed on my end! |
Description of the issue
I noticed that several files of the linux kernel source were missing when creatiung a database with code ql using the kernel config attached to this issue and the following command:
One of the missing files (kernel/bpf/verifier.c) is being correctly compiled by the kernel build system but it seems there are multiple compilation errors when the cpp extractor runs (I attached to complete log to this issue), for example:
Please note:
I believe this might be a bug in the extractor similar to #16901 and #13994. If that is so, please feel free to close this as duplicate.
Let me know if you need anything else from me to reproduce this
extractor_log.txt
config.txt
The text was updated successfully, but these errors were encountered: