configuration - Building 32 bit GCC from source on 64 bit: linking issue -
/usr/bin/ld: i386:x86-64 architecture of input file `build/gengenrtl.o' incompatible i386 output /usr/bin/ld: i386:x86-64 architecture of input file `build/errors.o' incompatible i386 output /usr/bin/ld: build/gengenrtl.o: file class elfclass64 incompatible elfclass32 /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status
i don't if problem ld
or 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 can't change ld executable easily, gcc keeps compiling global system /usr/bin/ld
.
someone can going on here , how fix linking phase ?
i'm under ubuntu 64 bit , i'm trying compile 32 bit build of gcc, of course have compiler gmp, mpc, mpfr 32 bits.
of course can build gcc source 32-bit, using 64-bit os, compiler , linker. problem not "ld".
you're doing right thing: specifying "-m32" in cflags , ldflags.
the problem build/gengenrtl.o
, build/errors.o
appear have been built 64-bit (instead of 32-bit).
suggestions:
1) check makefile, , check build log. see if there's "different" build commands 2 files.
2) use "nm" command verify rest of *.o object files correctly built 32-bit - "gengenrtl.o" , "errors.o" (incorrectly) built elfclass64.
'hope helps...
Comments
Post a Comment