Bug 1383081

Summary: dlaran.f and slaran.f built without -fPIC, causing FTBFS on riscv64 & mipsel
Product: [Fedora] Fedora Reporter: sorear2
Component: lapackAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 25CC: c.david86, fkluknav, rjones, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: riscv64   
OS: Linux   
Whiteboard:
Fixed In Version: lapack-3.6.1-2.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-15 16:10:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Spec file patch for NOOPT none

Description sorear2 2016-10-09 17:05:04 UTC
Created attachment 1208622 [details]
Spec file patch for NOOPT

Description of problem:

When lapack is compiled, two source files, slaran.f and dlaran.f, are compiled without -fPIC (or any other flags).

This has no significant effect on x86_64, armv7hl, or aarch64, where the generated code is already position-independent.

For i686, it causes the generation of 8 text relocations in liblapacke.so.3; rpmlint reports this as "lapack.i686: E: shlib-with-non-pic-code /usr/lib/liblapacke.so.3.6.1"

The riscv64 and mipsel linkers are stricter and produce a FTBFS, for instance https://mipsdistros.imgtec.com/fedora/development/23/mipsel/stage4/all/lapack-3.5.0-12.fc23/build.log .  (I'm working on riscv64 but I didn't save the build log)

Version-Release number of selected component (if applicable):
lapack-3.6.1-1.fc25

How reproducible:
Always

Steps to Reproduce:
1. Compile lapack from sources on any platform

Actual results:
1. dlaran.f and slaran.f are built without -fPIC or other Fedora compiler options, for instance "gfortran   -c dlaran.f" (all platforms)
2. liblapacke.so.3 fails to link due to incompatible relocations (mipsel, riscv64)
3. liblapacke.so.3 links successfully, but has text relocations (i686)

Expected results:
1. dlaran.f and slaran.f are built with -fPIC and other Fedora-appropriate compiler flags (testable: everywhere)
2. liblapacke.so.3 links successfully (testable: mipsel, riscv64)
3. liblapacke.so.3 has no text relocations (testable: i686)

Additional info:
This appears to be caused by the Makefile using $(NOOPT) for those two files, which is set in some make calls but omitted in the make call for tmglib.  Applying the attached patch fixes FTBFS on riscv64; I have not tested it on i686 or mipsel.

Comment 1 Fedora Update System 2016-10-12 01:54:07 UTC
lapack-3.6.1-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5a5541286a

Comment 2 Fedora Update System 2016-10-15 16:10:21 UTC
lapack-3.6.1-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.