5

I want to compile the Linux kernel (written in c) using g++. Is this possible? If not, could you suggest ways of accomplishing it?

Shalom Craimer
  • 20,659
  • 8
  • 70
  • 106
santosh
  • 59
  • 2

1 Answers1

2

Why would you want to do that??? Just use gcc. Compiling towards a C++ environment/runtime is not possible as in the kernel there is no way to run a C++ runtime. This would imply having exception handling available for example, which is very problematic in the kernel. So you have to stick to a C compiler like intel's C compiler icc or gcc.

Here is another question that might interest you: Is it possible to compile Linux kernel with something other than gcc?

Another Reference: Why don't we rewrite the Linux kernel in C++?

Community
  • 1
  • 1
jdehaan
  • 19,700
  • 6
  • 57
  • 97