I compiled GMP as a static library only on darwin. So when compiling the trunk or the 4.4 branch on powerpc-darwin, I get: /usr/bin/ld: /usr/local/lib/libgmp.a(popcount.o) has local relocation entries in non-writable section (__TEXT,__text) This started to happen between 134948 and 144367.
So it looks like GMP is needed now as a target library for libgcj to work and this is not documented anywhere I think.
It is? Anyway, you should build static gmp with -fPIC.
This doesn't look like a GCC bug, but user error.
Subject: Re: [4.4/4.5 Regression] libjavamath is linking against libgmp Sent from my iPhone On Apr 26, 2009, at 11:54 PM, "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org > wrote: > > > ------- Comment #3 from jakub at gcc dot gnu dot org 2009-04-27 > 06:54 ------- > This doesn't look like a GCC bug, but user error. It is a gcc bug as this dependency is not documented this way. At least I could not find the documention for this one. > > > > -- > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39747 >
Confirmed.
I had this problem on a Linux x86_64 build, manifested with the error /usr/local/lib/libgmp.so: could not read symbols: File in wrong format collect2: ld returned 1 exit status ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42750 ) I'm adding that text here so that if someone else has that problem and searches for it, they can find this bug entry. How does one configure gmp to build correctly so that it can be used by gcc? I can't find any doc in the gmp configure/texinfo that describes how to do that. I ran configure for it and it says -fPIC works in the log, but it does not put -fPIC in the Makefile. I explicitly added it to the CFLAGS in my Makefile CFLAGS = -O2 -pedantic -m64 -mtune=k8 -fPIC and rebuilt it; make check work (in gmp).
Classpath install requirements are not documented in install.texi at all so there is no precedent for a classpath related change to qualify as GCC regression. What is at fault is that when building a shared library classpath configury does not properly test for a usable libgmp. Re-targeting to classpath, removing regression markers. install.texi could have an enhancement bug to mention classpath and its configury.
Is this still relevant now that gcc no longer ships with java?
(In reply to Eric Gallager from comment #8) > Is this still relevant now that gcc no longer ships with java? No, not really.