Skip to content

Problem with Warning Related to x87 Flag #1559

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

Closed
a14e opened this issue Feb 3, 2025 · 3 comments
Closed

Problem with Warning Related to x87 Flag #1559

a14e opened this issue Feb 3, 2025 · 3 comments

Comments

@a14e
Copy link

a14e commented Feb 3, 2025

Hello!

I'm trying to use rustc_codegen_cranelift, and the compiler is giving me the following warning:

warning: target feature `x87` must be enabled to ensure that the ABI of the current target can be implemented correctly
  |
  = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>

It seems to be related to this code:

fn target_features_cfg(
        &self,
        sess: &Session,
        _allow_unstable: bool,
    ) -> Vec<rustc_span::Symbol> {
        // FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
        if sess.target.arch == "x86_64" && sess.target.os != "none" {
            // x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
            vec![sym::fsxr, sym::sse, sym::sse2, Symbol::intern("x87")]
        }  ...

Is there a way to fix this, or is this a limitation of rustc_codegen_cranelift?

@bjorn3
Copy link
Member

bjorn3 commented Feb 3, 2025

Are you using cg_clif as distributed with rustup or as downloaded from https://github.com/rust-lang/rustc_codegen_cranelift/releases/tag/dev? I added Symbol::intern("x87") to this repo to fix this warning yesterday, but I haven't synced it back to the main rust repo for inclusion on rustup yet.

@a14e
Copy link
Author

a14e commented Feb 3, 2025

@bjorn3
I just called rustup component add rustc-codegen-cranelift-preview --toolchain nightly

@bjorn3
Copy link
Member

bjorn3 commented Feb 8, 2025

Synced to the rust repo in rust-lang/rust#136715. Should be fixed in tomorrow's nightly.

@bjorn3 bjorn3 closed this as completed Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants