Bug 1548559

Summary: sgpio: Partial injection of Fedora build flags
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: sgpioAssignee: Jan Synacek <jsynacek>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jmoskovc, jsynacek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sgpio-1.2.0.10-21.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-26 10:46:41 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1539083    

Description Florian Weimer 2018-02-23 20:49:38 UTC
/usr/sbin/sgpio in sgpio-1.2.0.10-20.fc28.x86_64 has not been linked with the standard Fedora linker (LDFLAGS) from redhat-rpm-config.

Looking at the makefile, there is no way to inject the flags:

sgpio.o: sgpio.c
	gcc $(CFLAGS) -c sgpio.c

So you either need to build directly from the %build section in the RPM spec file, or patch the makefile.

See https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/master/f/buildflags.md for information on RPM macros and environment variables provided by the build environment.

Comment 1 Jan Synacek 2018-02-26 10:46:41 UTC
Should be fixed now.

https://src.fedoraproject.org/rpms/sgpio/c/d81baccc87f76e172684837da21c6911f777f94b?branch=master

https://kojipkgs.fedoraproject.org//work/tasks/7617/25317617/build.log

...
gcc -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld sgpio.o -o sgpio
...

Comment 2 Florian Weimer 2018-02-26 11:03:31 UTC
I took the liberty to push this to the f28 branch, too. Fix confirmed for sgpio-1.2.0.10-21.fc28.  Thanks.