Tuesday, April 19, 2005

ld relocation error R_SPARC_DISP32 gcj

If you forget --disable-multilib in a solaris compile of gcc, this is what happens (during java)

/bin/sh ./libtool --tag=GCJ --mode=link /BUILD/gcc/gcj -B/BUILD/sparc-sun-solaris2.9/sparcv9/libjava/ -B/BUILD/gcc/ -L/BUILD/sparc-sun-solaris2.9/sparcv9/libjava -g -O2 -m64 -m64 -o jv-convert --main=gnu.gcj.convert.Convert -rpath /INSTALL/lib/sparcv9 -shared-libgcc -L/BUILD/sparc-sun-solaris2.9/sparcv9/libjava/.libs libgcj.la

/BUILD/gcc/gcj -B/BUILD/sparc-sun-solaris2.9/sparcv9/libjava/ -B/BUILD/gcc/ -g -O2 -m64 -m64 -o jv-convert --main=gnu.gcj.convert.Convert -shared-libgcc -L/BUILD/sparc-sun-solaris2.9/sparcv9/libjava -L/BUILD/sparc-sun-solaris2.9/sparcv9/libjava/.libs ./.libs/libgcj.a -L/BUILD/sparc-sun-solaris2.9/sparcv9/libstdc++-v3/src -L/BUILD/sparc-sun-solaris2.9/sparcv9/libstdc++-v3/src/.libs -lpthread -lrt -ldl -L/BUILD/gcc/sparcv9 -L/BUILD/gcc -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/lib/sparcv9 -L/usr/lib/sparcv9 -lgcc -lgcc -Wl,-R -Wl,/INSTALL/lib/sparcv9

ld: fatal: relocation error: R_SPARC_DISP32: file ./.libs/libgcj.a(prims.o): symbol : offset 0xffffffff722fbc71 is non-aligned

ld: fatal: relocation error: R_SPARC_DISP32: file ./.libs/libgcj.a(prims.o): symbol : offset 0xffffffff722fbc91 is non-aligned

ld: fatal: relocation error: R_SPARC_DISP32: file ./.libs/libgcj.a(jni.o): symbol : offset 0xffffffff722fbeb9 is non-aligned

...etc.

I am using the patched binutils 2.15 as described in http://gcc.gnu.org/install/specific.html in the *-*-solaris2* section. The --disable-multilib flag is in that document, too.

No comments :