From 29367bd1b0da8c5b8d73f43447277676e89d3905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 29 Jul 2024 17:12:39 +0300 Subject: [PATCH] build-compiler-rt: Avoid failing for --build-sanitizer if only building for e.g. aarch64 If nothing was built and installed, the installation merging command fails with an error like this: cp: cannot stat '/tmp/tmp.OAj9E7UBhI/install/.': No such file or directory Therefore, skip this step if nothing really was built and installed. --- build-compiler-rt.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-compiler-rt.sh b/build-compiler-rt.sh index 33055ac..6af036f 100755 --- a/build-compiler-rt.sh +++ b/build-compiler-rt.sh @@ -130,9 +130,16 @@ for arch in $ARCHS; do if [ -n "$SANITIZERS" ]; then mv "${WORKDIR}/install/lib/windows/"*.dll "$PREFIX/$arch-w64-mingw32/bin" fi + INSTALLED=1 cd .. done +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 + if [ -h "$CLANG_RESOURCE_DIR/include" ]; then # symlink to system headers - skip copy rm -rf ${WORKDIR}/install/include