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.
This commit is contained in:
Martin Storsjö committed 2024-07-29 17:13:09 +03:00
1 parent 1270970b3d
commit 29367bd1b0
1 file changed
+7
+7
View File
@@ -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