-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
s390x-unknown-linux-gnu: cfg!(target_feature = "backchain") is always true #129927
Comments
I believe this is intended. |
By "always available" you mean that there is no difference between |
There are differences between the code generated with or without |
The point of Maybe you are confusing
If this is not actually a target feature, then it is not clear that we want this to be a target feature in Rust. Though I guess What happens when I mix code built with and without |
Well, I added this as a
No, it just means you won't be able to perform unwinding actions based purely on backchain information. |
If you want to know how Clang passes In this example, |
Okay, thanks. I don't fully understand the consequences of that -- if this makes Rust panic catching go wrong, that still seems bad -- but 🤷 whatever. The point of the issue is that the behavior of |
No, it won't affect panic catching since Rust panic catching does not use this mechanism on IBM Z systems.
Hmm, I don't know what we should do here, if we need to fix this issue, how should we avoid passing the |
The logic that decides what to pass to LLVM and the logic that decides what is set in I think all that needs to be done is change this
to simply features.contains(&Symbol::intern(feature)) The |
Yes, I believe the change was done after I added
I will try to implement this change then. |
…RalfJung s390x: Fix a regression related to backchain feature In rust-lang#127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes rust-lang#129927. r? `@RalfJung`
…RalfJung s390x: Fix a regression related to backchain feature In rust-lang#127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes rust-lang#129927. r? ``@RalfJung``
…RalfJung s390x: Fix a regression related to backchain feature In rust-lang#127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes rust-lang#129927. r? `@RalfJung`
Rollup merge of rust-lang#129940 - liushuyu:s390x-target-features, r=RalfJung s390x: Fix a regression related to backchain feature In rust-lang#127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes rust-lang#129927. r? `@RalfJung`
#127506 introduced what I think is a logic error:
cfg!(target_feature = "backchain")
is now alwaystrue
on s390x targets, even if the feature gate is not set. I verified this with Miri, which shares thecfg
logic with rustc so it should be a correct test.This should print
false
when built without-Ctarget-feature=+backchain
(as the feature seems off-by-default), but printstrue
instead:Cc @liushuyu
The text was updated successfully, but these errors were encountered: