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.
libgcc
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: libgcc
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.
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
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.
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
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?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: libgcc
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.
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
And then Solar is asking me why I need two!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.
Re: libgcc
Hobbes wrote:And then Solar is asking me why I need two!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.
Every good solution is obvious once you've found it.
Re: libgcc
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?
-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?