llvm15: add patch for sanitizers on arm*-musl
This commit is contained in:
parent
90ffb797a9
commit
d97818d808
@ -0,0 +1,22 @@
|
|||||||
|
Based on patch from Alpine:
|
||||||
|
https://gitlab.alpinelinux.org/alpine/aports/-/blob/693203c42aa1cde88cb547173ef67a98824973fd/main/llvm-runtimes/compiler-rt-sanitizer-supported-arch.patch
|
||||||
|
|
||||||
|
Sanitizer code is broken on armhf, armv7, s390x, x86, and probably riscv64 on musl,
|
||||||
|
i.e. enable it only on x86_64, aarch64, and ppc64le.
|
||||||
|
|
||||||
|
--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
|
||||||
|
+++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
|
||||||
|
@@ -23,9 +23,13 @@ if(APPLE)
|
||||||
|
set(X86_64 x86_64 x86_64h)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
+if (LIBCXX_HAS_MUSL_LIBC)
|
||||||
|
+set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86_64} ${ARM64} ${PPC64})
|
||||||
|
+else()
|
||||||
|
set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} ${RISCV64}
|
||||||
|
${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9}
|
||||||
|
${HEXAGON} ${LOONGARCH64})
|
||||||
|
+endif()
|
||||||
|
set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
|
||||||
|
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
|
||||||
|
${LOONGARCH64})
|
@ -129,7 +129,6 @@ post_patch() {
|
|||||||
vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
|
vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_configure() {
|
pre_configure() {
|
||||||
@ -169,11 +168,10 @@ pre_configure() {
|
|||||||
cd ../..
|
cd ../..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Patch this after we built tblgen.
|
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
|
arm*-musl|i686-musl)
|
||||||
vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
|
# sanitizer code is broken since it duplicates some libc bits
|
||||||
${wrksrc}/compiler-rt/cmake/config-ix.cmake
|
configure_args+=" -DCOMPILER_RT_BUILD_SANITIZERS=OFF"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user