Red Hat Bugzilla – Bug 1312507
link error linking fortran code with PIE
Last modified: 2016-04-29 15:33:50 EDT
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.
It is a binutils 2.26 linker regression.
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.
These should contain the patch from PR 19579.
Looks like that's not building for F24?
Giving F25 a shot
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:
Gonna close this, as everything looks shiny, now.