[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[mips java patch] add -mxgot for libjava convenience libraries on mips/mipsel-linux



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


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.


diff -ur --exclude=Makefile.in --exclude=configure src.old/boehm-gc/configure.host src/boehm-gc/configure.host
--- src.old/boehm-gc/configure.host	2003-07-28 04:18:20.000000000 +0000
+++ src/boehm-gc/configure.host	2004-10-03 19:55:21.000000000 +0000
@@ -56,6 +56,9 @@
   mips-tx39-*|mipstx39-unknown-*)
 	gc_cflags="${gc_cflags} -G 0"
 	;;
+  mips*-*-linux*)
+	gc_cflags="${gc_cflags} -mxgot"
+	;;
   *)
 	;;
 esac
diff -ur --exclude=Makefile.in --exclude=configure src.old/libffi/Makefile.am src/libffi/Makefile.am
--- src.old/libffi/Makefile.am	2004-10-03 07:03:05.000000000 +0000
+++ src/libffi/Makefile.am	2004-10-03 21:22:44.000000000 +0000
@@ -138,9 +138,9 @@
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
-AM_CFLAGS = -Wall -g -fexceptions
+AM_CFLAGS = -Wall -g -fexceptions @LIBFFI_CFLAGS@
 
 libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
-AM_CCASFLAGS = $(AM_CPPFLAGS)
+AM_CCASFLAGS = $(AM_CPPFLAGS) @LIBFFI_CFLAGS@
diff -ur --exclude=Makefile.in --exclude=configure src.old/libffi/configure.ac src/libffi/configure.ac
--- src.old/libffi/configure.ac	2004-10-03 07:03:05.000000000 +0000
+++ src/libffi/configure.ac	2004-10-03 19:18:33.000000000 +0000
@@ -10,8 +10,16 @@
 AC_CANONICAL_SYSTEM
 target_alias=${target_alias-$host_alias}
 
+# configure.host sets the following important variables
+#       libffi_cflags    - host specific C compiler flags
+
+libffi_cflags=
+
 . ${srcdir}/configure.host
 
+LIBFFI_CFLAGS="${libffi_cflags}"
+AC_SUBST(LIBFFI_CFLAGS)
+
 AM_INIT_AUTOMAKE
 
 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
diff -ur --exclude=Makefile.in --exclude=configure src.old/libffi/configure.host src/libffi/configure.host
--- src.old/libffi/configure.host	2004-08-30 15:43:00.000000000 +0000
+++ src/libffi/configure.host	2004-10-03 19:26:40.000000000 +0000
@@ -8,4 +8,7 @@
   frv*-elf)
     LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
     ;;
+  mips*-*-linux* )
+    libffi_cflags="$libffi_cflags -mxgot"
+    ;;
 esac
diff -ur --exclude=Makefile.in --exclude=configure src.old/libjava/libltdl/Makefile.am src/libjava/libltdl/Makefile.am
--- src.old/libjava/libltdl/Makefile.am	2003-12-16 21:48:24.000000000 +0000
+++ src/libjava/libltdl/Makefile.am	2004-10-03 20:45:19.000000000 +0000
@@ -4,6 +4,8 @@
 
 INCLUDES = $(GCINCS)
 
+AM_CFLAGS = @LIBLTDL_CFLAGS@
+
 if INSTALL_LTDL
 include_HEADERS = ltdl.h
 lib_LTLIBRARIES = libltdl.la
diff -ur --exclude=Makefile.in --exclude=configure src.old/libjava/libltdl/configure.ac src/libjava/libltdl/configure.ac
--- src.old/libjava/libltdl/configure.ac	2004-10-03 07:03:44.000000000 +0000
+++ src/libjava/libltdl/configure.ac	2004-10-03 20:44:44.000000000 +0000
@@ -69,6 +69,16 @@
 
 AC_LIB_LTDL
 
+# configure.host sets the following important variables
+#       libltdl_cflags    - host specific C compiler flags
+
+libltdl_cflags=
+
+. ${srcdir}/../configure.host
+
+LIBLTDL_CFLAGS="${libltdl_cflags} ${libgcj_cflags}"
+AC_SUBST(LIBLTDL_CFLAGS)
+
 
 ## -------- ##
 ## Outputs. ##

Reply to: