/usr/bin/ld: i386:x86-64 architecture of input file `build/gengenrtl.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `build/errors.o' is incompatible with i386 output
/usr/bin/ld: build/gengenrtl.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
I don't get if the problem is ld
or the given library.
my configuration is
CC="gcc -m32" \
CFLAGS="-m32" \
LD="<path>/bin/32/binutils/2.23.2/bin/ld" \
LDFLAGS="-m32" \
./configure \
--build=i586-pc-linux-gnu \
--host=i586-pc-linux-gnu \
--target=i586-pc-linux-gnu \
--enable-shared \
--enable-static \
--enable-languages=c,c++ \
--enable-bootstrap \
--prefix=<path>/bin/32/gcc/i586 \
--disable-stage1-checking \
--with-gmp=<path>/lib/32/gmp/5.1.2 \
--with-mpfr=<path>/lib/32/mpfr/3.1.2 \
--with-mpc=<path>/lib/32/mpc/1.0.1 \
--with-cloog=<path>/lib/32/cloog/0.18.0 \
--without-ppl
Apparently I can't change the ld executable so easily, gcc keeps compiling with the global system /usr/bin/ld
.
Someone can say what is going on here and how to fix this linking phase ?
I'm under Ubuntu 64 bit and I'm trying to compile a 32 bit build of gcc, of course I have already compiler gmp, mpc, mpfr for 32 bits.