Skip to content

[ucrt64|mingw64] pkgconf 1.9.3-1 issue with static library ordering #13390

@1480c1

Description

@1480c1

Description

Installing opusfile and running pkgconf --static --libs opusurl provides incorrect ordering of libraries

cddeg@ccom-laptop UCRT64 /c/Users/cddeg
$ pkgconf.exe --version
1.8.0

cddeg@ccom-laptop UCRT64 /c/Users/cddeg
$ pkgconf --static --libs opusurl
-LC:/msys64/ucrt64/lib -lopusurl -lopusfile -LC:/msys64/ucrt64/lib -logg -lopus -lm -lssp -LC:/msys64/ucrt64/lib -lssl -LC:/msys64/ucrt64/lib -lws2_32 -lgdi32 -lcrypt32 -lcrypto -lws2_32 -lgdi32 -lcrypt32

cddeg@ccom-laptop UCRT64 /c/Users/cddeg
$ pacman -Su
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-ucrt-x86_64-pkgconf-1.9.3-1

Total Installed Size:  0.49 MiB
Net Upgrade Size:      0.01 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                           [#######################################] 100%
(1/1) checking package integrity                                         [#######################################] 100%
(1/1) loading package files                                              [#######################################] 100%
(1/1) checking for file conflicts                                        [#######################################] 100%
(1/1) checking available disk space                                      [#######################################] 100%
:: Processing package changes...
(1/1) upgrading mingw-w64-ucrt-x86_64-pkgconf                            [#######################################] 100%

cddeg@ccom-laptop UCRT64 /c/Users/cddeg
$ pkgconf.exe --version
1.9.3

cddeg@ccom-laptop UCRT64 /c/Users/cddeg
$ pkgconf --static --libs opusurl
-LC:/msys64/ucrt64/lib -lssl -LC:/msys64/ucrt64/lib -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lopusurl -lopusfile -LC:/msys64/ucrt64/lib -logg -lopus -lm -lssp

for reference, on a linux install

$ pkgconf --static --libs opusurl
-lopusurl -lopusfile -lm -logg -lopus -lm -lssl -ldl -pthread -lcrypto -ldl -pthread

haven't tested other environments

Verification

Windows Version

Microsoft Windows [Version 10.0.22621.608]

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Expected behavior

probably something similar to linux output with opusfile first then its dependencies

Actual behavior

opusfile somehow comes near the middle

Repro steps

  1. install pkgconf and opusfile for the subsystem
  2. run pkgconf --static --libs opusurl and check the output
  3. create file with:
#include <stdint.h>
#include <opus/opusfile.h>

int main() { return (intptr_t)opus_server_info_init; }
  1. run gcc -static $(pkgconf --static --cflags opusurl) temp.c $(pkgconf --static --libs opusurl)

tested with both 1.8.0 and 1.9.3, and 1.8.0 works but not 1.9.3

Also, linux version is 1.8.0, so it seems they haven't updated it there (https://archlinux.org/packages/core/x86_64/pkgconf/)

Are you willing to submit a PR?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions