Re: [xslt] Private libraries incorrectly passed to command line when linking dynamically
Hugh McMaster via xslt wrote: Hi, [SNIP] 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. Very interesting. Taking into account that build produces static and shared libraries at once by default. Without other words such scenario broke all projects that use libtool. [SNIP] Regards, Roumen ___ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt
Re: [xslt] Private libraries incorrectly passed to command line when linking dynamically
These patches seem to rely on your patched version of xml2-config, so we should get your xml2-config changes upstreamed first. Nick On 26/06/2019 13:51, Hugh McMaster via xslt wrote: 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 ___ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt
Re: [xslt] Private libraries incorrectly passed to command line when linking dynamically
On 26/06/2019 13:51, Hugh McMaster via xslt wrote: 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 breaks users who are linking with a static libxslt library. The switch should probably be changed to `--dynamic` when linking dynamically. Nick ___ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt
Re: [xslt] Private libraries incorrectly passed to command line when linking dynamically
On Thu, 27 Jun 2019 at 3:03 am, Roumen Petrov wrote: > Taking into account that build produces static and shared libraries at > once by default. > Without other words such scenario broke all projects that use libtool. Putting aside the fact that xslt-config should probably be deprecated in favour of pkg-config, you made me remember that Debian doesn’t ship static libraries, so the patch doesn’t affect that system. The approach will work correctly with a minor modification to libxslt’s static library build rules, so it uses M_LIBS etc. ___ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt
Re: [xslt] Private libraries incorrectly passed to command line when linking dynamically
Hi Nick, On Thu, 27 Jun 2019 at 19:46, Nick Wellnhofer via xslt wrote: > This breaks users who are linking with a static libxslt library. The switch > should probably be changed to `--dynamic` when linking dynamically. Can I just confirm that: (1) The behaviour of `--libs` should remain as is (i.e. passing libraries for static linking) (2) But calling `--libs --dynamic` outputs the libraries for dynamic linking only? Thank you, Hugh ___ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt
Re: [xslt] Private libraries incorrectly passed to command line when linking dynamically
On 28/06/2019 14:48, Hugh McMaster wrote: Hi Nick, On Thu, 27 Jun 2019 at 19:46, Nick Wellnhofer via xslt wrote: This breaks users who are linking with a static libxslt library. The switch should probably be changed to `--dynamic` when linking dynamically. Can I just confirm that: (1) The behaviour of `--libs` should remain as is (i.e. passing libraries for static linking) (2) But calling `--libs --dynamic` outputs the libraries for dynamic linking only? Yes, I think the necessary steps are: - Implement `xml2-config --libs --dynamic`. - Make the libxslt build call `xml2-config --libs --dynamic` for the shared library. (We have to support platforms without pkg-config, so we can't drop support for `xml2-config`.) - Implement `xslt-config --libs --dynamic`. - Adjust libxslt and libexslt pkg-config files. I'm not sure whether libxml2 should be a private dependency of libxslt (also what about libexslt?). Nick ___ xslt mailing list, project page http://xmlsoft.org/XSLT/ xslt@gnome.org https://mail.gnome.org/mailman/listinfo/xslt