8

Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15 by MasterAwesom...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/105932
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

@MasterAwesome MasterAwesome commented Dec 20, 2022

edited

When building with Fat LTO and BTI enabled on aarch64, the BTI is set to Module::Min for alloc shim but is set to Module::Error for the crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's behaviour to support for compiling with different mbranch-protection flags.

Refer:
rust-lang/llvm-project@b0343a3

fixes #102162

Collaborator

rustbot commented Dec 20, 2022

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

Please see the contribution instructions for more information.

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Dec 20, 2022

MasterAwesome

changed the title Correct ModFlagBehavior for Aarch64 on LLVM-15

Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15

Dec 20, 2022

This comment has been minimized.

Contributor

nikic commented Dec 20, 2022

Min is new in LLVM 15, so this will have to be dependent on version.

Either need to pass in Min/Error depending on version, or possibly adjust

to automatically use Error instead of Min for old versions.
MasterAwesome reacted with thumbs up emoji

Contributor

Author

MasterAwesome commented Dec 20, 2022

edited

Ah I see, I'll do an FFI call prior to setting the modflagbehavior to get the version and choose Min if >= 15.

I could add that in the cpp file but I think it might hide future hard to debug issues where the rustc_codegen_llvm chooses Min but it's translated to Error in there.

What do you think?

Contributor

nikic commented Dec 20, 2022

Either way is fine by me. On the Rust side, there's already a llvm_version variable inside that function, so you can pick based on that (llvm_version >= (15, 0, 0) or so).

Contributor

nikic commented Dec 21, 2022

@bors r+

Contributor

bors commented Dec 21, 2022

pushpin Commit 5480ac5 has been approved by nikic

It is now in the queue for this repository.

bors

added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Dec 21, 2022

bors

merged commit 924a1d4 into

rust-lang:master

Dec 22, 2022

10 checks passed

rust-timer

added a commit to rust-lang-ci/rust that referenced this pull request

Dec 22, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

1.68.0

Development

Successfully merging this pull request may close these issues.

[aarch64] Regression with BTI after nightly-2022-08-14

6 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK