From 2e938d2b6637a877a40fbcd4e5db95d8b55e88ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 1 Aug 2025 23:42:45 +0300 Subject: [PATCH] prepare-cross-toolchain-unix: Remove the linux/macOS runtimes This matches what is done in build-all.sh for the PGO step; this removes rather large (~50 MB) libraries that mostly are needed for compiling for the host unix platforms. (On Linux it's needed if building with profiling, on macOS it's needed for the builtin functions for platform version availability too.) --- prepare-cross-toolchain-unix.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prepare-cross-toolchain-unix.sh b/prepare-cross-toolchain-unix.sh index 194ca5f..7834e6d 100755 --- a/prepare-cross-toolchain-unix.sh +++ b/prepare-cross-toolchain-unix.sh @@ -44,6 +44,11 @@ CLANG_VERSION=$(basename "$CLANG_RESOURCE_DIR") rm -rf $DEST/lib/clang/$CLANG_VERSION cp -a $CLANG_RESOURCE_DIR $DEST/lib/clang/$CLANG_VERSION +# Remove the native Linux/macOS runtimes which aren't needed in +# the final distribution. +rm -rf $DEST/lib/clang/*/lib/darwin +rm -rf $DEST/lib/clang/*/lib/linux + # Copy all arch-specific subdirectories plus the "generic" one, as is. for arch in generic $ARCHS; do rm -rf $DEST/$arch-w64-mingw32