building GCC for 32-bit i586
Hi everyone.
I've installed (to non-default location) side version of glibc configured with --host=pentium-linux , as my primary goal is to build statically linked executables for 32bit Pentium ISA. To avoid problems of pairing my default gcc/g++ with my side glibc, I decided to install side version of GCC as well, using my side glibc as a sysroot. I configured GCC with --with-sysroot=/path/to/my/glibc --target=i586-linux --disable-multilib --with-multilib-list=m32 GCC build goes for some time, then fails with Code:
g++ -m32 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genconstants \ gcc -O2 -g ...and different defines and source file... No -march=pentium, no -m32, nothing. Looks like my configure settings --target=i586-linux --disable-multilib --with-multilib-list=m32 didn't affect all that is needed. What do I do? Do I have to set CFLAGS/CXXFLAGS in addition? Thanks a lot. |
Hopefully you created a script for compilation, sg like this:
Code:
#!/bin/sh |
Quote:
../gcc-4.8.4/configure --prefix=/future/path/to/my/gcc/install --with-sysroot=/path/to/my/glibc/install --target=i586-linux --disable-multilib --with-multilib-list=m32 And then typed make. Configure script itself in in gcc source folder. Makefile is created by configure script. Make log is too long to quote. What should I quote? P.S. my compilation script would be those two lines: ../gcc-4.8.4/configure --prefix=/future/path/to/my/gcc/install --with-sysroot=/path/to/my/glibc/install --target=i586-linux --disable-multilib --with-multilib-list=m32 make |
You might want to add this to your nonexistent script, before the ./configure:
Code:
export CFLAGS="$CFLAGS -m32" |
I just noticed, that I accidentally had CC env.var set to 'gcc -march=pentium -m32 -O2' - this was left after I was building glibc in same shell session.
I started gcc configure/build from scratch, this time opening new login terminal without any CC-related enviroment variables. Just totally relying on configuring script doing what needed. And now I have different failure: ../gcc-4.8.4/configure --prefix=/future/path/to/my/gcc/install --with-sysroot=/path/to/my/glibc/install --target=i586-linux --disable-multilib --with-multilib-list=m32 make Code:
checking for i586-linux-ranlib... i586-linux-ranlib Code:
configure:3347: /my/path/to/gcc/build/./gcc/xgcc -B/my/path/to/gcc/build/./gcc/ -B/my/path/to/gcc/install/i586-linux/bin/ -B/my/path/to/gcc/install/i586-linux/lib/ -isystem /my/path/to/gcc/install/i586-linux/include -isystem /my/path/to/gcc/install/i586-linux/sys-include -V >&5 Code:
g++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o xgcc gcc.o ggc-none.o \ |
Please read glibc howto from http://www.tldp.org.
|
All times are GMT -5. The time now is 08:31 PM. |