Cross GCC 4.9.4 cannot find its own header
Posted: Wed Mar 22, 2017 9:01 am
Hi, I have built a working cross toolchain using my custom libc (that is not standard compliant by design).
Now I want to port newlib to start porting POSIX software such as GCC.
I do not want newlib to be the default libc in my OS, just a sort of compatibility layer. Indeed the newlib implementation of the reentrant syscalls depends on my own libc.
However while building newlib I've noticed that my cross compiler is unable to find stddef.h and stdarg.h despite them being provided by the compiler itself and despite the fact that they are actually installed inside the folder.
After some tests with I realized that GCC is ignoring the said folder because it's looking in the wrong place: instead of it's looking into something like .
I've tried to remove the --with-sysroot from the GCC compilation script and/or to tweak the --prefix but without success.
What should I change to allow the cross GCC find it's own headers so that I do not need to manually copy them into the target system?
Now I want to port newlib to start porting POSIX software such as GCC.
I do not want newlib to be the default libc in my OS, just a sort of compatibility layer. Indeed the newlib implementation of the reentrant syscalls depends on my own libc.
However while building newlib I've noticed that my cross compiler is unable to find stddef.h and stdarg.h despite them being provided by the compiler itself and despite the fact that they are actually installed inside the
Code: Select all
$PREFIX/lib/gcc/x86_64/jehanne/4.6.9/include/stddef.h
After some tests with
Code: Select all
gcc -v
Code: Select all
$PREFIX/lib/gcc/x86_64/jehanne/4.6.9/include/stddef.h
Code: Select all
$SYSROOT/$PREFIX/lib/gcc/x86_64/jehanne/4.6.9/include/stddef.h
I've tried to remove the --with-sysroot from the GCC compilation script and/or to tweak the --prefix but without success.
What should I change to allow the cross GCC find it's own headers so that I do not need to manually copy them into the target system?