-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[AIX] Add crate "unwind" to link with libunwind #132905
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
r? @bjorn3 |
// `#![no_std]`, `libunwind` is not included in the link command on AIX | ||
// by default. We need to include crate `unwind` manually. | ||
#[cfg(target_os = "aix")] | ||
extern crate unwind; |
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.
Maybe we could unconditionally link against the unwind crate and remove usage of the libc crate?
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.
I don't know if that will work for wasm or some other panic=abort targets though.
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.
I don't know if that will work for wasm or some other panic=abort targets though.
Yeah, unconditionally including the panic_unwind
feature failed on CI target x86_64-gnu-llvm-18
with error "unknown feature panic_unwind
".
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.
The reason CI failed before the last commit was because you enabled the panic_unwind feature unconditionally without including the unwind crate unconditionally. The panic_unwind crate is what defines the unwind feature. If you remove the #[cfg(target_os = "aix")]
on extern crate unwind;
, enabling the panic_unwind feature outside of AIX should work.
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.
Ah, I see. Should we try to include the panic_unwind
feature and specify the unwind
crate both unconditionally and see how CI goes?
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.
Yes. Will probably need a couple of try builds for coverage of panic=abort targets. And if it doesn't work on panic=abort targets, maybe adding //@ needs-unwind
to the tests that use this auxiliary file would be acceptable?
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.
Yeah, that makes sense, thanks!
@bors try |
@bors ping |
😪 I'm awake I'm awake |
[AIX] Add crate "unwind" to link with libunwind The Rust on IBM AIX uses LLVM's `libunwind`. Since crate `unwind` is a dependency of crate `std` and `#![no_std]` is specified in the test case, `libunwind` is not included in the link command by default. As a result, the test case fails to link with the error "Undefined symbol: ._Unwind_Resume" on AIX. This PR explicitly adds crate `unwind` for AIX, along with feature `panic_unwind`, which is required to include the `unwind` crate. try-job: test-various
☀️ Try build successful - checks-actions |
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.
LGTM and tests pass for wasm at least which is a panic=abort target. Please squash your changes and I will r+.
fc1c3d9
to
467ce26
Compare
Done. Thanks so much, @bjorn3! |
@bors r+ |
…kingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#132790 (Add as_slice/into_slice for IoSlice/IoSliceMut.) - rust-lang#132905 ([AIX] Add crate "unwind" to link with libunwind) - rust-lang#132977 (Fix compilation error on Solaris due to flock usage) - rust-lang#132984 ([illumos] use pipe2 to create anonymous pipes) - rust-lang#133019 (docs: Fix missing period and colon in methods for primitive types) - rust-lang#133048 (use `&raw` in `{read, write}_unaligned` documentation) - rust-lang#133050 (Always inline functions signatures containing `f16` or `f128`) - rust-lang#133053 (tests: Fix the SIMD FFI tests with certain x86 configuration) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132905 - xingxue-ibm:link-unwind, r=bjorn3 [AIX] Add crate "unwind" to link with libunwind The Rust on IBM AIX uses LLVM's `libunwind`. Since crate `unwind` is a dependency of crate `std` and `#![no_std]` is specified in the test case, `libunwind` is not included in the link command by default. As a result, the test case fails to link with the error "Undefined symbol: ._Unwind_Resume" on AIX. This PR explicitly adds crate `unwind` for AIX, along with feature `panic_unwind`, which is required to include the `unwind` crate.
The Rust on IBM AIX uses LLVM's
libunwind
. Since crateunwind
is a dependency of cratestd
and#![no_std]
is specified in the test case,libunwind
is not included in the link command by default. As a result, the test case fails to link with the error "Undefined symbol: ._Unwind_Resume" on AIX. This PR explicitly adds crateunwind
for AIX, along with featurepanic_unwind
, which is required to include theunwind
crate.