This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Still failing to bootstrap on Solaris (CONFIG_SHELL doesn't help)


On May  2, 2002, Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> wrote:

> David S. Miller writes:
>> Rainer, thanks for helping us track this down.

> It's always fun to rebut claims of Solaris brokenness :-)

I always like when a misunderstanding of mine gets me enlightened at
the end :-)

Thanks for keeping me straight.  Here's the patch I'm testing right
now, on a relatively slow Solaris 7 box.  I'm posting it such that
people with access to faster boxes can test it too, and to avoid
duplication of work in translating Rainer's suggestion into a patch.

Mark, if this fixes the problem on Solaris, ok to install in the 3.1
branch?

Index: libjava/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	Suggested by Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
	* Makefile.am (jv_convert_LDADD): Bring -L.libs to the front.
	(gij_LDADD, rmic_LDADD, rmiregistry_LDADD): Likewise.
	* Makefile.in: Rebuilt.

Index: libjava/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libjava/Makefile.am,v
retrieving revision 1.202.2.10
diff -u -p -r1.202.2.10 Makefile.am
--- libjava/Makefile.am 16 Apr 2002 15:52:53 -0000 1.202.2.10
+++ libjava/Makefile.am 3 May 2002 02:15:12 -0000
@@ -431,12 +431,14 @@ EXTRA_jv_convert_SOURCES = $(convert_sou
 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
 	-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
-## system libraries we need (via the specs file).
-## We need the -L so that gcj can find libgcj with `-lgcj'.
-## FIXME: should be _libs on some systems.
-jv_convert_LDADD = libgcj.la -L$(here)/.libs
+## We don't explicitly link in the libraries we need; libgcj.la brings
+## in all dependencies.  We need the -L so that gcj can find libgcj
+## with `-lgcj', but it must come first, otherwise the -L flags
+## brought in from libgcj.la would cause the install directories to be
+## searched before the build-tree ones, and we'd get errors because of
+## different libraries with the same SONAME from picky linkers such as
+## Solaris'.  FIXME: should be _libs on some systems.
+jv_convert_LDADD = -L$(here)/.libs libgcj.la
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) \
@@ -448,12 +450,8 @@ gij_SOURCES = gij.cc
 ## `.la' file.
 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
-## system libraries we need (via the specs file).
-## We need the -L so that gcj can find libgcj with `-lgcj'.
-## FIXME: should be _libs on some systems.
-gij_LDADD = libgcj.la -L$(here)/.libs
+## See jv_convert_LDADD.
+gij_LDADD = -L$(here)/.libs libgcj.la
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 gij_DEPENDENCIES = libgcj.la libgcj.spec
@@ -464,12 +462,8 @@ EXTRA_rmic_SOURCES = $(rmi_java_source_f
 rmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
 	-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
-## system libraries we need (via the specs file).
-## We need the -L so that gcj can find libgcj with `-lgcj'.
-## FIXME: should be _libs on some systems.
-rmic_LDADD = libgcj.la -L$(here)/.libs
+## See jv_convert_LDADD.
+rmic_LDADD = -L$(here)/.libs libgcj.la
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 rmic_DEPENDENCIES = libgcj.la libgcj.spec
@@ -480,12 +474,8 @@ EXTRA_rmiregistry_SOURCES = $(rmi_java_s
 rmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
 	-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
-## system libraries we need (via the specs file).
-## We need the -L so that gcj can find libgcj with `-lgcj'.
-## FIXME: should be _libs on some systems.
-rmiregistry_LDADD = libgcj.la -L$(here)/.libs
+## See jv_convert_LDADD.
+rmiregistry_LDADD = -L$(here)/.libs libgcj.la
 ## Depend on the spec file to make sure it is up to date before
 ## linking this program.
 rmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* configure.in: Revert 2002-04-18's patch; fixed in libjava.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.119.2.12
diff -u -p -r1.119.2.12 configure.in
--- configure.in 26 Apr 2002 21:40:53 -0000 1.119.2.12
+++ configure.in 3 May 2002 02:15:00 -0000
@@ -1379,33 +1379,6 @@ case "${host}" in
   ;;
 esac
 
-# If we're building libgcj and we're using the Solaris 2.8 linker,
-# then we check for a known problem.
-if test "x${libgcj}" = x && test "${with_gnu_ld}" != yes \
-   && test "${is_cross_compiler}" = no; then
-
-   case "${host}" in
-    sparc-*-solaris2.8)
-       if test "$libdir" = '${exec_prefix}/lib';then
-	  if test "$exec_prefix" = '$(prefix)'; then
-	     tlibdir="$prefix/lib"
-	  else
-	     tlibdir="$exec_prefix/lib"
-	  fi
-       else
-	  tlibdir="$libdir"
-       fi
-       if test -f $tlibdir/libgcj.la; then
-	  echo "*** You've already installed libgcj in $tlibdir." 1>&2
-	  echo "    This causes problems when rebuilding libgcj with the Solaris 2.8 linker." 1>&2
-	  echo "    Either disable the libgcj build, or remove the" 1>&2
-	  echo "    already-installed libgcj files." 1>&2
-	  exit 1
-       fi
-       ;;
-   esac
-fi
-
 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
 # binutils tools will find libbfd.so.
 if [ "${shared}" = "yes" ]; then

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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