From 3ed0975c2963887ccc003e6c28d12303d080d8ea Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Fri, 31 Oct 2025 09:54:51 +0000 Subject: [PATCH] Android use static swift stdlib (#3430) android build use swift static stdlib ### Motivation: Android build fails and the guide says to use this flag https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html Recent failure - although weirdly it doesn't seem to happen every time: ``` error: link command failed with exit code 1 (use -v to see invocation) ld.lld: error: cannot open crtbegin_dynamic.o: No such file or directory ld.lld: error: cannot open crtend_android.o: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) [558/601] Linking NIOUDPEchoClient ``` ### Modifications: android build use swift static stdlib ### Result: hopefully success - making this change locally seemed to work. This change can be seen in action here https://github.com/apple/swift-nio/actions/runs/18949279888/job/54110590743?pr=3430 --- scripts/swift-build-with-android-sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/swift-build-with-android-sdk.sh b/scripts/swift-build-with-android-sdk.sh index 54fdf14bc..22282f1b5 100755 --- a/scripts/swift-build-with-android-sdk.sh +++ b/scripts/swift-build-with-android-sdk.sh @@ -31,4 +31,4 @@ if [[ -z "$SWIFT_SDK" ]]; then fi log "Building using Swift SDK: $SWIFT_SDK" -swift build --swift-sdk "$SWIFT_SDK" --swift-sdks-path "$swift_sdk_directory" "${@}" +swift build --swift-sdk "$SWIFT_SDK" --swift-sdks-path "$swift_sdk_directory" --static-swift-stdlib "${@}"