RFC: patch for PR 6158 (important for 3.1)

Tom Tromey tromey@redhat.com
Mon Apr 15 13:55:00 GMT 2002


I wrote the appended patch as an attempt to address the problem in PR
6158.

The idea is that we check for the one known failure mode and reject
it.

I don't think this is really quite perfect.  In particular it seems to
me that the user will also experience problems if he happens to make a
change to libgcj and then rebuilds an already built-and-installed
tree.  I'm not as concerned about this scenario, though, since we can
always tell these users what is going on.

Comments?  Questions?

Alexandre, is it possible for libtool to work around this somehow?  If
not, won't this be a problem for any libtool-using package that links
an executable against a shared library it also installs?

I tested this on the affected platform.  Ok to commit?

Tom


Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* configure.in: Disallow configuring libgcj when it is already
	installed and we're using Solaris 2.8 linker.  Do enable libgcj on
	Solaris 2.8 by default.  For PR libgcj/6158.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.119.2.8
diff -u -r1.119.2.8 configure.in
--- configure.in 10 Apr 2002 02:52:12 -0000 1.119.2.8
+++ configure.in 15 Apr 2002 20:51:39 -0000
@@ -1012,15 +1012,6 @@
     fi
     ;;
   sparc-*-solaris*)
-    case "${host}" in
-    sparc-*-solaris2.8)
-      # According to Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, libjava
-      # won't build correctly on Solaris 8 if there's a
-      # previously-installed version of GCC in the configured prefix.
-      # This problem does not show up on earlier versions of Solaris.
-      noconfigdirs="$noconfigdirs ${libgcj}"
-      ;;
-    esac
     ;;
   v810-*-*)
     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
@@ -1374,6 +1365,33 @@
       fi
   ;;
 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.



More information about the Java-patches mailing list