public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/44415]  New: [4.6 regression] gmp multilib support broke bootstrap with static libgmp
@ 2010-06-04 12:41 ro at gcc dot gnu dot org
  2010-06-04 12:49 ` [Bug libgcj/44415] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: ro at gcc dot gnu dot org @ 2010-06-04 12:41 UTC (permalink / raw)
  To: java-prs

The recent introduction of this patch

2010-05-29  Mike Stump  <mikestump@comcast.net>

        * configure.ac: Add multilib support for gmp.  Proper -I and -L
        flags for gmp are added.

broke bootstrap on i386-pc-solaris2.11 and almost certainly at least all
Solaris 2
platforms with a static libgmp:

/bin/ksh ../../../libtool --tag=CC   --mode=link
/vol/gcc/obj/gcc-4.6.0-20100602/11-gcc/./gcc/xgcc
-B/vol/gcc/obj/gcc-4.6.0-20100602/11-gcc/./gcc/
-B/vol/gcc/i386-pc-solaris2.11/bin/ -B/vol/gcc/i386-pc-solaris2.11/lib/
-isystem /vol/gcc/i386-pc-solaris2.11/include -isystem
/vol/gcc/i386-pc-solaris2.11/sys-include    -W -Wall -Wmissing-declarations
-Wwrite-strings -Wmissing-prototypes -Wno-long-long  -I/vol/gcc/include  -g -O2
-module -version-info 0:0:0 -no-undefined -L/vol/gcc/lib -lgmp -avoid-version 
-o libjavamath.la -rpath /vol/gcc/lib/gcj-4.6.0-11 gnu_java_math_GMP.lo
../../../native/jni/classpath/jcl.lo -lsocket -lnsl 
libtool: link: /vol/gcc/obj/gcc-4.6.0-20100602/11-gcc/./gcc/xgcc
-B/vol/gcc/obj/gcc-4.6.0-20100602/11-gcc/./gcc/
-B/vol/gcc/i386-pc-solaris2.11/bin/ -B/vol/gcc/i386-pc-solaris2.11/lib/
-isystem /vol/gcc/i386-pc-solaris2.11/include -isystem
/vol/gcc/i386-pc-solaris2.11/sys-include    -shared -Wl,-z -Wl,text -Wl,-h
-Wl,libjavamath.so -o .libs/libjavamath.so  .libs/gnu_java_math_GMP.o
../../../native/jni/classpath/.libs/jcl.o   -L/vol/gcc/lib
/vol/gcc/lib/libgmp.a -lsocket -lnsl -lc   
Text relocation remains                         referenced
    against symbol                  offset      in file
.rodata.str1.4 (section)            0x2e       
/vol/gcc/lib/libgmp.a(lt19-get_str.o)
[...]

The static libgmp is usually non-PIC, while we need PIC code to link
libjavamath.so.

It turned out to be remarkably difficult to work around this:

* While gcc on Solaris supports -mimpure-text to allow linking of non-PIC code
  into a shared library, all this does is disable the implicit -z text enabled
  by gcc -shared.  Since libtool passes -z text by itself, this doesn't help.

* Sun ld doesn't allow -z text -z textoff, so I had to resort to edititing
  -z text out of libtool and adding -mimpure-text after the -shared there.

To fix this for real, one needs to build a PIC libgmp.a, which at the very
least
needs to be documented.

Apart from that, the patch has a couple of other problems:

* The ChangeLog entry belongs into classpath/ChangeLog, not libjava/ChangeLog.

* For multilibbed targets, it used to be enough to have libgmp for the default
  multilib.  Now you need libgmp for every multilib, otherwise the facitilies
  between e.g. 32-bit and 64-bit libjavamath.so differ.

* There seems to be no provision to pass in -L and -R flags for the non-default
  multilibs, and neither libtool nor the libjava/classpath make machinery seem
  to support automatically looking in e.g. $libdir/amd64 for 64-bit multilibs.

It seems this needs considerably more work to be complete and useful.


-- 
           Summary: [4.6 regression] gmp multilib support broke bootstrap
                    with static libgmp
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ro at gcc dot gnu dot org
 GCC build triplet: *-*-solaris2.*
  GCC host triplet: *-*-solaris2.*
GCC target triplet: *-*-solaris2.*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44415


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-10-19  7:08 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44415-8172@http.gcc.gnu.org/bugzilla/>
2011-01-19 12:01 ` [Bug libgcj/44415] [4.6 regression] gmp multilib support broke bootstrap with static libgmp rguenth at gcc dot gnu.org
2011-01-19 18:11 ` mrs at gcc dot gnu.org
2011-03-25 20:08 ` [Bug libgcj/44415] [4.6/4.7 " jakub at gcc dot gnu.org
2011-06-27 16:14 ` jakub at gcc dot gnu.org
2011-10-26 18:04 ` jakub at gcc dot gnu.org
2012-03-01 15:38 ` jakub at gcc dot gnu.org
2013-04-12 15:18 ` [Bug libgcj/44415] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
2014-06-12 13:49 ` [Bug libgcj/44415] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:34 ` [Bug libgcj/44415] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-06-23  8:28 ` [Bug libgcj/44415] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 20:02 ` [Bug libgcj/44415] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:32 ` jakub at gcc dot gnu.org
2021-10-19  7:08 ` [Bug libgcj/44415] [5/6/7 " mark at gcc dot gnu.org
2010-06-04 12:41 [Bug libgcj/44415] New: [4.6 " ro at gcc dot gnu dot org
2010-06-04 12:49 ` [Bug libgcj/44415] " rguenth at gcc dot gnu dot org
2010-06-04 17:48 ` pinskia at gcc dot gnu dot org
2010-06-04 17:49 ` pinskia at gcc dot gnu dot org
2010-06-07 14:03 ` ro at CeBiTec dot Uni-Bielefeld dot DE
2010-08-25 16:44 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).