From ad4650518d8cb8de1a8f5b4ebbca0e1622e33f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Tue, 18 May 2021 02:28:33 -0300 Subject: [PATCH] llvm12: multiple fixes. - only disable sanitizer for arm*-musl. the template erroneously disabled sanitizer support for all musl targets. - add libexecinfo-devel to depends, since applications statically linking llvm will require it - fix the xray-ppc64 patch, pointed out by sgn --- .../compiler-rt-xray-ppc64-musl.patch | 2 +- srcpkgs/llvm12/template | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/srcpkgs/llvm12/files/patches/compiler-rt/compiler-rt-xray-ppc64-musl.patch b/srcpkgs/llvm12/files/patches/compiler-rt/compiler-rt-xray-ppc64-musl.patch index aac93c25fe8c..6db37ce06f76 100644 --- a/srcpkgs/llvm12/files/patches/compiler-rt/compiler-rt-xray-ppc64-musl.patch +++ b/srcpkgs/llvm12/files/patches/compiler-rt/compiler-rt-xray-ppc64-musl.patch @@ -44,7 +44,7 @@ + if (!ret) { + continue; + } -+ ret += sizeof("timebase" - 1); ++ ret += sizeof("timebase") - 1; + ret = strchr(ret, ':'); + if (!ret) { + continue; diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template index 7069f5449733..38937f68564f 100644 --- a/srcpkgs/llvm12/template +++ b/srcpkgs/llvm12/template @@ -1,7 +1,7 @@ # Template file for 'llvm12' pkgname=llvm12 version=12.0.0 -revision=1 +revision=2 wrksrc="llvm-${version}.src" build_style=cmake configure_args=" @@ -60,6 +60,7 @@ python_version=3 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES" makedepends+=" libexecinfo-devel" + depends+=" libexecinfo-devel" fi # "operand out of range" assembler failures @@ -233,19 +234,16 @@ post_patch() { ;; esac - # some sanitizer currently only on x86_64 stuff needs backtrace case "$XBPS_TARGET_MACHINE" in - x86_64-musl) + x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \ ${wrksrc}/projects/compiler-rt/CMakeLists.txt ;; + arm*-musl) # sanitizer code is broken on arm*-musl since it duplicates some libc bits + vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \ + ${wrksrc}/projects/compiler-rt/cmake/config-ix.cmake + ;; esac - - # sanitizer code is broken on arm*-musl since it duplicates some libc bits - if [ "$XBPS_TARGET_LIBC" = "musl" ]; then - vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \ - ${wrksrc}/projects/compiler-rt/cmake/config-ix.cmake - fi } pre_configure() {