Patch: FYI: THREADLDFLAGS

Tom Tromey tromey@redhat.com
Mon Mar 25 16:58:00 GMT 2002


I'm checking this in on the trunk and the branch.

This fixes a FreeBSD regression noted by Loren James Rittle.
He verified that the patch works.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* Makefile.am (libgcj_la_LDFLAGS): Use THREADLDFLAGS.
	(jv_convert_LDFLAGS): Likewise.
	(gij_LDFLAGS): Likewise.
	(rmic_LDFLAGS): Likewise.
	(rmiregistry_LDFLAGS): Likewise.
	* configure.in (THREADLDFLAGS): New subst; set correctly for
	*BSD.

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.202.2.7
diff -u -r1.202.2.7 Makefile.am
--- Makefile.am 2002/03/17 01:07:56 1.202.2.7
+++ Makefile.am 2002/03/26 00:51:10
@@ -137,9 +137,9 @@
 	$(THREADOBJS) $(PLATFORMOBJS)
 # Include THREADLIBS here to ensure that the correct version of
 # certain linuxthread functions get linked:
-libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLIBS) $(LIBLTDL) \
-	$(SYS_ZLIBS) \
-## The mysterious backslash is consumed by make.
+libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
+	$(LIBLTDL) $(SYS_ZLIBS) \
+## The mysterious backslash is consumed by make.
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
 libgcj_la_LINK = $(LIBLINK)
 
@@ -423,7 +423,7 @@
 ## need this because we are explicitly using libtool to link using the
 ## `.la' file.
 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
-	-rpath $(toolexeclibdir) -shared-libgcc
+	-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
 jv_convert_LINK = $(GCJLINK)
 ## We explicitly link in the libraries we need.  This way we don't
 ## need -nodefaultlibs, so we can still rely on gcj picking up the
@@ -440,7 +440,7 @@
 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
 ## need this because we are explicitly using libtool to link using the
 ## `.la' file.
-gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc
+gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
 gij_LINK = $(GCJLINK)
 ## We explicitly link in the libraries we need.  This way we don't
 ## need -nodefaultlibs, so we can still rely on gcj picking up the
@@ -456,7 +456,7 @@
 ## This is a dummy definition.
 EXTRA_rmic_SOURCES = $(rmi_java_source_files)
 rmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
-	-rpath $(toolexeclibdir) -shared-libgcc
+	-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
 rmic_LINK = $(GCJLINK)
 ## We explicitly link in the libraries we need.  This way we don't
 ## need -nodefaultlibs, so we can still rely on gcj picking up the
@@ -472,7 +472,7 @@
 ## This is a dummy definition.
 EXTRA_rmiregistry_SOURCES = $(rmi_java_source_files)
 rmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
-	-rpath $(toolexeclibdir) -shared-libgcc
+	-rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
 rmiregistry_LINK = $(GCJLINK)
 ## We explicitly link in the libraries we need.  This way we don't
 ## need -nodefaultlibs, so we can still rely on gcj picking up the
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.114.2.7
diff -u -r1.114.2.7 configure.in
--- configure.in 2002/03/18 06:30:17 1.114.2.7
+++ configure.in 2002/03/26 00:51:11
@@ -348,6 +348,7 @@
     ;;
 esac
 
+THREADLDFLAGS=
 THREADLIBS=
 THREADINCS=
 THREADDEPS=
@@ -366,7 +367,7 @@
 	# Before FreeBSD 5, it didn't have -lpthread (or any library which
 	# merely adds pthread_* functions) but it does have a -pthread switch
 	# which is required at link-time to select -lc_r *instead* of -lc.
-	THREADLIBS=-pthread
+	THREADLDFLAGS=-pthread
 	# Don't set THREADSPEC here as might be expected since -pthread is
 	# not processed when found within a spec file, it must come from
 	# the command line.  For now, the user must provide the -pthread
@@ -378,7 +379,7 @@
 	# FreeBSD 5 implements a model much closer to other modern UNIX
 	# which support threads.  However, it still does not support
 	# -lpthread.
-	THREADLIBS=-pthread
+	THREADLDFLAGS=-pthread
 	THREADSPEC=-lc_r
 	;;
      *)
@@ -417,6 +418,7 @@
 AC_SUBST(THREADDEPS)
 AC_SUBST(THREADOBJS)
 AC_SUBST(THREADSPEC)
+AC_SUBST(THREADLDFLAGS)
 
 AC_LINK_FILES(sysdep/$sysdeps_dir, sysdep)
 



More information about the Java-patches mailing list