Bug 50952 - libquad relocation R_X86_64_32S failure
Summary: libquad relocation R_X86_64_32S failure
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.3
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2011-11-01 22:42 UTC by kargls
Modified: 2011-12-15 16:43 UTC (History)
1 user (show)

See Also:
Host:
Target: *-*-freebsd10.0
Build:
Known to work:
Known to fail: 4.6.3, 4.7.0
Last reconfirmed:


Attachments
build log (17.71 KB, application/octet-stream)
2011-11-01 22:42 UTC, kargls
Details
install log (13.07 KB, application/octet-stream)
2011-11-01 22:42 UTC, kargls
Details
conf46.diff (1.10 KB, text/x-diff)
2011-11-04 23:01 UTC, Steve Kargl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kargls 2011-11-01 22:42:07 UTC
Created attachment 25682 [details]
build log

With both 4.6.3 and trunk, I'm seeing problems with libquad, which is
completely baffling me.  The 'gmake bootstrap' completes as expected,
but 'gmake install' dies with 

gfortran.so.3.0 -o .libs/libgfortran.so.3.0
/usr/bin/ld: /home/sgk/work/46/lib/libquadmath.a(fmodq.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/home/sgk/work/46/lib/libquadmath.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
libtool: install: error: relink `libgfortran.la' with the above command before installing it
gmake[4]: *** [install-toolexeclibLTLIBRARIES] Error 1
gmake[4]: Leaving directory `/usr/home/sgk/gcc/obj46/x86_64-unknown-freebsd10.0/libgfortran'
gmake[3]: *** [install-am] Error 2
gmake[3]: Leaving directory `/usr/home/sgk/gcc/obj46/x86_64-unknown-freebsd10.0/libgfortran'
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory `/usr/home/sgk/gcc/obj46/x86_64-unknown-freebsd10.0/libgfortran'
gmake[1]: *** [install-target-libgfortran] Error 2
gmake[1]: Leaving directory `/usr/home/sgk/gcc/obj46'
gmake: *** [install] Error 2

I've redirected the the output to files and the -fPIC is already on
the command line.  What seems odd to me is that the 'gmake install'
is relinking the libquadmath.so shared library.  I've attached
'gmake |& build.log' and 'gmake install |& install.log'
Comment 1 kargls 2011-11-01 22:42:39 UTC
Created attachment 25683 [details]
install log
Comment 2 kargls 2011-11-01 22:43:40 UTC
I shoudl note that the shared libraries for libgfortran are
properly build and installed.  This seems to be a libquadmath
issue.
Comment 3 kargls 2011-11-01 22:53:02 UTC
It looks like a problem with libquadmath/configure.  I recently
updated by bleeding edge freebsd system to FreeBSD 10.0, and
it looks like configure can't handle the new version number.

troutmask:sgk[222] pwd
/usr/home/sgk/gcc/gcc4x/libquadmath
troutmask:sgk[223] grep -i freebsd * | more
aclocal.m4:# (eg FreeBSD returns the mod time of the symlink's containing
configure:# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
configure:# (eg FreeBSD returns the mod time of the symlink's containing
configure:  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
configure:freebsd* | dragonfly*)
configure:      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
configure:/* This works around a problem in FreeBSD linker */
configure:#ifdef FREEBSD_WORKAROUND
configure:x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
configure:        x86_64-*kfreebsd*-gnu)
configure:        x86_64-*kfreebsd*-gnu)
configure:    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
configure:    freebsd2.2*)
configure:    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
configure:    freebsd2*)
configure:    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
configure:    freebsd* | dragonfly*)
configure:freebsd* | dragonfly*)
configure:    freebsd[123]*) objformat=aout ;;
configure:  version_type=freebsd-$objformat
configure:    freebsd-elf*)
configure:    freebsd-*)
configure:  freebsd2*)
configure:  freebsd3.[01]* | freebsdelf3.[01]*)
configure:  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
configure:  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
configure:  version_type=freebsd-elf

I'm suspicious that the 'freebsd[123]*) objformat=aout ;;' is now bogus.
Comment 4 kargls 2011-11-01 23:02:50 UTC
(In reply to comment #3)
> It looks like a problem with libquadmath/configure.  I recently
> updated by bleeding edge freebsd system to FreeBSD 10.0, and
> it looks like configure can't handle the new version number.
> 

> configure:    freebsd[123]*) objformat=aout ;;
> configure:  version_type=freebsd-$objformat
> configure:    freebsd-elf*)
> configure:    freebsd-*)
> configure:  freebsd2*)
> configure:  freebsd3.[01]* | freebsdelf3.[01]*)
> configure:  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
> configure:  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 |
> freebsdelf4.1.1)
> configure:  version_type=freebsd-elf
> 
> I'm suspicious that the 'freebsd[123]*) objformat=aout ;;' is now bogus.

A quick hack to remove the 1 in the above line allows me
to configure, build, and install gcc/gfortran.

Anyone know how to fix this issue properly?
Comment 5 Markus Trippelsdorf 2011-11-02 05:56:14 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > It looks like a problem with libquadmath/configure.  I recently
> > updated by bleeding edge freebsd system to FreeBSD 10.0, and
> > it looks like configure can't handle the new version number.
> > 
> 
> > configure:    freebsd[123]*) objformat=aout ;;
> > configure:  version_type=freebsd-$objformat
> > configure:    freebsd-elf*)
> > configure:    freebsd-*)
> > configure:  freebsd2*)
> > configure:  freebsd3.[01]* | freebsdelf3.[01]*)
> > configure:  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
> > configure:  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 |
> > freebsdelf4.1.1)
> > configure:  version_type=freebsd-elf
> > 
> > I'm suspicious that the 'freebsd[123]*) objformat=aout ;;' is now bogus.
> 
> A quick hack to remove the 1 in the above line allows me
> to configure, build, and install gcc/gfortran.
> 
> Anyone know how to fix this issue properly?

Yes, just update in-tree libtool:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50952
Comment 6 Markus Trippelsdorf 2011-11-02 05:57:15 UTC
Created attachment 25725 [details]
conf46.diff

(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > 
> > Anyone know how to fix this issue properly?
> 
> Yes, just update in-tree libtool:
Sorry, I meant to paste this link:  http://thread.gmane.org/gmane.comp.gcc.patches/250006
Comment 7 Steve Kargl 2011-11-04 23:01:13 UTC
On Wed, Nov 02, 2011 at 05:57:15AM +0000, markus at trippelsdorf dot de wrote:
> 
> > > Anyone know how to fix this issue properly?
> > 
> > Yes, just update in-tree libtool:
> Sorry, I meant to paste this link: 
> http://thread.gmane.org/gmane.comp.gcc.patches/250006
> 

The attach diff is sufficient to get the 4.6 branch
of gcc building on FreeBSD 10.0.  It's 9K, so does
not cause the churn of your patch.

I'm still building trunk with a similar patch.

Also, I don't know if it is sufficient complete 
to allow everything to build.
Comment 8 Andrew Pinski 2011-12-15 00:10:05 UTC
Has this been fixed now?
Comment 9 Steve Kargl 2011-12-15 01:35:58 UTC
On Thu, Dec 15, 2011 at 12:10:05AM +0000, pinskia at gcc dot gnu.org wrote:
> 
> --- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-15 00:10:05 UTC ---
> Has this been fixed now?
> 

Yes, I believe its been fixed.
Comment 10 Andrew Pinski 2011-12-15 01:37:23 UTC
So let's close this as fixed then.
Comment 11 kargls 2011-12-15 16:43:27 UTC
I think that this was fixed by

2011-11-21  Andreas Tobler  <andreast@fgznet.ch>

        * libtool.m4: dditional FreeBSD 10 fixes.