Cross compiling the libgcc libaries, especially libgo
Posted: Mon Apr 08, 2013 9:36 am
I'm trying to build a cross-compiling version of gcc 4.6.3 including support for gccgo. My host system is OSX (x86_64-apple-darwin) and my target is 32bit linux (i686-pc-linux-gnu).
Using the guide, I successfully built binutils and installed them for use by my cross-compiling gcc.
Using the guide, I successfully built gcc 4.6.3 as a cross compiler.
I'm failing to build libgcc, which in my case includes libgo.
I have tried a number of things, but the seem to all boil down to the same two root problems. Here's the clue on the first problem that comes when I am trying build libgcc.
fenv.h is part of the c++ standard library and is present in the distribution.
I have tried to change the CXXFLAGS that are set at the time of ./configure but that seems to have no effect.
Problem #2 has a workaround, but something seems broken and maybe it is a symptom of something I am doing wrong:
When I build gcc I get the cross compiler as gcc/xgcc in my build directory. However, the assembler in gcc/as seems to have a problem in it's script. If I go in and check the environment variables at the top:
These are my "workaround" values that point to the values built by the compile of gcc step. They are initially "" (empty) which causes the gcc/as script to fail out. I was careful to try to make sure that my PATH was set properly to includes this directory at the time I did configure of the gcc source.
Any thoughts on either of these?
thanks
ian smith
Using the guide, I successfully built binutils and installed them for use by my cross-compiling gcc.
Using the guide, I successfully built gcc 4.6.3 as a cross compiler.
I'm failing to build libgcc, which in my case includes libgo.
I have tried a number of things, but the seem to all boil down to the same two root problems. Here's the clue on the first problem that comes when I am trying build libgcc.
Code: Select all
/Users/iansmith/oder/build-gcc/./gcc/xgcc -B/Users/iansmith/oder/build-gcc/./gcc/ -B/Users/iansmith/oder/gocross/i686-pc-linux-gnu/bin/ -B/Users/iansmith/oder/gocross/i686-pc-linux-gnu/lib/ -isystem /Users/iansmith/oder/gocross/i686-pc-linux-gnu/include -isystem /Users/iansmith/oder/gocross/i686-pc-linux-gnu/sys-include -g -O2 -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 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector -Dinhibit_libc -I. -I. -I../.././gcc -I../../../gcc_4_6_3_release/libgcc -I../../../gcc_4_6_3_release/libgcc/. -I../../../gcc_4_6_3_release/libgcc/../gcc -I../../../gcc_4_6_3_release/libgcc/../include -I../../../gcc_4_6_3_release/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o bid_decimal_globals.o -MT bid_decimal_globals.o -MD -MP -MF bid_decimal_globals.dep -c ../../../gcc_4_6_3_release/libgcc/config/libbid/bid_decimal_globals.c
Code: Select all
../../../gcc_4_6_3_release/libgcc/config/libbid/bid_decimal_globals.c:47:18: fatal error: fenv.h: No such file or directory
Code: Select all
$ find ../gcc_4_6_3_release/ -name fenv.h
../gcc_4_6_3_release//libstdc++-v3/include/c_compatibility/fenv.h
../gcc_4_6_3_release//libstdc++-v3/include/tr1/fenv.h
I have tried to change the CXXFLAGS that are set at the time of ./configure but that seems to have no effect.
Problem #2 has a workaround, but something seems broken and maybe it is a symptom of something I am doing wrong:
When I build gcc I get the cross compiler as gcc/xgcc in my build directory. However, the assembler in gcc/as seems to have a problem in it's script. If I go in and check the environment variables at the top:
Code: Select all
ORIGINAL_AS_FOR_TARGET="/Users/iansmith/oder/gocross/i686-pc-linux-gnu/bin/as"
ORIGINAL_LD_FOR_TARGET="/Users/iansmith/oder/gocross/i686-pc-linux-gnu/bin/ld"
ORIGINAL_PLUGIN_LD_FOR_TARGET="/Users/iansmith/oder/gocross/i686-pc-linux-gnu/bin/ld"
ORIGINAL_NM_FOR_TARGET="/Users/iansmith/oder/gocross/i686-pc-linux-gnu/bin/nm"
Any thoughts on either of these?
thanks
ian smith