Page 1 of 1
libgcc
Posted: Mon Dec 13, 2010 9:03 pm
by protecyon
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.
Re: libgcc
Posted: Mon Dec 13, 2010 9:15 pm
by pcmattman
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.
Re: libgcc
Posted: Mon Dec 13, 2010 10:14 pm
by protecyon
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.
Re: libgcc
Posted: Tue Dec 14, 2010 4:47 am
by JackScott
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?
Re: libgcc
Posted: Tue Dec 14, 2010 6:12 am
by Combuster
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.
Re: libgcc
Posted: Tue Dec 14, 2010 6:52 am
by qw
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!
Re: libgcc
Posted: Tue Dec 14, 2010 7:16 am
by Solar
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!
Re: libgcc
Posted: Tue Dec 14, 2010 8:29 pm
by protecyon
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?