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 1196527 - %optflags in opensaml.pc
Summary: %optflags in opensaml.pc
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: opensaml
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Guido Grazioli
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1196914
Blocks: 1196917 1196918
TreeView+ depends on / blocked
 
Reported: 2015-02-26 07:47 UTC by Ralf Corsepius
Modified: 2016-07-19 12:52 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 12:52:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ralf Corsepius 2015-02-26 07:47:00 UTC
Description of problem:

/usr/lib64/pkgconfig/opensaml.pc
contains %optflags and %__global_ldflags in cflags and libs.

Packages are not supposed to add %optflags or %__global_ldflags to *.pcs.

Version-Release number of selected component (if applicable):
opensaml-devel-2.4.3-9.fc22

Steps to Reproduce:
1. Check the rpm's contents

Actual results:
...
Libs: -L${libdir} -Wl,-z,relro -lxmltooling -lxml-security-c -lxerces-c -L/usr/lib64 -llog4cpp -lnsl -lz -lsaml
Cflags: -I${includedir} -pthread -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
...


Additional info:
I haven't checked other fedora releases, but I assume this issue to be present there, too.

Comment 1 Guido Grazioli 2015-02-26 11:18:11 UTC
Thanks for the report. I am working on updating xmltooling and opensaml to latest version on rawhide, and I'll address this too.

I guess: 

Libs: -L${libdir} -Wl,-z,relro -lxmltooling -lxml-security-c -lxerces-c -L/usr/lib64 -llog4cpp -lnsl -lz -lsaml

would have to be:

Libs: -L${libdir} -lxmltooling -lsaml
Libs.private: -lxml-security-c -lxerces-c -llog4cpp -lnsl -lz 

Please correct me if I am wrong, I am not usually a pkgconfig user.

Comment 2 Ralf Corsepius 2015-02-26 13:35:04 UTC
(In reply to Guido Grazioli from comment #1)
> Thanks for the report. I am working on updating xmltooling and opensaml to
> latest version on rawhide, and I'll address this too.
> 
> I guess: 
> 
> Libs: -L${libdir} -Wl,-z,relro -lxmltooling -lxml-security-c -lxerces-c
> -L/usr/lib64 -llog4cpp -lnsl -lz -lsaml
> 
> would have to be:
> 
> Libs: -L${libdir} -lxmltooling -lsaml
> Libs.private: -lxml-security-c -lxerces-c -llog4cpp -lnsl -lz 
> 
> Please correct me if I am wrong, I am not usually a pkgconfig user.
I am not sure either. 

Likely there 2 separate issues interacting simultaneously here 
a) libs vs. libs.private + require vs. require.private
and
b) optflags, __global_ldflags incorrectly getting propagated into *.pcs.

I am only referring to the latter issue. The problem with these is they are restricting usability/generality of a package, because *.pc are only supposed to take package-specific flags and not user-specified values.

From a packaging point of view, packages which are propagating CFLAGS/LDFLAGS to *.pcs suffer from a broken configuration, which does not properly separate package and user configuration.

To work-around this issue in rpms, in many cases, simply sed-ing these values out from *.pc does the job:

E.g. presuming a XXXX.pc is generated by an autoconf-based configure script:

%configure ...
sed -i -e "s|%{optflags}||;s|%{__global_ldflags}||" XXXX.pc

Comment 3 Fedora End Of Life 2016-07-19 12:52:57 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.