After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711026 - Static linking improvements
Static linking improvements
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-28 17:26 UTC by Philip Withnall
Modified: 2013-12-21 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Add @LZMA_LIBS@ to libxml’s pkg-config files (1.73 KB, patch)
2013-10-28 17:26 UTC, Philip Withnall
none Details | Review
build: Use pkg-config to find liblzma instead of AC_CHECK_LIB (1.69 KB, patch)
2013-10-28 17:26 UTC, Philip Withnall
none Details | Review
build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB (2.76 KB, patch)
2013-10-29 10:32 UTC, Philip Withnall
none Details | Review

Description Philip Withnall 2013-10-28 17:26:13 UTC
A couple of patches coming with improvements for statically linking against libxml2 and its dependencies.
Comment 1 Philip Withnall 2013-10-28 17:26:33 UTC
Created attachment 258320 [details] [review]
build: Add @LZMA_LIBS@ to libxml’s pkg-config files

If libxml2 is built and linked against liblzma, the latter needs to appear in
libxml2’s Libs.private pkg-config field, otherwise static linking against
libxml2 will fail due to unresolved liblzma symbols.
Comment 2 Philip Withnall 2013-10-28 17:26:36 UTC
Created attachment 258321 [details] [review]
build: Use pkg-config to find liblzma instead of AC_CHECK_LIB

This means that liblzma’s Libs.private will be included in LZMA_LIBS if
linking the libraries statically, ensuring that there are no undefined
symbol errors from liblzma’s private libraries.
Comment 3 Daniel Veillard 2013-10-29 09:34:30 UTC
Sorry, but last patch is not okay for libxml2, the portability requirement
is that it needs to configure even if pkg-config is not available. it's okay
to try to use it and fallback to normal detection though in case of problem.

Daniel
Comment 4 Philip Withnall 2013-10-29 10:32:36 UTC
Created attachment 258424 [details] [review]
build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB

This means that liblzma’s Libs.private will be included in LZMA_LIBS if
linking the libraries statically, ensuring that there are no undefined
symbol errors from liblzma’s private libraries.

If pkg-config isn’t installed, or if liblzma.pc couldn’t be found, fall
back to using AC_CHECK_LIB as before. This will cause static linking to
fail, but that’s not a regression.

This does not introduce a compile time dependency on pkg-config.
Comment 5 Daniel Veillard 2013-11-28 07:59:45 UTC
Sorry i had commited to my branch but forgot to push and notify here

https://git.gnome.org/browse/libxml2/commit/?id=f859d9a78350246222185a9605ae65da8ce42cea

 i think this fixes it,

  thanks !

Daniel
Comment 6 Daniel Veillard 2013-11-28 08:05:58 UTC
Actually no, a separate patch i got confused, pushed :-)

https://git.gnome.org/browse/libxml2/commit/?id=f3f86ff465c92c79f834d7b981f3c7274a8bb5c8

 thanks,

Daniel
Comment 7 Nick Wellnhofer 2013-12-20 13:15:39 UTC
The commit "Use pkg-config to find liblzma in preference to AC_CHECK_LIB" does introduce a compile time dependency on pkg-config when compiling from Git. The configure script generated with autogen.sh fails if pkg.m4 isn't installed.
Comment 8 Philip Withnall 2013-12-21 10:35:58 UTC
You can either ship a copy of pkg.m4 in the libxml2 tarball, or inline the contents of the PKG_CHECK_MODULES macro in configure.ac.

Which platforms don’t have pkg-config support? Would it perhaps be more worthwhile to port pkg-config to those platforms, given how widely it’s used in software build systems?