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: 3.2.3-pre tarball 2: libjava build still fails on sparc-sun-solaris2.8


On Apr 21, 2003, Gabriel Dos Reis <gdr at integrable-solutions dot net> wrote:

> Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at> writes:

> | Interestingly, my problem is libtool-related as well.

I find this reasoning interesting...  It is as libtool-related as
make-related and shell-related, if you ask me.  I mean, you're
starting from a shell, right?  And it is make that starts libtool,
right?  And libtool starts the linker, right?  And the linker fails
because it's buggy.  So...  It's pretty obvious that it's libtool's
fault, right? :-D

> | I first reported a variant of this problem in
> |   http://gcc.gnu.org/ml/gcc/2002-06/threads.html#00284
> | but didn't notice it on the 3.2 branch until now, because I had Java
> | disabled on the slow Solaris boxes. :-(

> Well, it seems that that issue had been debated in-depth; I would really
> appreciate  if Alexandre Oliva or Tom Tromey or any libtool-guru could
> jump in and enlighten me.

The one thing that is getting me confused is the long list of object
files in the link command.  libtool could use -z allextract instead of
extracting the object files itself.  Currently, for some reason,
libtool would use it when using Sun CC, or gcc as a C or Java linker,
but not when using gcc as a C++ linker (I haven't investigated why it
thinks we're doing C++ instead of Java).

Gerald, could you please test whether this patch fixes the problem?
If so, will you please check it into the release branch?
Thanks,

Index: ChangeLog
from  Alexandre Oliva  <aoliva at redhat dot com>

	* ltcf-cxx.sh (whole_archive_flag_spec): Use -z allextract on
	Solaris 2.6 and above, with GCC and non-GNU ld.

Index: ltcf-cxx.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-cxx.sh,v
retrieving revision 1.25
diff -u -p -r1.25 ltcf-cxx.sh
--- ltcf-cxx.sh 20 Feb 2003 01:11:51 -0000 1.25
+++ ltcf-cxx.sh 23 Apr 2003 18:21:14 -0000
@@ -612,6 +612,16 @@ case $host_os in
         # GNU C++ compiler with Solaris linker
         if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
 	  no_undefined_flag=' ${wl}-z ${wl}defs'
+          case $host_os in
+          solaris2.[0-5] | solaris2.[0-5].*) ;;
+          *)
+            # The C++ compiler is used as linker so we must use $wl
+            # flag to pass the commands to the underlying system
+            # linker.
+            # Supported since Solaris 2.6 (maybe 2.5.1?)
+            whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+            ;;
+          esac
           if $CC --version | egrep -v '^2\.7' > /dev/null; then
             archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
             archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva at {lsd dot ic dot unicamp dot 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]