Skip to content

Enable PACBTI on OpenBSD/arm64. #1792

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
Feb 6, 2025
Merged

Conversation

3405691582
Copy link
Member

BTI enforcement is mandatory, which means if PAC and BTI instructions are not emitted, then the compiled binary gets killed with SIGILL. The platform default compiler achieves enabling PAC and BTI by embedding the relevant enabled Clang compilation option flags into the local platform toolchain, which affects C/C++ code generation.

For bootstrapping purposes, we need to make this change in the legacy C++ driver in swiftlang/swift#78394; this is the equivalent change for the new driver.

It's not quite clear whether the flags need to be introduced in BackendJob.swift as well as FrontendJobHelpers.swift; just in case, add them in both locations.

@finagolfin
Copy link
Member

@artemcm, mind reviewing this small pull?

@finagolfin
Copy link
Member

@swift-ci please test

@finagolfin
Copy link
Member

@swift-ci please test

@3405691582
Copy link
Member Author

Please merge on my behalf. Thanks!

@finagolfin
Copy link
Member

@swift-ci please test windows

@finagolfin
Copy link
Member

We can't merge till it passes CI.

@finagolfin
Copy link
Member

Apparently it did, but for whatever reason github has problems getting the results of Windows CI runs.

@artemcm
Copy link
Contributor

artemcm commented Feb 4, 2025

You will need to rebase this on top of latest main because I just merged: #1793

Sorry about that.

BTI enforcement is mandatory, which means if PAC and BTI instructions
are not emitted, then the compiled binary gets killed with SIGILL. The
platform default compiler achieves enabling PAC and BTI by embedding the
relevant enabled Clang compilation option flags into the local platform
toolchain, which affects C/C++ code generation.

For bootstrapping purposes, we need to make this change in the legacy C++
driver in swiftlang/swift#78394; this is the equivalent change for the
new driver.

It's not quite clear whether the flags need to be introduced in
BackendJob.swift as well as FrontendJobHelpers.swift; just in case, add
them in both locations.
@3405691582
Copy link
Member Author

Rebased.

@finagolfin
Copy link
Member

@swift-ci please test

@finagolfin
Copy link
Member

@shahmishal, this just passed Windows CI, but for whatever reason it doesn't show up on github. I've seen this happen for a while on other official Swift component repos like this one, where the github integration doesn't get the status of Windows CI builds and we just have to keep re-running the Windows CI till github sees a successful run.

Is this a known github CI integration issue that someone is looking into fixing?

@artemcm
Copy link
Contributor

artemcm commented Feb 5, 2025

@swift-ci please test Windows platform

@finagolfin finagolfin merged commit ad97b40 into swiftlang:main Feb 6, 2025
3 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