Build failure for 8.90.004 Generic x64 - broken toolchain?

  • Following Compile [LibreELEC.wiki] instructions, LibreELE-8.90.004 fails to build:

    Code
    PROJECT=Generic ARCH=x86_64 make image
    Code
    ...
      LINK    tests/qemu-iotests/socket_scm_helper
    /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -lgcrypt
    /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -lgpg-error
    /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -lgpg-error
    collect2: error: ld returned 1 exit status
    make[1]: *** [/home/rick/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel/qemu-2.12.0/rules.mak:121: tests/qemu-iotests/socket_scm_helper] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/home/rick/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel/qemu-2.12.0/.x86_64-pc-linux-gnu'
    make: *** [Makefile:12: image] Error 2

    In trying to debug I couldn't help but notice LE's build process constantly jumps in and out of it's toolchain randomly.

    For example, sometimes it uses the system's GCC (7.3.0) and sometimes it uses the toolchain's GCC (8.2.0).

    Sometimes it builds with the toolchain GCC, then within the same package build uses the system LD (?!).

    Any ideas or do the build scripts need a re-write?

    Note that I don't even want to build the image, just update the kernel enough to support laptop's mouse on current hardware but have been pointed down this dead-end road :(

  • Success finally! :)

    Although libgcrypt is a package that is installed into the LE image, it's not part of the toolchain and qemu was erroneously enabling libgcrypt support because it detected it as being present on the host system doing the build.

    Editing packages/tools/qemu/package.mk to '--disable-gcrypt' allows qemu to build.

    Also, it helps a great deal to use 'V=1' on the build command line when debugging build failures like this:

    Code
    PROJECT=Generic ARCH=x86_64 make V=1 image
  • Thanks CvH.

    The next failure is packages/sysutils/open-vm-tools:

    Any ideas?

  • Gentoo Linux

    Is LE not distro agnostic?

    I thought that was the whole idea behind building it's own toolchain?

    EDIT: Disabling the use of 'Gold' linker in 'distributions/LibreELEC/options' allows sysutils/open-vm-tools to build

    I'm unable to disable 'Gold' for the entire image build as some packages fail to build without it enabled.

    Not really sure why but I'm suspecting it has a lot to do with my host system using the standard GNU BFD linker and LE defaulting to use GOLD.

    As the build process seemingly steps out of it's toolchain randomly, I'm guessing the build doesn't like switching back and forth to use different linkers.

    Using standard BFD linker because it's the default for Gentoo but also because of 10238 – Gold linker does not resolve symbols using indirect dependencies

    Edited once, last by shiznix (September 11, 2018 at 7:08 AM).