ZLIB build error under Gentoo

  • I use Gentoo x86_64 to build LibreELEC. When I build 8.0 branch, I always get error:

    Code
    ~/LibreELEC.tv/build.LibreELEC-Odroid_C2.aarch64-8.0.1/toolchain/lib/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib64/libpng16.so.16)
    make: *** [Makefile:12: image] Ошибка 1

    I know, how to solve it. Here's solution:

    Code
    cd ~/LibreELEC.tv/build.LibreELEC-Odroid_C2.aarch64-8.0.1/toolchain/lib
    rm libz.so.1
    ln -s /lib64/lib/libz.so.1 ~/LibreELEC.tv/build.LibreELEC-Odroid_C2.aarch64-8.0.1/toolchain/lib/libz.so.1

    But I don't know, what need to change in LibreELEC source code to fix this problem. Can the developers fix it?
    P.S. My system version of ZLIB is 1.2.11

  • Quote


    That is NOT a solution.


    Why? It builds without a problem after this.

    Quote


    Why do you use Gentoo?


    Because this is perfect desktop distro, which I use more than 5 years.


  • Why? It builds without a problem after this.


    You are mixing libraries from two different systems. If it works doesn't mean it is correct solution (far from that). You need to find out why it fails to find correct library when building image.

  • Actually, he is not the one mixing libraries, the build system is :) I got the same thing as well. The problem is that the build host's mkfontscale is linked against a versioned zlib shared library, and when the LE build system calls it I guess $TOOLCHAIN/lib comes first in the LD_LIBRARY_PATH. Currently zlib in LE is 1.2.8, while in Arch (and I guess also Gentoo) it's up to 1.2.9. A quick fix is to bump the LE zlib version up but that'll only work until the next version comes along. A better fix seems to be calling mkfontdir/mkscale with LD_LIBRARY_PATH=/usr/lib. Either that or building mkfontdir/mkfontscale for the host (which would require building more stuff for the host).

    Edited once, last by escalade (March 27, 2017 at 9:11 AM).

  • Then build system must be fixed to cover some corner cases like this. But I assume this problem doesn't happen to everyone?

    Which package is problematic ones to use host libraries? I think we would need similar thing for linking.

    Edited once, last by vpeter (March 27, 2017 at 9:32 AM).

  • If your zlib:host happens to be the same version that mkfontscale requires then you won't notice. Probably not an issue for slow moving distribution's like Ubuntu. I know the LE team's stance some times is "if it works on Ubuntu it ain't broken", but it would be good to move towards a build system that works regardless of distribution. If that means building more stuff for host, so be it.


    EDIT:

    lrusak

    Both Arch and Gentoo is mentioned in scripts/checkdeps, so statements like "why are you using gentoo?" seems kind of odd. Once you upgrade to the next Ubuntu version this will be an issue for you too. Just because it works on Ubuntu does not mean that something isn't broken.

    Edited once, last by escalade (March 27, 2017 at 9:46 AM).

  • Ah, now I understand the problem. I though this binaries are build as part of LE build.

    Then running host binaries should be with empty LD_LIBRARY_PATH. Or calling mkfontdir/mkfontscale through variable. Or....

    Quick fix

    Code
    LD_LIBRARY_PATH="" mkfontdir ....

    Edited once, last by vpeter (March 27, 2017 at 11:40 AM).

  • Well, this thread is nearly one year old and I ran into the same problem today, while trying to build the current release.

    Code
    INSTALL    util-macros (target)
    mkfontscale: ~/99-Projects/libreelec/extra_dvb/LibreELEC.tv/build.LibreELEC-Odroid_C2.aarch64-devel/toolchain/lib/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib64/libpng16.so.16)
    make: *** [Makefile:12: image] Error 1

    Are there any plans to fix this problem?

  • Hello all,

    I have the same issue compiliging LibreElec for Raspberry Pi 3. (compilation on Kubuntu 18.04 x64)

    I maybe have a solution:


    1) Replace
    PKG_VERSION="1.2.8" to PKG_VERSION="1.2.9"

    in the file http://LibreELEC.tv/packages/compress/zlib/package.mk

    2) Clean zlib

    Code
    PROJECT=RPi2 ARCH=ARM scripts/clean zlib

    3) Compile the new package

    Code
    PROJECT=RPi2 ARCH=ARM scripts/build zlib

    4) Then, copy the files

    Code
    cp ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/zlib-1.2.9/.armv7ve-libreelec-linux-gnueabi/libz.a ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/toolchain/lib/libz.a
    
    cp ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/zlib-1.2.9/.armv7ve-libreelec-linux-gnueabi/libz.so ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/toolchain/lib/libz.so
    
    cp ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/zlib-1.2.9/.armv7ve-libreelec-linux-gnueabi/libz.so.1 ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/toolchain/lib/libz.so.1
    
    cp ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/zlib-1.2.9/.armv7ve-libreelec-linux-gnueabi/libz.so.1.2.9 ~/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.2.5/toolchain/lib/libz.so.1.2.9

    It seems to work... until now... the compilation still running