-
Notifications
You must be signed in to change notification settings - Fork 12
fix: Ensure mod unwind_unimplemented
works without nightly
feature enabled
#150
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,12 @@ pub(crate) mod naked; | |
#[cfg(all(feature = "unwinding", not(target_arch = "arm")))] | ||
#[allow(unused_extern_crates)] | ||
extern crate unwinding; | ||
#[cfg(all(feature = "unwinding", target_arch = "arm"))] | ||
#[cfg(any(not(feature = "unwinding"), target_arch = "arm"))] | ||
mod unwind_unimplemented; | ||
// If we don't have "unwinding", provide stub functions for unwinding and | ||
// panicking. | ||
#[cfg(not(feature = "unwinding"))] | ||
mod stubs; | ||
Comment on lines
+42
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I figured given the context it was better to co-locate with the other unwinding related logic?
Not sure how you want to approach this. |
||
|
||
#[cfg_attr(target_arch = "aarch64", path = "arch/aarch64.rs")] | ||
#[cfg_attr(target_arch = "x86_64", path = "arch/x86_64.rs")] | ||
|
@@ -66,11 +70,6 @@ pub mod signal; | |
#[cfg_attr(not(feature = "take-charge"), path = "thread/libc.rs")] | ||
pub mod thread; | ||
|
||
// If we don't have "unwinding", provide stub functions for unwinding and | ||
// panicking. | ||
#[cfg(not(feature = "unwinding"))] | ||
mod stubs; | ||
|
||
// Include definitions of `memcpy` and other functions called from LLVM | ||
// Codegen. Normally, these would be defined by the platform libc, however with | ||
// origin with `take-charge`, there is no libc. Otherwise normally, these | ||
|
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 reverted this back to what it was, as I think it's valid to enable for either condition vs only
unwinding
enabled onarm
?Errors without this change
For
x86_64
this change allowed thehello-world-small
Eyra example to build successfully (if thenightly
feature oforigin
was not enabled byc-scape
):eyra => c-gull => c-scape => origin
crates all cloned locally where I removed thenightly
feature fromc-scape
'sorigin
feature list.origin
but no luck. Presumably somethingeyra
/c-scape
was doing withorigin
and it'sunwind
modules here?Without the change, these are the two kinds of failures:
With
-C target-feature=+crt-static
:Without
-C target-feature=+crt-static
, all the symbols that the module provides are listed as errors:RUSTFLAGS='-C panic=abort'
vspanic = "abort"
(Cargo.toml
)If building with
-C panic=abort
(regardless ofpanic
setting inCargo.toml
profile), with thenightly
feature you'll get:That could be prevented by matching the
unwinding
dep cfg requirement forpanic = "unwind"
, but you'd then also need the opposite for themod unwind_unimplemented
condition.Not possible to use
cfg
with features yet: rust-lang/cargo#1197