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 765979 - configure.ac should use pkg-config to locate zlib and ICU
configure.ac should use pkg-config to locate zlib and ICU
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-04 11:49 UTC by Stewart Brodie
Modified: 2016-05-09 02:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure.ac patch to detect ICU via pkg-config in preference to running icu-config (3.93 KB, patch)
2016-05-04 11:49 UTC, Stewart Brodie
none Details | Review
configure.ac patch to detect zlib via pkg-config (2.12 KB, patch)
2016-05-04 11:51 UTC, Stewart Brodie
none Details | Review

Description Stewart Brodie 2016-05-04 11:49:44 UTC
Created attachment 327291 [details] [review]
configure.ac patch to detect ICU via pkg-config in preference to running icu-config

This issue is killing cross-compilations for me.

The configure.ac script's attempts to detect zlib fail due to the use of -L/lib in the link test.  The (not yet applied) fix from bug #749416 does not help me.  libxml2 fails to link, complaining about missing symbols (from zlib)

Additionally, the configure.ac script's attempts to run icu-config are doomed to fail, as it runs the one in /usr/bin on the build machine, not the one from the cross-compiled ICU.  The fix from bug #760190 doesn't really help me.

I attach two patches for the configure.ac, made against the 2.9.4-rc1 source archive.  These modify the configure.ac to try pkg-config first in both cases.  


Background:

In my case, I have a 32-bit cross-compiler targeting a 32-bit platform, running on a 64-bit host, and /lib/libz.so.1.2.8 is a 64-bit library that the cross-compiler does not like that file as its binutils can't recognise the format and it fails the link.  Testing on a 32-bit host shows that the cross-compiler still doesn't like it, because the arch is wrong, but carries on searching the library path, finding the cross-compiled zlib in the cross-compile sysroot and the link succeeds.

The idea of running *-config scripts from a cross-compiled sysroot is problematic in the extreme.  You can't just put the directory on PATH, as then the build machine will find these binaries instead of the host system's versions.  This seems to affect a few bits of software, ICU amongst them.
Comment 1 Stewart Brodie 2016-05-04 11:51:09 UTC
Created attachment 327292 [details] [review]
configure.ac patch to detect zlib via pkg-config
Comment 2 Daniel Veillard 2016-05-09 02:18:18 UTC
  Okay, since the patches fallback to the previous code if pkg-config step
fails I think this is the best way to handle this, so pushed and applied

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

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

 Thanks !

Daniel