Why does gcc search header files from non-exist folders?

I am trying to build an open source project shark on CentOS 7, and get very weird build errors:

make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/syslimits.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/sys/cdefs.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/wordsize.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/gnu/stubs.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/gnu/stubs-64.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/posix1_lim.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/local_lim.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/posix2_lim.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/types.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/typesizes.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/stdio_lim.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/sys_errlist.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/bits/errno.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/include/x86_64-linux-gnu/asm/errno.h', needed by `core/luv/luv.o'.
make: *** No rule to make target `/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h', needed by `core/luv/luv.o'.

After executing “gcc -E -v -” command, it outputs:

[root@centos shark]# gcc -E -v -
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/4.8.3/cc1 -E -quiet -v - -mtune=generic -march=x86-64
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
 /usr/local/include
 /usr/include
End of search list.

So the searching header file paths should be:

 /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
 /usr/local/include
 /usr/include

I can’t work out how /usr/lib/gcc/x86_64-linux-gnu/4.8 and /usr/include/x86_64-linux-gnu come from. Could anyone give some clues?


Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.