swift
43aa55ff - [6.4.x][Android] Link Dispatch with -static-stdlib (#94120)

Commit
27 days ago
[6.4.x][Android] Link Dispatch with -static-stdlib (#94120) - **Explanation**: On Android, `static-stdlib-args.lnk` has no `-ldispatch -lBlocksRuntime`, which the concurrency runtime needs. With the 6.4.1 Swift SDK for Android, `-static-stdlib` makes an executable that uses concurrency fail to link (`undefined symbol: _dispatch_main_q`), and a shared library fail to load (`dlopen failed: cannot locate symbol "_dispatch_main_q"`). This adds them for Android, as on Linux. - **Scope**: Android only, and only when linking with `-static-stdlib` (for example SwiftPM's `--static-swift-stdlib`). Other platforms and dynamic linking are unchanged. - **Issues**: swiftlang/swift-package-manager#8198 (on the Android workgroup board): with it, the APK of a small FoundationEssentials app goes from 17.7 MB to 13.0 MB. - **Original PR**: #94056 - **Risk**: Low. It only adds two libraries to the Android static link file; the SDK already ships `libdispatch.a` and `libBlocksRuntime.a` in `swift_static` for all three architectures. - **Testing**: The 6.4.1 Android SDK with the link file this patch generates, on an Android emulator (API 36): an executable and a shared library that use concurrency link, load and run (both fail before). Adds `test/stdlib/static-stdlib-args-android.test-sh`, which checks the generated file. - **Reviewers**: @finagolfin
Author
Parents
Loading