Bug 16101 - duplicate argument removal for Cflags/Libs is incorrect
Summary: duplicate argument removal for Cflags/Libs is incorrect
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Dan Nicholson
QA Contact:
: 32536 (view as bug list)
Depends on: 19950
  Show dependency treegraph
Reported: 2008-05-25 23:22 UTC by Paul Jarc
Modified: 2013-01-22 13:21 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
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.


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.