build-compiler-rt: Build all runtimes for aarch64 and armv7 too

Since 0c391133c9201ef29273554a1505ef855ce17668 in llvm-project
(LLVM 17), the sanitizers can be built for aarch64, and since
5ea9dd8c7076270695a1d90b9c73718e7d95e0bf (backported to
LLVM 19.1.0 RC 4), they can be built for armv7 too.

While they can be built, address sanitizer doesn't work for the
non-x86 architecture, so omit those files from the install,
to make it clear that they aren't expected to work.

Thus, in practice, this builds the ubsan and profile runtimes for
aarch64 and armv7.
This commit is contained in:
Martin Storsjö committed 2024-09-10 11:17:05 +03:00
1 parent b6b58d96d9
commit 4718b81419
2 files changed
+14 -20

No files matched your search

+13 -19
View File
@@ -93,17 +93,6 @@ fi
for arch in $ARCHS; do
if [ -n "$SANITIZERS" ]; then
case $arch in
i686|x86_64)
# Sanitizers on windows only support x86.
;;
*)
continue
;;
esac
fi
[ -z "$CLEAN" ] || rm -rf build-$arch$BUILD_SUFFIX
mkdir -p build-$arch$BUILD_SUFFIX
cd build-$arch$BUILD_SUFFIX
@@ -136,19 +125,24 @@ for arch in $ARCHS; do
cmake --install . --prefix "$INSTALL_PREFIX"
mkdir -p "$PREFIX/$arch-w64-mingw32/bin"
if [ -n "$SANITIZERS" ]; then
mv "$INSTALL_PREFIX/lib/windows/"*.dll "$PREFIX/$arch-w64-mingw32/bin"
case $arch in
aarch64)
# asan doesn't work on aarch64 or armv7; make this clear by omitting
# the installed files altogether.
rm "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*aarch64*
;;
armv7)
rm "$INSTALL_PREFIX/lib/windows/libclang_rt.asan"*arm*
;;
*)
mv "$INSTALL_PREFIX/lib/windows/"*.dll "$PREFIX/$arch-w64-mingw32/bin"
;;
esac
fi
INSTALLED=1
cd ..
done
if [ "$INSTALL_PREFIX" != "$CLANG_RESOURCE_DIR" ]; then
if [ -z "$INSTALLED" ]; then
# Don't try to move the installed files in place, if nothing was
# installed (e.g. if building with --build-sanitizers but not for x86).
exit 0
fi
# symlink to system headers - skip copy
rm -rf "$INSTALL_PREFIX/include"