-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustc: Add LLVM nounwind
with -C panic=abort
#45031
Conversation
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
It appears that rust/src/librustc_trans/callee.rs Lines 108 to 110 in a0db04b
I'm not sure why we have 2 places of code here, but I imagine that needs to be fixed. |
Excellent point! I've updated and extended the test case for that as well. |
src/test/run-pass/no-landing-pads.rs
Outdated
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// compile-flags: -Z no-landing-pads |
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.
AFAIK this test has basically always been invalid, and -C panic=abort
is tested through many other tests
Why did you remove the r=me if you condition the |
Would you prefer I just remove the It's true that yes, |
I know |
@bors: r=arielb1 |
📌 Commit d2348dd has been approved by |
⌛ Testing commit d2348dd3d12ced0f53388e9b8899f7df58e1fea7 with merge c5cc2b0add25d809c7384c78e1915ef7156dae00... |
💔 Test failed - status-appveyor |
Two codegen tests failed on
|
This informs LLVM that functions can't unwind, which while it should typically have already been inferred when necessary or otherwise not impact codegen is apparently needed on targets like ARM to avoid references to unnecessary symbols. Closes rust-lang#44992
d2348dd
to
24cc38e
Compare
@bors: r=arielb1 |
📌 Commit 24cc38e has been approved by |
rustc: Add LLVM `nounwind` with `-C panic=abort` This informs LLVM that functions can't unwind, which while it should typically have already been inferred when necessary or otherwise not impact codegen is apparently needed on targets like ARM to avoid references to unnecessary symbols. Closes #44992
☀️ Test successful - status-appveyor, status-travis |
TL;DR thanks to rust-lang/rust#45031 we no longer need this Now with -C panic=abort all functions are marked with the `nouwind` attribute in LLVM-IR. With this change LLVM won't generate undefined references to `__aeabi_unwind_cpp_pr0` et al. which we don't use / supply but are required by the AEABI standard in the case that a function that throw exceptions exists (semantically, we never have any of those function with panic=abort but the LLVM-IR didn't reflect this before).
TL;DR thanks to rust-lang/rust#45031 we no longer need this Now with -C panic=abort all functions are marked with the `nouwind` attribute in LLVM-IR. With this change LLVM won't generate undefined references to `__aeabi_unwind_cpp_pr0` et al. which we don't use / supply but are required by the AEABI standard in the case that a function that throw exceptions exists (semantically, we never have any of those function with panic=abort but the LLVM-IR didn't reflect this before).
TL;DR thanks to rust-lang/rust#45031 we no longer need this Now with -C panic=abort all functions are marked with the `nouwind` attribute in LLVM-IR. With this change LLVM won't generate undefined references to `__aeabi_unwind_cpp_pr0` et al. which we don't use / supply but are required by the AEABI standard in the case that a function that throw exceptions exists (semantically, we never have any of those function with panic=abort but the LLVM-IR didn't reflect this before).
This informs LLVM that functions can't unwind, which while it should typically
have already been inferred when necessary or otherwise not impact codegen is
apparently needed on targets like ARM to avoid references to unnecessary
symbols.
Closes #44992