Bug 56699 - pkg-config doesn't handle options that need to be stuck together semantically
Summary: pkg-config doesn't handle options that need to be stuck together semantically
Status: RESOLVED DUPLICATE of bug 19950
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium major
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-02 21:21 UTC by Zoltán Böszörményi
Modified: 2012-11-06 14:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch against 0.27.1 to implement whole-archive library handling (5.19 KB, patch)
2012-11-02 21:22 UTC, Zoltán Böszörményi
Details | Splinter Review
Patch against current GIT to implement whole-archive library handling (4.63 KB, patch)
2012-11-02 21:23 UTC, Zoltán Böszörményi
Details | Splinter Review

Description Zoltán Böszörményi 2012-11-02 21:21:49 UTC
I found out that if I put these into a .pc file in this order:
  -L<directory> ...
  <list of regular shared libs>
  -Wl,--whole-archive
  <list of static libs linked as whole archive>
  -Wl,--no-whole-archive
then pkg-config completely messes up the output, so the result doesn't mean the same to GCC.

The output is:
  -Wl,--whole-archive
  -Wl,--no-whole-archive
  -L<directory> ...
  <list of shared and static libs together>

The result of linking using these options will be different.

As an example, xulrunner needs "-Wl,--whole-archive -lmozglue  -lmemory -Wl,--no-whole-archive" as is, otherwise calling NS_InitXPCOM2() ends in a segmentation fault.
Comment 1 Zoltán Böszörményi 2012-11-02 21:22:46 UTC
Created attachment 69468 [details] [review]
Patch against 0.27.1 to implement whole-archive library handling
Comment 2 Zoltán Böszörményi 2012-11-02 21:23:09 UTC
Created attachment 69469 [details] [review]
Patch against current GIT to implement whole-archive library handling
Comment 3 Dan Nicholson 2012-11-06 14:38:57 UTC
Thanks a lot for the patch. Unfortunately, I don't think this path can be taken because it would require pkg-config to have special case handling for every linker or compiler flags that's not -l/-L/-I. I think this has to be treated more generally, and I plan to attach something soon in our existing bug19950.

*** This bug has been marked as a duplicate of bug 19950 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.