This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [mips java patch] add -mxgot for libjava convenience librarieson mips/mipsel-linux


Matthias Klose wrote:
> The following patch add's -mxgot to the cflags of the convenience
> libraries as it is down for the libjava library itself on
> mips/mipsel-linux. Without this patch I see many 'relocation
> truncated to fit: R_MIPS_CALL16' failures when linking the convenience
> libs, with this patch I'm down to one file/bug in glibc when linking
> libgcj:
> 
> /home/doko/gcc/gcc-snapshot-20041003/build/gcc/xgcc -shared-libgcc -B/home/doko/gcc/gcc-snapshot-20041003/build/gcc/ -nostdinc++ -L/home/doko/gcc/gcc-snapshot-20041003/build/mipsel-linux-gnu/libstdc++-v3/src -L/home/doko/gcc/gcc-snapshot-20041003/build/mipsel-linux-gnu/libstdc++-v3/src/.libs -B/usr/lib/gcc-snapshot/mipsel-linux-gnu/bin/ -B/usr/lib/gcc-snapshot/mipsel-linux-gnu/lib/ -isystem /usr/lib/gcc-snapshot/mipsel-linux-gnu/include -isystem /usr/lib/gcc-snapshot/mipsel-linux-gnu/sys-include -shared -nostdlib /usr/lib/crti.o /home/doko/gcc/gcc-snapshot-20041003/build/gcc/crtbeginS.o .libs/libgcj.la-2.o -Wl,--whole-archive ../libffi/.libs/libffi_convenience.a ../boehm-gc/.libs/libgcjgc_convenience.a ./libltdl/.libs/libltdlc.a -Wl,--no-whole-archive  -L/home/doko/gcc/gcc-snapshot-20041003/build/mipsel-linux-gnu/libstdc++-v3/src -L/home/doko/gcc/gcc-snapshot-20041003/build/mipsel-linux-gnu/libstdc++-v3/src/.libs -L/home/doko/gcc/gcc-snapshot-20041003/build/mipsel-linux-gnu
/libjava ../libffi/.libs/libffi_convenience.a ../boehm-gc/.libs/libgcjgc_convenience.a -lpthread ./libltdl/.libs/libltdlc.a -ldl -lz -L/home/doko/gcc/gcc-snapshot-20041003/build/gcc -lgcc_s -lc -lgcc_s    /home/doko/gcc/gcc-snapshot-20041003/build/gcc/crtendS.o /usr/lib/crtn.o  -Wl,-soname -Wl,libgcj.so.6 -o .libs/libgcj.so.6.0.0
> /usr/lib/libc_nonshared.a(atexit.oS)(.text+0x38): In function `atexit':
> : relocation truncated to fit: R_MIPS_CALL16 __cxa_atexit@@GLIBC_2.2
> collect2: ld returned 1 exit status
> make[2]: *** [libgcj.la] Error 1
> 

This looks like a problem with libc_nonshared.a, not anything in libgcj.
Why the hacking in libgcj?


> 
> Ok to checkin?
> 
> 
> 2004-10-05  Matthias Klose  <doko@debian.org>
> 
> boehm-gc/ChangeLog
> 
> 	* configure.host: for mips*-*-linux* add -mxgot to gc_cflags
> 
> libffi/ChangeLog
> 
> 	* configure.ac: Set libffi_cflags, substitute LIBFFI_CFLAGS.
> 	* configure.host: for mips*-*-linux* add -mxgot to gc_cflags
> 	* Makefile.am (AM_CFLAGS, AM_CCASFLAGS): Add @LIBFFI_CFLAGS@.
> 	* Makefile.in: Regenerate.
> 	* configure: Regenerate.
> 
> libjava/ChangeLog:
> 
> 	* libltdl/Makefile.am (AM_CFLAGS): Add @LIBLTDL_CFLAGS@.
> 	* libltdl/Makefile.in: Regenerate.
> 	* libltdl/configure.ac: Set libltdl_cflags, substitute LIBLTDL_CFLAGS.
> 	* libltdl/configure: Regenerate.
> 
What version of binutils are you using?

I use 2.15 and have not seen this problem although it has been about two
weeks since I did a build.  I would rather see people upgrade their
binutils (as versions prior to 2.15 also cause bad code generation) than
hork things up with unnecessary -mxgots

The only reason that libgcj needs -mxgot is that libtool is broken and does
incremental linking.

David Daney.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]