-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[FreeBSD] Adding FreeBSD support #77836
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
base: main
Are you sure you want to change the base?
Conversation
It's my early Christmas gift. Thanks for working on this. |
unfortunately this PR alone here is not enough. I do have patches to other swift components to get it fully working and going to PR them to coming weeks. But even with those, you'll need to have a functional you also need a patch to the base libc++ to workaround this issue |
it's very impressive work especially the bootstrap part! |
Nice, there is some work to get Swift 6 bootstrapping again, #77815, that you'll want to follow. Pinging @mhjacobson and @3405691582, who added BSD support before and may be able to help review. |
As a heads up, the code uses LLVM target triples and the build system has a few places where it assumes that the platform calls the architecture with the same name as LLVM does. This isn't a problem for FreeBSD on what LLVM calls In the past, I've tried to keep some meaningful separation between platform spelling and LLVM spelling, but I'm reconsidering that in #77879. You probably won't need to do anything right now for this pr if you're just targeting |
Which is not correct for the FreeBSD part. On FreeBSD itself, arm64 is the TARGET, meanwhile aarch64 is the TARGET_ARCH and MACHINE_ARCH. Below is what I got from a build of the FreeBSD tree on my side:
For reference how we build the -target tuple in the tree:
|
@swift-ci please smoke test |
@swift-ci please test |
8c4f0d4
to
65db70b
Compare
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.
This looks amazing! I have just one comment about a C++ interop test.
This commit adds required conditional compilation blocks to enable bulding on FreeBSD (tested on x86_64 FreeBSD 14.1-RELEASE-p6). Also implements FreeBSD synchronization shims using `_umtx_op(2)`
c22dacb
to
26dd5c3
Compare
@shahmishal Could you or someone else kick off the CI here so we can get Michael’s work merged? |
@swift-ci please test. |
include/swift/SILOptimizer/Differentiation/DifferentiationInvoker.h
Outdated
Show resolved
Hide resolved
@@ -93,7 +93,8 @@ set(swift_runtime_backtracing_sources | |||
Backtrace.cpp | |||
BacktraceUtils.cpp | |||
CrashHandlerMacOS.cpp | |||
CrashHandlerLinux.cpp) | |||
CrashHandlerLinux.cpp | |||
) |
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.
Probably shouldn't be reformatted if you're not otherwise touching the file?
… and trivial copy ctor is yet available even on 14
@swift-ci please test |
This commit adds required conditional compilation blocks to enable building and running
on FreeBSD (tested on x86_64 FreeBSD 14.1-RELEASE-p6).
Also implements FreeBSD synchronization shims using
_umtx_op(2)