OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Jun 25, 2017 1:06 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cross GCC 4.9.4 cannot find its own header
PostPosted: Wed Mar 22, 2017 9:01 am 
Offline

Joined: Wed Mar 22, 2017 8:31 am
Posts: 2
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
Code:
$PREFIX/lib/gcc/x86_64/jehanne/4.6.9/include/stddef.h
folder.

After some tests with
Code:
gcc -v
I realized that GCC is ignoring the said folder because it's looking in the wrong place: instead of
Code:
$PREFIX/lib/gcc/x86_64/jehanne/4.6.9/include/stddef.h
it's looking into something like
Code:
$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?

_________________
Jehanne Operating System


Top
 Profile  
 
 Post subject: Re: Cross GCC 4.9.4 cannot find its own header
PostPosted: Thu Mar 23, 2017 4:16 am 
Offline

Joined: Wed Mar 22, 2017 8:31 am
Posts: 2
Note that by setting the CPATH environment variable to $CROSSGCC_PREFIX/lib/gcc/x86_64-jehanne/4.9.4/include:$CROSSGCC_PREFIX/lib/gcc/x86_64-jehanne/4.9.4/include-fixed everything works as expected so the problem seems related to how I did configured the cross compiler.

The include directory was needed for stddef.h and include-fixed was needed for limits.h.

Also, note that in the previous post for $PREFIX I meant the --prefix (same for CROSSGCC_PREFIX here) and for $SYSROOT I meant the --with-sysroot passed to configure while building the GCC cross compiler.

_________________
Jehanne Operating System


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group