I run into problem compiling a kernel scheduler for testing

the compiling error

 linux-2.6.32-rc3/include/linux/compiler-gcc.h:86:30: fatal error: linux/compiler-gcc5.h: No such file or directory

Do I get this error because the kernel is too old?


uname -r



gcc --version

gcc-5.real (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010

So if this is the reason for the compilation error - what solutions are available? Should I for instance update the kernel - how do I do that? Or regress to an earlier version of gcc? Other sugestions?

  • Is there a particular reason why you're building version 2.6.32-rc3 of the kernel? – Stephen Kitt Apr 10 '16 at 16:17
  • @StephenKitt - its just for testing and this was the tarball the institution gave me (linsched-2.6.32-rc3.tar.gz). At the moment I dont know the alternatives? – Björn Hallström Apr 10 '16 at 16:22

Any kernel older than 3.18 will not compile using gcc 5. Use an older compiler.


You do not have the kernel sources. The compiler is looking for that header file.

This link will get you a version of the kernel source tree that should be mostly similar to what you are looking for.



it's possible to install gcc-4.9 to be able to compile 3.xx kernels.

but then, next question would be: "how to switch for gcc-4.9 for kernel compilation?"

instead, the simpler answer would be here - just download missing file into include/linux folder

unfortunately gcc5 dislike "extern inline" construction at all, so you'll have to proceed with grep -sRl "extern inline" .|xargs sed -i -e "s/extern inline/inline/g" for all your kernel source code before moving forward with any compilation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.