Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1548689

Summary: lpsolve: Does not use Fedora build flags
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: lpsolveAssignee: Caolan McNamara <caolanm>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: caolanm
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lpsolve-5.5.2.0-20.fc29 lpsolve-5.5.2.0-20.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-27 06:52:49 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 12:13:51 UTC
This part of the RPM spec file should not be necessary if the Fedora build flags are used:

%ifarch sparcv9 sparc64 s390 s390x                                                   
sed -i -e 's|-fpic|-fPIC|g' lpsolve55/ccc                                            
%endif 

Furthermore, LDFLAGS from redhat-rpm-config are not injected:

+ cc -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/ux64/liblpsolve55.so lp_MDO.o commonlib.o mmio.o myblas.o ini.o fortify.o colamd.o lp_rlp.o lp_crash.o lp_LUSOL.o lusol.o lp_Hash.o lp_lib.o lp_wlp.o lp_matrix.o lp_mipbb.o lp_MPS.o lp_params.o lp_presolve.o lp_price.o lp_pricePSE.o lp_report.o lp_scale.o lp_simplex.o lp_SOS.o lp_utils.o yacc_read.o -lc -lm -ldl

(From the lpsolve-5.5.2.0-17.fc28.x86_64 build log.)

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 Florian Weimer 2018-02-26 14:25:38 UTC
Sorry, there appears to be another build issue:

# checksec --file /usr/bin/lp_solve
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      FORTIFY Fortified Fortifiable  FILE
Partial RELRO   No canary found   NX enabled    No PIE          No RPATH   No RUNPATH   No      0               16      /usr/bin/lp_solve

# rpm -qf /usr/bin/lp_solve
lpsolve-5.5.2.0-18.fc29.x86_64

The build command for this one appears to be:

+ cc -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -O3 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine ../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c -o bin/ux64/lp_solve -lm -ldl

So neither CFLAGS nor LDFLAGS are injected into this part.  Sorry, I didn't realize this was a separate issue.  (But that's the only remaining issue I see in lpsolve-5.5.2.0-18.fc28.x86_64.)

Comment 2 Caolan McNamara 2018-02-26 14:57:37 UTC
huh, *two* buildscripts in this little thing. Build log now looks good to me.

Comment 3 Florian Weimer 2018-02-26 16:17:26 UTC
Sorry, only CFLAGS are there.  LDFLAGS are still missing:

+ 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 -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine ../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c -o bin/ux64/lp_solve -lm -ldl

Results in:

# checksec --file /usr/bin/lp_solve
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      FORTIFY Fortified Fortifiable  FILE
Partial RELRO   Canary found      NX enabled    No PIE          No RPATH   No RUNPATH   Yes     11              19      /usr/bin/lp_solve

Comment 4 Caolan McNamara 2018-02-26 20:56:06 UTC
how annoying, lets try again

Comment 5 Florian Weimer 2018-02-27 06:52:49 UTC
Looks good now.  Thanks.