icecc/icecream

Failure to run clang++ from clang toolchain

lauromoura opened this issue · 1 comments

In the WebKit GTK and WPE ports, we have an SDK based on Flatpak. It supports distributed builds by automatically bundling GCC and Clang toolchains with icecc --build-native and setting up ICECC_VERSION accordingly. This scheme uses clang from the flatpak remote org.freedesktop.Sdk.Extension.llvm14, which places the clang binaries on /usr/lib/sdk/llvm14/bin/....

One issue with the clang toolchain file is related to the clang++ file (a symbolic link to clang). Currently, icecc-create-env moves the clang binary, located initially at usr/lib/sdk/llvm14/bin/clang, to usr/bin/clang inside the toolchain file, also placing the dependencies libclang-cpp and libLLVM-14 inside usr/lib. This scheme works fine for clang as its rpath points to $ORIGIN/../lib.

In the clang++ case, which some dependencies of WebKit require, the toolchain keeps it in its original path, usr/lib/sdk/llvm14/bin/clang++. As it has the same rpath as clang, the libraries are not there, and the compiler invocation fails on the remote icecc node.

Is this a bug in how icecc-create-env handles clang and clang++? Or is there any way to work around this limitation?

arkq commented

I've got the same issue (it seems) and adding clang++ symlink to the created bundle fixed that for me. Simply unpack created bundle, add ln -s clang usr/bin/clang++, and pack it again.