LLVM does not build

  • Build System: Debian stable x86_64
    LE Version: Master Branch Commit 2193bd8a0390167064b226894f65e0889a036865
    Target: Generic, ARCH: x86_64

    What happen:
    The LLVM:target build step fails.
    After short look on it, i see the llvm-3.9.0/.x86_64-libreelec-linux-gnu/NATIVE/bin/llvm-tblgen tool was build/linked against the libstdc++ from the LE-Toolchain.
    But when it is executed in a later part of the LLVM build, the try to libstdc from the host-system. This on is on debian stable is bit old...

    Log: build_llvm_2016.10.13.log


    Sascha


  • you're glibc on your system is too old.

    May yes, it is debian :)

    but i think the main problem is, that the build uses the toolchain libs for the internal tools, but at runtime of the tools the host libs are used.
    i know it is complicated (and my english is bad, too)

    but in detail:
    in the llvm:target build is the llvm-tblgen build against the toolchain lib (incl. libstdc++).
    But the rpath of this binary is only "$ORIGIN/../lib", so it uses the host libs. I think, that the build is workink, is only luck n most system.
    With LD_LIBRARY_PATH set to toolchain/x86_64-libreleec-linux/lib the "./script/build llvm" is working.

    actual i make same clean builds on older commits, to find the causing one


    Sascha

  • Try with this llvm package.mk.

    The main problem is that llvm-tblgen must be build for host and used when building for target. Now it is build for target and also used. Obviously sometimes works but it is not correct way. What if llvm would be used on arm ;)