AnsweredAssumed Answered

libiiio cross compiling on AARCH64 libxml2 error linking

Question asked by ENGINEER on Apr 3, 2017
Latest reply on Apr 8, 2017 by rgetz

48%] Linking C executable iio_adi_xflow_check
/opt/Xilinx/SDK/2016.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/../../../../aarch64-linux-gnu/bin/ld: warning: libdl.so.2, needed by /home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4, not found (try using -rpath or -rpath-link)
/opt/Xilinx/SDK/2016.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/../../../../aarch64-linux-gnu/bin/ld: warning: libz.so.1, needed by /home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4, not found (try using -rpath or -rpath-link)
/opt/Xilinx/SDK/2016.2/gnu/aarch64/lin/aarch64-linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/../../../../aarch64-linux-gnu/bin/ld: warning: libm.so.6, needed by /home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4, not found (try using -rpath or -rpath-link)
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `fmod@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `gzclose'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `inflate'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `crc32'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `gzdopen'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `dlsym@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `deflate'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `deflateInit2_'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `gzread'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `pow@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `inflateEnd'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `log10@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `deflateEnd'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `gzwrite'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `dlopen@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `gzopen64@ZLIB_1.2.3.3'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `inflateInit2_'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `dlclose@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `dlerror@GLIBC_2.17'
/home/polar/zcu_yocto/poky/build/tmp/sysroots/zcu102-zynqmp/usr/lib64/libxml2.so.2.9.4: undefined reference to `gzdirect@ZLIB_1.2.2.3'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/iio_adi_xflow_check] Error 1
make[1]: *** [tests/CMakeFiles/iio_adi_xflow_check.dir/all] Error 2
make: *** [all] Error 2

 

1. why does this build system needs to be so complicated. I had to build all the required libraries through yocto [Xilinx Wiki - Creating a multilib image for the ZCU102 using Yocto ] just to generate libdl, libm, libxml2, libz and others.

 

libiio needs libxml2

libxml2 needs libm,libdl,libz

 

2. how to teach libxml2 to read/pick/source libdl, libm and liz in the CMake build system ?. which should solve above error

 

Thanks

RC Reddy

Outcomes