-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Explicitly choose x86 softfloat/hardfloat ABI #136146
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
set -euo pipefail | ||
|
||
LINUX_VERSION=v6.13-rc1 | ||
LINUX_VERSION=50e57739141b41f731ab31f8380821c7969f9dc4 | ||
|
||
# Build rustc, rustdoc, cargo, clippy-driver and rustfmt | ||
../x.py build --stage 2 library rustdoc clippy rustfmt | ||
|
@@ -28,7 +28,7 @@ rm -rf linux || true | |
# Download Linux at a specific commit | ||
mkdir -p linux | ||
git -C linux init | ||
git -C linux remote add origin https://github.com/Rust-for-Linux/linux.git | ||
git -C linux remote add origin https://github.com/Darksonn/linux.git | ||
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. this needs a cfg(bootstrap) to get bumped on release 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 don't follow, what does the Linux kernel have to do with bootstraping? I think I did everything mentioned at https://rustc-dev-guide.rust-lang.org/tests/rust-for-linux.html. 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. Oops, I missed that the maintainers have taken responsibility for flipping this back and don't need extra reminders from Release. 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 am confused too -- this seems fine. When v6.14-rc3 releases in a couple weeks, which is the one I am planning to get the fix into, I will send a PR with that tag, and we will be in the normal situation again. 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 don't think there is a technical requirement to flip it back. I mean, the idea is that we do so, but it is orthogonal to the release, no? It is just a CI test. For instance, in an ideal world, we could be testing several supported Linux versions (e.g. the latest LTS). |
||
git -C linux fetch --depth 1 origin ${LINUX_VERSION} | ||
git -C linux checkout FETCH_HEAD | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//! Ensure ABI-incompatible features cannot be enabled via `-Ctarget-feature`. | ||
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib | ||
//@ needs-llvm-components: x86 | ||
//@ compile-flags: -Ctarget-feature=+soft-float | ||
// For now this is just a warning. | ||
//@ build-pass | ||
//@error-pattern: must be disabled to ensure that the ABI | ||
#![feature(no_core, lang_items, riscv_target_feature)] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
warning: target feature `soft-float` must be disabled 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> | ||
|
||
warning: unstable feature specified for `-Ctarget-feature`: `soft-float` | ||
| | ||
= note: this feature is not stably supported; its behavior can change in the future | ||
|
||
warning: 2 warnings emitted | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib | ||
//@ needs-llvm-components: x86 | ||
//! Ensure "forbidden" target features cannot be enabled via `#[target_feature]`. | ||
//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib | ||
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. thanks for better documenting these! |
||
//@ needs-llvm-components: riscv | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
#[target_feature(enable = "soft-float")] | ||
#[target_feature(enable = "forced-atomics")] | ||
//~^ERROR: cannot be enabled with | ||
pub unsafe fn my_fun() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: target feature `soft-float` cannot be enabled with `#[target_feature]`: unsound because it changes float ABI | ||
--> $DIR/forbidden-target-feature-attribute.rs:9:18 | ||
error: target feature `forced-atomics` cannot be enabled with `#[target_feature]`: unsound because it changes the ABI of atomic operations | ||
--> $DIR/forbidden-target-feature-attribute.rs:10:18 | ||
| | ||
LL | #[target_feature(enable = "soft-float")] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
LL | #[target_feature(enable = "forced-atomics")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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.
Making this "forbidden" just leads to duplicate warnings so there's little point in doing that.
This makes riscv's
forced-atomics
the only remaining "forbidden" feature.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.
That makes sense to me.