When using libs.private, the order of the libraries within a given package gets reversed when you do pkg-config --libs --static The problem lies in parse.c: if there is both a libs line and a libs.private line, whichever line is first gets reversed a second time at the end of _do_parse_libs. I would propose deferring the reversal. Example and patch follow.
Created attachment 7872 [details] Example .pc file demonstrating the problem pkg-config --libs-only-other --static should make it clear why this is a problem
Created attachment 7873 [details] [review] Patch that fixes the problem for me Defer the reversals to the end of parse_package_file. I did everything, not just the libs, for the sake of symmetry. Well, not everything, only the easy ones. Not thoroughly tested...
2007-02-21 Tollef Fog Heen <tfheen@err.no> * parse.c (parse_package_file and others): Move the reversal of the _libs lists to the end to avoid double-reversing either. Thanks to J. Scott Berg for both the bug and the fix. Freedesktop #9132
This was fixed for 0.23
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.