Re: Make sure the searching header file path when building Linux kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

As per GCC Documentation (https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html) if you do not instruct GCC otherwise,
it will look for headers requested with #include <file> in:
     /usr/local/include
     libdir/gcc/target/version/include
     /usr/target/include
     /usr/include
You can very well prioritize header file lookup to your path via -I<path of header> flag during compilation.
Another option is to provide --sysroot=<path to sysroot> in order to lookup system headers in your own
sysroot.

Command cpp -v will show you the look up process of header file.

Thanks
Akash Bhatnagar


On Wed, Aug 5, 2015 at 3:13 PM, Nan Xiao <xiaonan830818@xxxxxxxxx> wrote:
Hi all,

I want to make sure the searching header file path when building Linux kernel:
Per my understanding, the gcc only find header files in current building linux 
directory: include/*, won't search system header file path: such as /usr/inclue,
 /usr/local/include, etc.

Is my understanding right? Thanks very much in advance!

Best Regards
Nan Xiao

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux