Skip to content

Swift on OpenBSD supports arm64.#77879

Merged
DougGregor merged 1 commit into
swiftlang:mainfrom
3405691582:arm64
Dec 2, 2024
Merged

Swift on OpenBSD supports arm64.#77879
DougGregor merged 1 commit into
swiftlang:mainfrom
3405691582:arm64

Conversation

@3405691582

@3405691582 3405691582 commented Nov 30, 2024

Copy link
Copy Markdown
Member

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

@finagolfin finagolfin left a comment

Copy link
Copy Markdown
Member

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

3405691582 commented Nov 30, 2024

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Member Author

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

@DougGregor DougGregor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This LGTM, thank you!

Comment thread cmake/modules/SwiftConfigureSDK.cmake
@DougGregor

Copy link
Copy Markdown
Member

@swift-ci please test

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