From 56e5ac12491f158e254070cf3aefec2edd23298d Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 1 Aug 2020 05:06:28 +0200 Subject: [PATCH] llvm10: fix host triplet being wrong in cross builds LLVM_HOST_TRIPLE is the triplet that llvm will be run on (build is the build machine, host is the execution machine, target is what it compiles for). This was not being set (only target was) so it would default to the build machine. This would result in issues with e.g. llvmpipe in mesa, which would try to use the host triple to generate for, and subsequently fail. While at it, make sure not to clutter builddir when lldb is unavailable. Fixes https://github.com/void-linux/void-packages/issues/13896 --- srcpkgs/llvm10/template | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/srcpkgs/llvm10/template b/srcpkgs/llvm10/template index 902ca3f5050..62c75d00061 100644 --- a/srcpkgs/llvm10/template +++ b/srcpkgs/llvm10/template @@ -1,7 +1,7 @@ # Template file for 'llvm10' pkgname=llvm10 version=10.0.0 -revision=3 +revision=4 wrksrc="llvm-${version}.src" build_style=cmake configure_args=" @@ -103,8 +103,12 @@ post_patch() { mv ${XBPS_BUILDDIR}/lld-${version}.src ${wrksrc}/tools/lld fi # Move lldb files into the llvm source. - if [ "$_lldb_enable" = "yes" -a -d ${XBPS_BUILDDIR}/lldb-${version}.src ]; then - mv ${XBPS_BUILDDIR}/lldb-${version}.src ${wrksrc}/tools/lldb + if [ -d ${XBPS_BUILDDIR}/lldb-${version}.src ]; then + if [ "$_lldb_enable" = "yes" ]; then + mv ${XBPS_BUILDDIR}/lldb-${version}.src ${wrksrc}/tools/lldb + else + rm -rf ${XBPS_BUILDDIR}/lldb-${version}.src + fi fi # Move compiler-rt files into the llvm source. if [ -d ${XBPS_BUILDDIR}/compiler-rt-${version}.src ]; then @@ -156,6 +160,7 @@ pre_configure() { ppc*) _arch="PowerPC";; esac configure_args+=" -DLLVM_TARGET_ARCH=${_arch}" + configure_args+=" -DLLVM_HOST_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}" configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}" }