Bug 1312507 - link error linking fortran code with PIE
Summary: link error linking fortran code with PIE
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 24
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-26 23:05 UTC by H.J. Lu
Modified: 2016-04-29 19:33 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-04-29 19:33:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 19579 0 None None None 2016-03-02 22:03:14 UTC

Description H.J. Lu 2016-02-26 23:05:16 UTC
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 22:03:15 UTC
It is a binutils 2.26 linker regression.

Comment 2 Mairi Dulaney 2016-03-12 18:54:09 UTC
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.


John.

Comment 3 Nick Clifton 2016-03-14 17:38:29 UTC
Hi John,

  Please try:

    binutils-2.26-15.fc25
or  binutils-2.26-15.fc24

  These should contain the patch from PR 19579.

Cheers
  Nick

Comment 4 Mairi Dulaney 2016-03-14 19:05:50 UTC
Looks like that's not building for F24?

Giving F25 a shot

Comment 5 Nick Clifton 2016-03-15 11:51:59 UTC
Hi John,

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

  https://sourceware.org/ml/binutils/2016-03/msg00119.html

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:

  binutils-2.26-17.fc24

Cheers
  Nick

Comment 6 Mairi Dulaney 2016-04-29 19:33:50 UTC
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.