Bug 16101

Summary: duplicate argument removal for Cflags/Libs is incorrect
Product: pkg-config Reporter: Paul Jarc <prj+site+bugs.freedesktop.org>
Component: srcAssignee: Dan Nicholson <dbn.lists>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: kavafree, prj+site+bugs.freedesktop.org
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 19950    
Bug Blocks:    

Description Paul Jarc 2008-05-25 23:22:44 UTC
Removing duplicate arguments in Cflags and Libs can give incorrect results in some cases.  Doing it correctly is very difficult - it requires understanding the semantics of all the arguments - so it's probably best not to do it at all.  Here are some examples of where duplicate removal is wrong:

-O2 -O0 -O2 (equivalent to just -O2) => -O2 -O0 (equivalent to just -O0)

-Xlinker -R -Xlinker /dir1 -Xlinker -R -Xlinker /dir2 (meaningful) => -Xlinker -R /dir1 /dir2 (gives an error)
Comment 1 Michał Górny 2012-09-02 12:02:32 UTC
*** Bug 32536 has been marked as a duplicate of this bug. ***
Comment 2 Dan Nicholson 2012-12-08 20:02:26 UTC
I pushed the flag-order-fixes branch to git which I believe addresses this issue.

http://cgit.freedesktop.org/pkg-config/log/?h=flag-order-fixes

Some info can be found on the list at http://lists.freedesktop.org/archives/pkg-config/2012-December/000908.html.

Please test out the branch if you can. If there aren't any comments after a bit, I'll push to master and close this bug.
Comment 3 Dan Nicholson 2013-01-22 13:21:11 UTC
I merged the flag-order-fixes branch to master now and I think this bug should be fixed. Please reopen if that's not the case.

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.