public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "ro at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/44415]  New: [4.6 regression] gmp multilib support broke bootstrap with static libgmp
Date: Fri, 04 Jun 2010 12:41:00 -0000	[thread overview]
Message-ID: <bug-44415-279@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2010-06-04 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 12:41 ro at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-44415-279@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).