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/includeYou 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.
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 linuxdirectory: 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 RegardsNan 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