about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjyn <github@jyn.dev>2024-12-17 18:47:19 -0500
committerjyn <github@jyn.dev>2024-12-17 18:47:19 -0500
commit39305bfaf2dc893835fda0ccecc4fee544a514af (patch)
tree58a39aea9584bec3dafcdd88019e894900063f96
parentb57d93d8b9525fa261404b4cd9c0670eeb1264b8 (diff)
Fix `x build --stage 1 std` when using cg_cranelift as the default backend
Before, cg_cranelift would ICE when trying to lower f16 and f128. The
library/ crates had all the infrastructure to omit using them, it just
wasn't hooked up to bootstrap.
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 0cacd6e4f37..460b86163bd 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -523,6 +523,11 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
 
     let mut features = String::new();
 
+    if stage != 0 && builder.config.default_codegen_backend(target).as_deref() == Some("cranelift")
+    {
+        features += "compiler-builtins-no-f16-f128 ";
+    }
+
     if builder.no_std(target) == Some(true) {
         features += " compiler-builtins-mem";
         if !target.starts_with("bpf") {