Skip to contentSkip to conversation

libxml2 using host's zlib?

DISCUSSION Hollis Blanchard 2 participants 2 messages Oct 16, 2012

lore
Share & tools
lore
#0 lore raw

I was trying to build php using meta-webserver, and got stuck with this error during configuration of php-native:

configure:49076: gcc -o conftest -I/usr/include -isystem/mnt/mel/build/tmp/sysroots/i686-linux/usr/include -O2 -pipe -g0 -fvisibility=hidden -isystem/mnt/mel/build/tmp/sysroots/i686-linux/usr/include -L/usr/lib -L/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib -L/mnt/mel/build/tmp/sysroots/i686-linux/lib -Wl,-rpath-link,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib -Wl,-rpath-link,/mnt/mel/build/tmp/sysroots/i686-linux/lib -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/lib -Wl,-O1 -Wl,--hash-style=both -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib -L/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib/../lib -L/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib/../lib conftest.c -lz -lcrypt -lrt -lm -lnsl -lxml2 -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm >&5 /mnt/mel/build/tmp/sysroots/i686-linux/usr/lib/libxml2.so: undefined reference to `gzopen64@ZLIB_1.2.3.3'

My build host has /lib/libz.so.1.2.3.3, so my guess is:
* libxml2 is linking with libz from the host
* php-native properly links with zlib-native from Poky (1.2.7), plus the tainted libxml2
* libxml2 fails to link because it wants symbols from 1.2.3, which it can't find in zlib-native

I've tried the following:

   hblancha@sb-ubuntu-1004:/mnt/mel$ diff -u
   poky/meta/recipes-core/libxml/libxml2.inc{.orig,}---
   poky/meta/recipes-core/libxml/libxml2.inc.orig      2012-10-16
   10:54:17.000000000 -0500
   +++ poky/meta/recipes-core/libxml/libxml2.inc   2012-10-16
   10:55:54.000000000 -0500
   @@ -9,7 +9,7 @@
   file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907
   \
   file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e"

-DEPENDS_virtclass-native = "python-native" +DEPENDS_append_virtclass-native = " python-native"
DEPENDS =+ "zlib"

SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz \
@@ -25,8 +25,8 @@

     }

     EXTRA_OECONF = "--without-python --without-debug --without-legacy
   --without-catalog --without-docbook --with-c14n --without-lzma"
   -EXTRA_OECONF_virtclass-native =
   "--with-python=${STAGING_BINDIR}/python --without-legacy
   --with-catalog --without-docbook --with-c14n --without-lzma"
   -EXTRA_OECONF_virtclass-nativesdk =
   "--with-python=${STAGING_BINDIR}/python --without-legacy
   --with-catalog --without-docbook --with-c14n --without-lzma"
   +EXTRA_OECONF_virtclass-native =
   "--with-python=${STAGING_BINDIR}/python --without-legacy
   --with-catalog --without-docbook --with-c14n --without-lzma
   --with-zlib=${STAGING_LIBDIR}"
   +EXTRA_OECONF_virtclass-nativesdk =
   "--with-python=${STAGING_BINDIR}/python --without-legacy
   --with-catalog --without-docbook --with-c14n --without-lzma
   --with-zlib=${STAGING_LIBDIR}"
     EXTRA_OECONF_linuxstdbase = "--without-python --with-debug

--with-legacy --with-catalog --with-docbook --with-c14n --without-lzma"

     # required for pythong binding
   hblancha@sb-ubuntu-1004:/mnt/mel/build$ bitbake -c clean libxml2-native
   [...]
   hblancha@sb-ubuntu-1004:/mnt/mel/build$ bitbake libxml2-native
   [...]
   hblancha@sb-ubuntu-1004:/mnt/mel/build$ nm
   tmp/sysroots/i686-linux/usr/lib/libxml2.so | grep gzopen
             U gzopen64@@ZLIB_1.2.3.3

As you can see, it didn't help: libxml2.so still is linking with the host's zlib-1.2.3.3, and php-native fails to configure because of it.

How to fix? Thanks!

Signature · 3 lines
Hollis Blanchard
Product Owner, Sourcery Analyzer <http://go.mentor.com/sourceryanalyzer>
Mentor Graphics, Embedded Systems Division
#1 lore raw
Quoted 8 lines · Hollis Blanchard

I was trying to build php using meta-webserver, and got stuck with this error during configuration of php-native:

configure:49076: gcc -o conftest -I/usr/include -isystem/mnt/mel/build/tmp/sysroots/i686-linux/usr/include -O2 -pipe -g0 -fvisibility=hidden -isystem/mnt/mel/build/tmp/sysroots/i686-linux/usr/include -L/usr/lib -L/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib

^^^^^^^^^^^^^^^
this includes the host libs

Quoted 6 lines
   -L/mnt/mel/build/tmp/sysroots/i686-linux/lib
   -Wl,-rpath-link,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib
   -Wl,-rpath-link,/mnt/mel/build/tmp/sysroots/i686-linux/lib
   -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib
   -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/lib -Wl,-O1
   -Wl,--hash-style=both
Quoted 8 lines
   -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib
   -L/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib
   -Wl,-rpath,/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib/../lib
   -L/mnt/mel/build/tmp/sysroots/i686-linux/usr/lib/../lib conftest.c
   -lz -lcrypt -lrt -lm -lnsl -lxml2 -lcrypt -lxml2 -lz -lm -lxml2 -lz
   -lm >&5
   /mnt/mel/build/tmp/sysroots/i686-linux/usr/lib/libxml2.so: undefined
   reference to `gzopen64@ZLIB_1.2.3.3'

Bye Henning