OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 5:39 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: libgcc
PostPosted: Mon Dec 13, 2010 9:03 pm 
Offline

Joined: Mon Dec 13, 2010 8:56 pm
Posts: 5
In the tutorial it states that to create libgcc you can run the following commands after creating the bootstrap gcc:
make all-target-libgcc
make install-target-libgcc

However, in order for these commands to run succesfully wouldn't you need to provide headers for your target platform and given that we configures the bootstrap gcc with the --without-headers flag wouldn't the libgcc library fail to build complaining about missing headers such as string.h.


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Mon Dec 13, 2010 9:15 pm 
Offline
Member
Member

Joined: Sun Jan 14, 2007 9:15 pm
Posts: 2566
Location: Sydney, Australia (I come from a land down under!)
No.

libgcc provides a variety of functions for your target machine that provide for special math operations (eg, 64-bit division on x86), atomic builtins, and other such functions.

Any dependencies on C functions, if any, will be resolved when libgcc is linked to your binary, not during libgcc build.

_________________
Pedigree | GitHub | Twitter | LinkedIn


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Mon Dec 13, 2010 10:14 pm 
Offline

Joined: Mon Dec 13, 2010 8:56 pm
Posts: 5
If that is the case what might cause libgcc to fail to find string.h after running make all-target-libgcc with gcc 4.5.1?

Thank you in advance for your help.

pcmattman wrote:
No.

libgcc provides a variety of functions for your target machine that provide for special math operations (eg, 64-bit division on x86), atomic builtins, and other such functions.

Any dependencies on C functions, if any, will be resolved when libgcc is linked to your binary, not during libgcc build.


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Tue Dec 14, 2010 4:47 am 
Offline
Member
Member
User avatar

Joined: Thu Dec 21, 2006 3:03 am
Posts: 1029
Location: Hobart, Australia
If make all-target-libgcc is failing to build, the best thing to do is to paste the last few lines (10-20) here so we can see what the exact problem is. It's all just guesswork otherwise. You mention GCC v4.5.1, is that the host system version, or the target system version?

_________________
My Personal Blog | My Software Company - Loop Foundry | My Github Page


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Tue Dec 14, 2010 6:12 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
My personal experience with libgcc (especially for freestanding targets that behave like they are not) is that some parts do drag in references to system headers. Mostly, the problem cases deal with unwinding and debugging.

I you don't need C++, you can just assemble an empty .S file to the failing unwind_xxxx.o and then run make again (repeating the process where necessary), but it is a really ugly hack, and so far I haven't found it necessary on intel platforms. Then again, I'm still mostly using compilers between 3.4.x and 4.2.x since it's a waste of time to upgrade a toolchain when it's working - especially when you have 7 different crosscompilers to upgrade.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Tue Dec 14, 2010 6:52 am 
Offline
Member
Member
User avatar

Joined: Mon Jan 26, 2009 2:48 am
Posts: 792
Combuster wrote:
Then again, I'm still mostly using compilers between 3.4.x and 4.2.x since it's a waste of time to upgrade a toolchain when it's working - especially when you have 7 different crosscompilers to upgrade.
And then Solar is asking me why I need two!


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Tue Dec 14, 2010 7:16 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7614
Location: Germany
Hobbes wrote:
Combuster wrote:
Then again, I'm still mostly using compilers between 3.4.x and 4.2.x since it's a waste of time to upgrade a toolchain when it's working - especially when you have 7 different crosscompilers to upgrade.
And then Solar is asking me why I need two!


:P

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: libgcc
PostPosted: Tue Dec 14, 2010 8:29 pm 
Offline

Joined: Mon Dec 13, 2010 8:56 pm
Posts: 5
The following is the error when libgcc fails:

-fexceptions -fnon-call-exceptions
/home/dir/tools/./gcc/xgcc -B/home/dir/tools/./gcc/ -B/home/dir/tools/powerpc/powerpc-none-linux-gnu/bin/ -B/home/dir/tools/powerpc/powerpc-none-linux-gnu/lib/ -isystem /home/dir/tools/powerpc/powerpc-none-linux-gnu/include -isystem /home/dir/tools/powerpc/powerpc-none-linux-gnu/sys-include -g -O2 -msoft-float -fPIC -mstrict-align -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -mlong-double-128 -I. -I. -I../../.././gcc -I/home/dir/Desktop/gcc-4.5.1/libgcc -I/home/dir/Desktop/gcc-4.5.1/libgcc/. -I/home/dir/Desktop/gcc-4.5.1/libgcc/../gcc -I/home/dir/Desktop/gcc-4.5.1/libgcc/../include -I/home/dir/Desktop/gcc-4.5.1/libgcc/../libdecnumber/dpd -I/home/dir/Desktop/gcc-4.5.1/libgcc/../libdecnumber -DHAVE_CC_TLS -o decContext.o -MT decContext.o -MD -MP -MF decContext.dep -c /home/dir/Desktop/gcc-4.5.1/libgcc/../libdecnumber/decContext.c
/home/dir/Desktop/gcc-4.5.1/libgcc/../libdecnumber/decContext.c:33:43: fatal error: string.h: No such file or directory
compilation terminated.
make[4]: *** [decContext.o] Error 1
make[4]: Leaving directory `/home/dir/tools/powerpc-none-linux-gnu/nof/libgcc'
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/home/dir/tools/powerpc-none-linux-gnu/libgcc'
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/home/dir/tools/powerpc-none-linux-gnu/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/dir/tools'
make: *** [all] Error 2

GCC v4.5.1 is the target system version, GCC v4.4.5 is the host system version.

Does it look like the target(powerpc) system headers need to be included for libgcc to compile?

JackScott wrote:
If make all-target-libgcc is failing to build, the best thing to do is to paste the last few lines (10-20) here so we can see what the exact problem is. It's all just guesswork otherwise. You mention GCC v4.5.1, is that the host system version, or the target system version?


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 38 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