mirror of
https://github.com/mstorsjo/llvm-mingw
synced 2026-06-21 14:01:00 +00:00
build-compiler-rt: Stop providing asan in msvcrt builds
See0b296aefc0for context, where we stopped testing asan in msvcrt builds - see discussion at https://github.com/llvm/llvm-project/pull/120397, https://github.com/mstorsjo/llvm-mingw/issues/224 and https://github.com/mstorsjo/llvm-mingw/issues/552. This should make it clearer that asan isn't supported in msvcrt builds, instead of silently just providing files that are known not to work. See4718b81419for earlier context for where we remove the asan runtimes in armv7/aarch64 builds, where the files do get built, but they don't work properly yet (even on UCRT).
This commit is contained in:
+32
-13
@@ -82,6 +82,18 @@ else
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat<<EOF > is-ucrt.c
|
||||||
|
#include <corecrt.h>
|
||||||
|
#if !defined(_UCRT)
|
||||||
|
#error not ucrt
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
ANY_ARCH=$(echo $ARCHS | awk '{print $1}')
|
||||||
|
if $ANY_ARCH-w64-mingw32-gcc$TOOLEXT -E is-ucrt.c > /dev/null 2>&1; then
|
||||||
|
IS_UCRT=1
|
||||||
|
fi
|
||||||
|
rm -f is-ucrt.c
|
||||||
|
|
||||||
cd llvm-project/compiler-rt
|
cd llvm-project/compiler-rt
|
||||||
|
|
||||||
INSTALL_PREFIX="$CLANG_RESOURCE_DIR"
|
INSTALL_PREFIX="$CLANG_RESOURCE_DIR"
|
||||||
@@ -162,19 +174,26 @@ for arch in $ARCHS; do
|
|||||||
cmake --install . --prefix "$INSTALL_PREFIX"
|
cmake --install . --prefix "$INSTALL_PREFIX"
|
||||||
mkdir -p "$PREFIX/$arch-w64-mingw32/bin"
|
mkdir -p "$PREFIX/$arch-w64-mingw32/bin"
|
||||||
if [ -n "$SANITIZERS" ]; then
|
if [ -n "$SANITIZERS" ]; then
|
||||||
case $arch in
|
if [ -z "$IS_UCRT" ]; then
|
||||||
aarch64)
|
# For msvcrt builds, remove the asan files; asan doesn't work
|
||||||
# asan doesn't work on aarch64 or armv7; make this clear by omitting
|
# properly on top of msvcrt, only on top of UCRT. Make this clear
|
||||||
# the installed files altogether.
|
# by omitting the installed files altogether.
|
||||||
rm -f "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*aarch64*
|
rm -f "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*
|
||||||
;;
|
else
|
||||||
armv7)
|
case $arch in
|
||||||
rm -f "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*arm*
|
aarch64)
|
||||||
;;
|
# asan doesn't work on aarch64 or armv7; make this clear by omitting
|
||||||
*)
|
# the installed files altogether.
|
||||||
mv "$INSTALL_PREFIX/lib/windows/"*.dll "$PREFIX/$arch-w64-mingw32/bin"
|
rm -f "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*aarch64*
|
||||||
;;
|
;;
|
||||||
esac
|
armv7)
|
||||||
|
rm -f "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*arm*
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
mv "$INSTALL_PREFIX/lib/windows/"*.dll "$PREFIX/$arch-w64-mingw32/bin"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user