-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[embedded] Start building and including lld even in Darwin toolchains #70715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
@swift-ci Please Build Toolchain macOS Platform |
1 similar comment
@swift-ci Please Build Toolchain macOS Platform |
@shahmishal This will have Darwin toolchain size impact (should be no change on Linux/Windows toolchains). |
@swift-ci please test |
@swift-ci build toolchain macOS |
I don't see lld getting installed in the toolchain, not sure if we are missing something. |
We will need to change this to include https://github.com/apple/swift/blob/main/utils/build-presets.ini#L22 |
@kubamracek I am a change to your PR to see if this fixes the issue. |
@swift-ci build toolchain macOS |
@swift-ci please test |
@kubamracek If you have the time, could you start another macOS toolchain build for me? Or do you have an idea when this PR will be merged? I have a feeling it's the only remaining blocker to have a working SwiftPM-based build for our RP2040 experiment, and I'd love to try this out. It seems the last Mac toolchain build is no longer available? Because the CI server only keeps those around for a limited time? (I have no idea how this works.) Thanks! |
47d04bb
to
38d19d3
Compare
@swift-ci build toolchain macOS |
Kicked off another toolchain build. You're right, the CI server only keeps a limited number of build logs and build artifacts. I still need to figure out a few things about the inclusion of lld, there might be a bit more delays. I wonder, if all you need is a working lld on macOS, then if a possible short-term workaround for you would be to grab lld from llvm.org? The releases of LLVM for macOS do include it. |
Thank you! Thanks for the llvm.org tip. I've been using the Clang from the ARM embedded LLVM toolchain, and that seems to work too, but it's obviously a little inconvenient for users. Here's roughly my SwiftPM setup (not public yet, I have to write it all up):
I have this working on Linux with the default Swift Docker images, so you can write something like this to build your executable: swift package --triple armv6m-none-none-eabi link-executable On macOS, it also works with a current toolchain as long as you have the |
Very cool, please do write it up, or even post this as is to the forums :) There are folks (like me) who are eager to read about doing cool stuff with Embedded Swift. |
I found |
@MaxDesiatov Thank you, I'll try that. |
Note that the Homebrew install doesn't add it to the usual |
38d19d3
to
9a77eb4
Compare
@swift-ci please test |
Any chance this would be cherry-picked for 6.0? |
[embedded] Start building and including lld even in Darwin toolchains
We already include lld in the Linux and Windows toolchains. For embedded Swift development, it's common to (need to) use ELF even on a macOS host, but the Xcode-provided linker is Mach-O only. Let's start including a linker capable of linking ELF binaries (for embedded cross-compilation use cases) even in the Darwin toolchains.