Skip to content

Add Static Linux Swift SDK support for cross-compilation - #3

Closed
adincebic wants to merge 1 commit into
AttilaTheFun:lshire-android-wasm-supportfrom
bazelbuild:adin/crosscompile-linux
Closed

Add Static Linux Swift SDK support for cross-compilation#3
adincebic wants to merge 1 commit into
AttilaTheFun:lshire-android-wasm-supportfrom
bazelbuild:adin/crosscompile-linux

Conversation

@adincebic

Copy link
Copy Markdown

This implementation builds on top of bazelbuild#1809.

Adding a new swift.static_linux_sdk(...) module extension tag, which downloads the Static Linux SDK artifact bundle from swift.org, generates matching Swift and C/C++ toolchains for x86_64-swift-linux-musl and aarch64-swift-linux-musl, and
wires those toolchains into the existing standalone-toolchain flow.

I am also adding a dedicated //swift/toolchains:static_linux constraint to distinguish Static Linux targets from generic Linux targets. Further more, I tried documenting Static Linux SDK setup and toolchain registration

One important detail is toolchain registration order: Static Linux SDK toolchains must be registered before generic Linux Swift toolchains, since both are compatible with @platforms//os:linux and Bazel prefers earlier registered toolchains. Open to discussing if there is a better way to do this.

@adincebic adincebic closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant