Merge aarch64 and arm64ec compiler-rt libs

Clang expects the aarch64 compiler-rt name on ARM64EC. While this could be adjusted
in Clang, the current approach mirrors MSVC, where the core CRT is provided as
archives containing both EC and native support. Ideally, the LLVM build system would
handle this automatically, but for now we can merge it here.
This commit is contained in:
Jacek Caban authored and Martin Storsjö committed 2025-05-18 22:28:25 +03:00
1 parent 192334d04b
commit 486d72ff9e
1 file changed
+21
+21
View File
@@ -122,6 +122,13 @@ for arch in $ARCHS; do
-DCMAKE_CXX_FLAGS_INIT="$CFGUARD_CFLAGS" \
$SRC_DIR
cmake --build . ${CORES:+-j${CORES}}
# Skip install on arm64ec, we merge archives instead.
if [ "$arch" = "arm64ec" ]; then
cd ..
continue
fi
cmake --install . --prefix "$INSTALL_PREFIX"
mkdir -p "$PREFIX/$arch-w64-mingw32/bin"
if [ -n "$SANITIZERS" ]; then
@@ -142,6 +149,20 @@ for arch in $ARCHS; do
cd ..
done
# Clang expects the aarch64 compiler-rt name on ARM64EC. While this could be adjusted
# in Clang, the current approach mirrors MSVC, where the core CRT is provided as
# archives containing both EC and native support. Ideally, the LLVM build system would
# handle this automatically, but for now we can merge it here.
for arch in $ARCHS; do
if [ "$arch" = "arm64ec" ]; then
rm -f "$INSTALL_PREFIX/lib/windows/libclang_rt.builtins-aarch64.a" \
"$INSTALL_PREFIX/lib/windows/libclang_rt.builtins-arm64ec.a"
"$PREFIX/bin/llvm-lib" -machine:arm64ec "-out:$INSTALL_PREFIX/lib/windows/libclang_rt.builtins-aarch64.a" \
build-aarch64/lib/windows/libclang_rt.builtins-aarch64.a \
build-arm64ec/lib/windows/libclang_rt.builtins-arm64ec.a
fi
done
if [ "$INSTALL_PREFIX" != "$CLANG_RESOURCE_DIR" ]; then
# symlink to system headers - skip copy
rm -rf "$INSTALL_PREFIX/include"