Private libraries incorrectly passed to command line when linking dynamically
Hugh McMaster via xslt <[email protected]> Wed, 26 Jun 2019 21:51:36 +1000
| Newsgroups | gmane.comp.gnome.lib.xslt |
|---|---|
| Message-ID | <CAN9Bcdu5pvSnumOvTP8pc7Ga-VArFWEP4AGQwW6b0W5y2+QLXA@mail.gmail.com> |
Hi, libxslt.pc, libexslt.pc and xslt-config all incorrectly pass private library dependencies (such as libm and libgcrypt) to the command line when linking dynamically. This causes un-necessary dependencies to be created. For many years, Debian has patched libxslt to avoid this problem. In libxslt's pkg-config files, M_LIBS and LIBGCRYPT_LIBS are moved to the Libs.private field, where they will only be passed to the command line if --static is passed to pkg-config. In xslt-config, Debian patches the source to add a new switch, --static, which combines with --libs to output the dependencies required for static linking. Private dependencies are not passed to the command line when --libs is invoked as normal. This problem was identified as still present when patching upstream PHP 7.4 to use libxslt's pkg-config files. Patches are available in a merge request #3 on Gitlab [1]. Regards, Hugh [1] https://gitlab.gnome.org/GNOME/libxslt/merge_requests/3