compile kernel

Jonathan Wakely jwakely.gcc@gmail.com
Fri Sep 9 10:07:00 GMT 2011


On 9 September 2011 10:16, esmaeil mirzaee wrote:
> Thank you for reply
>
> On Fri, Sep 9, 2011 at 4:55 AM, Pelle Windestam <pelle@windestam.se> wrote:
>>>
>>> $ gcc acct.c -o ac
>>> acct.c:46: fatal error: linux/mm.h: No such file or directory
>>> compilation terminated.
>>>
>>
>> That is because gcc does not know where to look for the included
>> mm.h-file, the gcc compiler needs to be specifically told where to
>> look for include files if they are not in the standard directories.
>> You can do that by passing it the -I option followed by the directory
>> to look in.
>
> You mean I must put the address of library when I try to compile if yes.

The location of the header files, not libraries.  And -I is not the same as -i

> ~/linux-2.6.39.3/kernel the file is in this place (acct.c).
> Could you give me form of compile command it can be like this
> gcc -i ~/linux-2.6.39.3/kernel acct.c -o acct

As Axel said on the gcc-help list, you cannot compile the kernel like
that, acct.c is only one small part of a much larger system. You need
to use the makefiles generated by the kernel configuration process,
which contain the "recipes" for compiling the pieces of the kernel and
linking them together.

You should probably start with something simpler than the Linux kernel.



More information about the Gcc-help mailing list