Bug 1548660

Summary: libaesgm: Partial build flags injection
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: libaesgmAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: orion, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-05 16:49:00 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-24 09:59:09 UTC
/usr/lib64/libaesgm.so.0.0.0 in libaesgm-20090429-17.fc28.x86_64 is not linked with the standard Fedora linker flags (LDFLAGS) from redhat-rpm-config.

I tried to fix that by patching the RPM spec file, but somehow, LDFLAGS gets lost before reaching the linker invocation:

cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -fPIC -DUSE_SHA1 -shared -Wl,-soname,libaesgm.so.0 -o libaesgm.so.0.0.0 aescrypt.o aeskey.o aes_modes.o aestab.o fileenc.o hmac.o pwd2key.o sha1.o sha2.o 

Apparently, only CFLAGS is used there.

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 Tom "spot" Callaway 2018-03-05 16:40:25 UTC
Your efforts were thwarted by the most dangerous of beasts, the typo. :)

--- a/libaesgm.spec
+++ b/libaesgm.spec
@@ -30,7 +30,7 @@ cp %{SOURCE1} Makefile
 sed -i 's/\r//' *.txt
 
 %build
-make CFLAGS="%{optflags} -fPIC -DUSE_SHA1" LDFLAGS="${build_ldflags}"
+make CFLAGS="%{optflags} -fPIC -DUSE_SHA1" LDFLAGS="%{build_ldflags}"

Comment 2 Tom "spot" Callaway 2018-03-05 16:49:00 UTC
Fixed in rawhide (libaesgm-20090429-18.fc29) and F28 (libaesgm-20090429-18.fc28).