Skip to content

Swift on OpenBSD supports arm64. #77879

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

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

3405691582
Copy link
Member

@3405691582 3405691582 commented Nov 30, 2024

However, to do this, we end up changing how amd64 is supported too. Previously, I had tried to keep some meaningful separation between platform spelling and LLVM spelling, but this is becoming more difficult
to meaningfully maintain.

See the commit comment for more specifics, but it suffices to say that it's far simpler to give up and rename to LLVM spellings right at the beginning. This does mean that this commit is less constrained to just adding the necessary parts to enable arm64, but it should mean less headaches overall from differing architecture spellings.

Other than that, the only real change of note is that -Wl,-Bsymbolic seems necessary to squash some relocation errors; I have not verified whether this is only necessary on arm64.

@3405691582 3405691582 requested a review from a team as a code owner November 30, 2024 03:40
Copy link
Member

@finagolfin finagolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, further OpenBSD AArch64 patches incoming?

@3405691582
Copy link
Member Author

3405691582 commented Nov 30, 2024

LGTM, further OpenBSD AArch64 patches incoming?

This contains just the key changes to get it building (especially with #77815). If I get around to addressing test failures and similar, then there may be more.

However, to do this, we end up changing how amd64 is supported too.
Previously, I had tried to keep some meaningful separation between
platform spelling and LLVM spelling, but this is becoming more difficult
to meaningfully maintain.

Target specifications are trivially converted LLVM triples, and the
module files are looked up by LLVM triples. We can make sure that the
targets align, but then the Glibc to SwiftGlibc import breaks. That could
also be addressed, but then we get to a point where the targets set up
by build-script and referenced by cmake begin to misalign. There are
references in build-script-impl for a potential renaming site, but it's
not quite enough.

It's far simpler to give up and rename to LLVM spellings right at the
beginning. This does mean that this commit is less constrained to just
adding the necessary parts to enable arm64, but it should mean less
headaches overall from differing architecture spellings.
@3405691582
Copy link
Member Author

PTAL, if you feel so inclined, since I have had to change the scope and implementation here.

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, thank you!

@DougGregor
Copy link
Member

@swift-ci please test

@DougGregor DougGregor merged commit 291822d into swiftlang:main Dec 2, 2024
5 checks passed
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.

3 participants