Bug 1312507 - link error linking fortran code with PIE
link error linking fortran code with PIE
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Nick Clifton
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-02-26 18:05 EST by H.J. Lu
Modified: 2016-04-29 15:33 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-04-29 15:33:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 19579 None None None 2016-03-02 17:03 EST

  None (edit)
Description H.J. Lu 2016-02-26 18:05:16 EST
When tried to rebuild mopac7app rpm in mock with binutils 2.26 on
Fedora 23, I got:

libtool: link: gfortran -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -std=legacy -fno-automatic -Wl,-z -Wl,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o .libs/mopac7 mopac7app.o  ./.libs/libmopac7.so -lm
/usr/bin/ld: mopac7app.o: relocation R_X86_64_PC32 against undefined symbol `molkst_' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:546: recipe for target 'mopac7' failed

redhat-rpm-config has redhat-hardened-cc1 and redhat-hardened-ld.  But
there is no redhat-hardened-f951.  mopac7app.o isn't compiled with PIE/PIC.
Comment 1 H.J. Lu 2016-03-02 17:03:15 EST
It is a binutils 2.26 linker regression.
Comment 2 John Dulaney 2016-03-12 13:54:09 EST
This has been fixed upstream, please update accordingly in F24 and Rawhide.

(In reply to H.J. Lu from comment #0)
> When tried to rebuild mopac7app rpm in mock with binutils 2.26 on
> Fedora 23, I got:

I have taken over maintainership of mopac7 in Fedora, and as soon as binutils is fixed I will rebuild mopac7.

Comment 3 Nick Clifton 2016-03-14 13:38:29 EDT
Hi John,

  Please try:

or  binutils-2.26-15.fc24

  These should contain the patch from PR 19579.

Comment 4 John Dulaney 2016-03-14 15:05:50 EDT
Looks like that's not building for F24?

Giving F25 a shot
Comment 5 Nick Clifton 2016-03-15 07:51:59 EDT
Hi John,

  Darn - the F24 version ran foul of a strict aliasing bug in F24 gcc.  See the email thread here for more details:


Since I really want the binutils to be able to be built for F24, I have checked in a couple of patches that work around the aliasing bug.  So you can now try out this version of the binutils, should you so desire:


Comment 6 John Dulaney 2016-04-29 15:33:50 EDT
Gonna close this, as everything looks shiny, now.

Note You need to log in before you can comment on or make changes to this bug.