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:
1 parent
b6b58d96d9
commit
4718b81419
2 files changed
+14
-20
No files matched your search
@@ -119,7 +119,7 @@ normal GCC/binutils based MinGW.
|
||||
variables.
|
||||
- The runtime libraries libunwind, libcxxabi and libcxx also assume that the
|
||||
target is Windows 7 or newer.
|
||||
- The sanitizers are only supported on x86.
|
||||
- Address sanitizer is only supported on x86.
|
||||
- LLD doesn't support linker script (in the COFF part of LLD). Linker script can be used for
|
||||
reprogramming how the linker lays out the output, but is in most cases
|
||||
in MinGW setups only used for passing lists of object files to link.
|
||||
|
||||
+13
-19
@@ -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"
|
||||
|
||||
|
||||
Reference in new issue
Block a user