Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1134454 - pkg-config --libs contains cflags
pkg-config --libs contains cflags
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
:
Depends On: 1134453 1134455
Blocks: TRACKER-bugs-affecting-libguestfs
  Show dependency treegraph
 
Reported: 2014-08-27 10:21 EDT by Richard W.M. Jones
Modified: 2015-03-05 02:43 EST (History)
13 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1134453
Environment:
Last Closed: 2015-03-05 02:43:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Richard W.M. Jones 2014-08-27 10:21:10 EDT
+++ This bug was initially created as a clone of Bug #1134453 +++

Description of problem:

$ pkg-config --libs libvirt
-lvirt -ldl -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic 

obviously only -lvirt and possibly -ldl should be there.

Version-Release number of selected component (if applicable):

On RHEL 7: libvirt-1.1.1-29.el7.x86_64

Additional info:

Upstream fix is

commit 1167751fcb949b44eddf3d0bfed5473e13c7e94a
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Fri Jun 20 17:45:05 2014 +0100

    Don't include @LIBS@ in libvirt.pc.in file
    
    The libvirt.pc file we install is ending up polluted with a
    load of compiler flags that should be private to the libvirt
    build. eg
    
    Libs: -L${libdir} -lvirt -ldl -O2 -g -pipe -Wall \
          -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \
          -fstack-protector-strong --param=ssp-buffer-size=4 \
          -grecord-gcc-switches  -m64 -mtune=generic
    
    this is caused by including @LIBS@ in the Libs: line of the
    pkgconfig.pc.in file.
Comment 3 dyuan 2015-01-19 05:09:59 EST
Install libvirt-1.2.8-13.el7.src.rpm.

# grep lvirt /root/rpmbuild/BUILD/libvirt-1.2.8/build/libvirt.pc
Libs: -L${libdir} -lvirt

# pkg-config --libs libvirt
-L/root/builder/lib -lvirt

Removed the @LIBS@ in the Libs and only -lvirt is here, move the bug to VERIFIED.
Comment 4 Richard W.M. Jones 2015-01-19 09:27:36 EST
(In reply to dyuan from comment #3)
> # pkg-config --libs libvirt
> -L/root/builder/lib -lvirt

That's not good!

The output should be:

$ pkg-config --libs libvirt
-lvirt  

Having said that, I am unable to reproduce the output
you have given above.  For me, the output is correct
with the 1.2.8-13.el7 package.
Comment 5 dyuan 2015-01-19 22:02:32 EST
Yes, you're right. Thanks for your comment.
I think there should be copy/paste error in comment3.
Re-check again and got the same output as yours.

# pkg-config --libs libvirt
-lvirt
Comment 7 errata-xmlrpc 2015-03-05 02:43:14 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html

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