Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jan 27, 2025

Part of #135408:
Instead of choosing this based on the target features listed in the target spec, make that choice explicit.
This means that all x86 (32bit and 64bit) softfloat target need to explicitly set rustc-abi to x86-softfloat.

Also fix some mistakes in the platform-docs where the x87 errata footnotes were missing or wrong.

try-job: x86_64-rust-for-linux

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

r? @cjgillot

rustbot has assigned @cjgillot.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 27, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@RalfJung
Copy link
Member Author

Cc @workingjubilee

@RalfJung RalfJung changed the title Explicit choose x86 softfloat/hardfloat ABI Explicitly choose x86 softfloat/hardfloat ABI Jan 27, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor

r? compiler

@rustbot rustbot assigned lcnr and unassigned cjgillot Jan 28, 2025
@RalfJung RalfJung force-pushed the x86-abi branch 3 times, most recently from bd35e7c to 89fa12a Compare January 28, 2025 01:40
("soft-float", Stability::Forbidden { reason: "unsound because it changes float ABI" }, &[]),
// This cannot actually be toggled, the ABI always fixes it, so it'd make little sense to
// stabilize. It must be in this list for the ABI check to be able to use it.
("soft-float", Stability::Unstable(sym::x87_target_feature), &[]),
Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that while it changes some error outputs, this PR shouldn't have any practical effect on people, correct? Except those using our unstable target-spec.json, I suppose, and they bought the ticket for the ride they're going to get.

r=me with nits addressed

match s.parse::<super::RustcAbi>() {
Ok(rustc_abi) => base.$key_name = Some(rustc_abi),
_ => return Some(Err(format!(
"'{s}' is not a valid value for rust-abi. \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"'{s}' is not a valid value for rust-abi. \
"'{s}' is not a valid value for rustc-abi. \

/// The Rustc-specific variant of the ABI used for this target.
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
pub enum RustcAbi {
/// On x86-32/64 only: do not use any FPU or SIMD registers for the ABI/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "ABI/"?

@RalfJung
Copy link
Member Author

RalfJung commented Jan 28, 2025

My understanding is that while it changes some error outputs, this PR shouldn't have any practical effect on people, correct? Except those using our unstable target-spec.json, I suppose, and they bought the ticket for the ride they're going to get.

Correct, for custom target specs this can add -soft-float if you don't also set rustc-abi: "x86-softfloat". This is probably surprising as there is no warning about this, it just silently happens.

Maybe we should land #136147 first; that would avoid changing behavior for target-spec users and instead just emit a warning.

@workingjubilee
Copy link
Member

I'm not worried about being maximally convenient for them, but either way. I'll try to review that when I finish my tea.

@lcnr
Copy link
Contributor

lcnr commented Jan 28, 2025

r? @workingjubilee

@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2025

Could not assign reviewer from: workingjubilee.
User(s) workingjubilee are either the PR author, already assigned, or on vacation. Please use r? to specify someone else to assign.

@bors
Copy link
Contributor

bors commented Jan 29, 2025

☔ The latest upstream changes (presumably #136225) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Feb 1, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Feb 1, 2025

Thanks! Let's see how that goes.
@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 1, 2025
Explicitly choose x86 softfloat/hardfloat ABI

Part of rust-lang#135408:
Instead of choosing this based on the target features listed in the target spec, make that choice explicit.
This means that all x86 (32bit and 64bit) softfloat target need to explicitly set `rustc-abi` to `x86-softfloat`.

Also fix some mistakes in the platform-docs where the x87 errata footnotes were missing or wrong.

try-job: x86_64-rust-for-linux
@bors
Copy link
Contributor

bors commented Feb 1, 2025

⌛ Trying commit 42962c2 with merge 659b760...

@bors
Copy link
Contributor

bors commented Feb 1, 2025

☀️ Try build successful - checks-actions
Build commit: 659b760 (659b7604e40d67bfc7780897d5fe447f2cf3004c)

@RalfJung
Copy link
Member Author

RalfJung commented Feb 2, 2025 via email

@Darksonn
Copy link
Contributor

Darksonn commented Feb 2, 2025

I think it's fine as is.

@RalfJung
Copy link
Member Author

RalfJung commented Feb 2, 2025

@bors r=workingjubilee

@bors
Copy link
Contributor

bors commented Feb 2, 2025

📌 Commit 42962c2 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 2, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Feb 2, 2025

@bors p=1
There's a follow-up PR waiting for this.

@workingjubilee
Copy link
Member

thanks!

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 2, 2025
Explicitly choose x86 softfloat/hardfloat ABI

Part of rust-lang#135408:
Instead of choosing this based on the target features listed in the target spec, make that choice explicit.
This means that all x86 (32bit and 64bit) softfloat target need to explicitly set `rustc-abi` to `x86-softfloat`.

Also fix some mistakes in the platform-docs where the x87 errata footnotes were missing or wrong.

try-job: x86_64-rust-for-linux
@bors
Copy link
Contributor

bors commented Feb 2, 2025

⌛ Testing commit 42962c2 with merge 3ad08df...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Removing libglx-mesa0:arm64 (24.0.9-0ubuntu0.3) ...
Removing libgl1-mesa-dri:arm64 (24.0.9-0ubuntu0.3) ...
Removing libmysqlclient-dev (8.0.40-0ubuntu0.24.04.1) ...
Removing sphinxsearch (2.2.11-8build1) ...
Failed to retrieve unit state: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
invoke-rc.d: could not determine current runlevel
Failed to get properties: Connection timed out

Removing libmysqlclient21:arm64 (8.0.40-0ubuntu0.24.04.1) ...
---

invoke-rc.d: could not determine current runlevel
Failed to stop mysql.service: Connection timed out

See system logs and 'systemctl status mysql.service' for details.

invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
 installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to retrieve unit state: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
invoke-rc.d: could not determine current runlevel
Failed to stop mysql.service: Connection timed out


See system logs and 'systemctl status mysql.service' for details.

invoke-rc.d: initscript mysql, action "stop" failed.
Reload daemon failed: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)

Failed to retrieve unit state: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
invoke-rc.d: could not determine current runlevel
Errors were encountered while processing:
 mysql-server-8.0
Processing was halted because there were too many errors.
Processing was halted because there were too many errors.
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)
##[error]Process completed with exit code 100.

@bors
Copy link
Contributor

bors commented Feb 2, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 2, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Feb 2, 2025

@bors retry various systemd timeouts on aarch64-gnu-debug?

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 2, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 2, 2025
Explicitly choose x86 softfloat/hardfloat ABI

Part of rust-lang#135408:
Instead of choosing this based on the target features listed in the target spec, make that choice explicit.
This means that all x86 (32bit and 64bit) softfloat target need to explicitly set `rustc-abi` to `x86-softfloat`.

Also fix some mistakes in the platform-docs where the x87 errata footnotes were missing or wrong.

try-job: x86_64-rust-for-linux
@bors
Copy link
Contributor

bors commented Feb 2, 2025

⌛ Testing commit 42962c2 with merge 09a2a17...

@workingjubilee
Copy link
Member

but note also #135867

@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-msvc failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[2025-02-02T23:05:13Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-02T23:05:13Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:13Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpYsSGED#externs@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-02T23:05:13Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:13Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpYsSGED#externs@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpYsSGED\\incremental-state"
[2025-02-02T23:05:14Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:14Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpYsSGED#externs@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpYsSGED\\incremental-state"
Executing benchmark match-stress (6/8)
Preparing match-stress
[2025-02-02T23:05:14Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=None, patch=None, backend=Llvm, phase=dependencies
[2025-02-02T23:05:14Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=None, patch=None, backend=Llvm, phase=dependencies
---
[2025-02-02T23:05:15Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-02T23:05:15Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:15Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpHadMsd#match-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-02T23:05:16Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:16Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpHadMsd#match-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpHadMsd\\incremental-state"
[2025-02-02T23:05:18Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:18Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpHadMsd#match-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpHadMsd\\incremental-state"
[2025-02-02T23:05:18Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-02T23:05:18Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:18Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpUO9DGb#match-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-02T23:05:20Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
[2025-02-02T23:05:40Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-02T23:05:40Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:40Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpgxSQJB#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-02T23:05:43Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:43Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpgxSQJB#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpgxSQJB\\incremental-state"
[2025-02-02T23:05:47Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:47Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpgxSQJB#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpgxSQJB\\incremental-state"
[2025-02-02T23:05:48Z DEBUG collector::compile::benchmark::patch] applying new row to "C:\\a\\_temp\\msys64\\tmp\\.tmpgxSQJB"
[2025-02-02T23:05:48Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("new row"), path: "0-new-row.patch" }), backend=Llvm, phase=benchmark
[2025-02-02T23:05:48Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("new row"), path: "0-new-row.patch" }), backend=Llvm, phase=benchmark
[2025-02-02T23:05:48Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpgxSQJB#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpgxSQJB\\incremental-state"
[2025-02-02T23:05:51Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-02T23:05:51Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-02T23:05:51Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmp8T31TW#tuple-stress@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-02T23:05:54Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark

@bors
Copy link
Contributor

bors commented Feb 2, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants