Auto merge of #125016 - nicholasbishop:bishop-cb-112, r=tgross35

Update compiler_builtins to 0.1.114

The `weak-intrinsics` feature was removed from compiler_builtins in https://github.com/rust-lang/compiler-builtins/pull/598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot.

In https://github.com/rust-lang/compiler-builtins/pull/593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
This commit is contained in:
bors 2024-07-29 07:41:33 +00:00
commit 80d8270d84
8 changed files with 23 additions and 9 deletions

View File

@ -739,9 +739,9 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
[[package]] [[package]]
name = "compiler_builtins" name = "compiler_builtins"
version = "0.1.109" version = "0.1.114"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f11973008a8cf741fe6d22f339eba21fd0ca81e2760a769ba8243ed6c21edd7e" checksum = "eb58b199190fcfe0846f55a3b545cd6b07a34bdd5930a476ff856f3ebcc5558a"
dependencies = [ dependencies = [
"cc", "cc",
"rustc-std-workspace-core", "rustc-std-workspace-core",

View File

@ -271,7 +271,7 @@ fn build_clif_sysroot_for_triple(
if channel == "release" { if channel == "release" {
build_cmd.arg("--release"); build_cmd.arg("--release");
} }
build_cmd.arg("--features").arg("backtrace panic-unwind"); build_cmd.arg("--features").arg("backtrace panic-unwind compiler-builtins-no-f16-f128");
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true"); build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif"); build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
if compiler.triple.contains("apple") { if compiler.triple.contains("apple") {

View File

@ -142,7 +142,14 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
rustflags.push_str(" -Csymbol-mangling-version=v0"); rustflags.push_str(" -Csymbol-mangling-version=v0");
} }
let mut args: Vec<&dyn AsRef<OsStr>> = vec![&"cargo", &"build", &"--target", &config.target]; let mut args: Vec<&dyn AsRef<OsStr>> = vec![
&"cargo",
&"build",
&"--target",
&config.target,
&"--features",
&"compiler-builtins-no-f16-f128",
];
if config.no_default_features { if config.no_default_features {
rustflags.push_str(" -Csymbol-mangling-version=v0"); rustflags.push_str(" -Csymbol-mangling-version=v0");

View File

@ -119,8 +119,10 @@ fn llvm_type<'ll>(&self, cx: &CodegenCx<'ll, '_>) -> &'ll Type {
match self.kind { match self.kind {
RegKind::Integer => cx.type_ix(self.size.bits()), RegKind::Integer => cx.type_ix(self.size.bits()),
RegKind::Float => match self.size.bits() { RegKind::Float => match self.size.bits() {
16 => cx.type_f16(),
32 => cx.type_f32(), 32 => cx.type_f32(),
64 => cx.type_f64(), 64 => cx.type_f64(),
128 => cx.type_f128(),
_ => bug!("unsupported float: {:?}", self), _ => bug!("unsupported float: {:?}", self),
}, },
RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()), RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()),

View File

@ -238,8 +238,10 @@ pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
_ => panic!("unsupported integer: {self:?}"), _ => panic!("unsupported integer: {self:?}"),
}, },
RegKind::Float => match self.size.bits() { RegKind::Float => match self.size.bits() {
16 => dl.f16_align.abi,
32 => dl.f32_align.abi, 32 => dl.f32_align.abi,
64 => dl.f64_align.abi, 64 => dl.f64_align.abi,
128 => dl.f128_align.abi,
_ => panic!("unsupported float: {self:?}"), _ => panic!("unsupported float: {self:?}"),
}, },
RegKind::Vector => dl.vector_align(self.size).abi, RegKind::Vector => dl.vector_align(self.size).abi,

View File

@ -10,7 +10,10 @@ edition = "2021"
[dependencies] [dependencies]
core = { path = "../core" } core = { path = "../core" }
compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] } compiler_builtins = { version = "0.1.114", features = ['rustc-dep-of-std'] }
[target.'cfg(not(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")))'.dependencies]
compiler_builtins = { version = "0.1.114", features = ["no-f16-f128"] }
[dev-dependencies] [dev-dependencies]
rand = { version = "0.8.5", default-features = false, features = ["alloc"] } rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
@ -38,8 +41,8 @@ harness = false
compiler-builtins-mem = ['compiler_builtins/mem'] compiler-builtins-mem = ['compiler_builtins/mem']
compiler-builtins-c = ["compiler_builtins/c"] compiler-builtins-c = ["compiler_builtins/c"]
compiler-builtins-no-asm = ["compiler_builtins/no-asm"] compiler-builtins-no-asm = ["compiler_builtins/no-asm"]
compiler-builtins-no-f16-f128 = ["compiler_builtins/no-f16-f128"]
compiler-builtins-mangled-names = ["compiler_builtins/mangled-names"] compiler-builtins-mangled-names = ["compiler_builtins/mangled-names"]
compiler-builtins-weak-intrinsics = ["compiler_builtins/weak-intrinsics"]
# Make panics and failed asserts immediately abort without formatting any message # Make panics and failed asserts immediately abort without formatting any message
panic_immediate_abort = ["core/panic_immediate_abort"] panic_immediate_abort = ["core/panic_immediate_abort"]
# Choose algorithms that are optimized for binary size instead of runtime performance # Choose algorithms that are optimized for binary size instead of runtime performance

View File

@ -17,7 +17,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
panic_unwind = { path = "../panic_unwind", optional = true } panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" } panic_abort = { path = "../panic_abort" }
core = { path = "../core", public = true } core = { path = "../core", public = true }
compiler_builtins = { version = "0.1.105" } compiler_builtins = { version = "0.1.114" }
profiler_builtins = { path = "../profiler_builtins", optional = true } profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" } unwind = { path = "../unwind" }
hashbrown = { version = "0.14", default-features = false, features = [ hashbrown = { version = "0.14", default-features = false, features = [
@ -95,8 +95,8 @@ profiler = ["profiler_builtins"]
compiler-builtins-c = ["alloc/compiler-builtins-c"] compiler-builtins-c = ["alloc/compiler-builtins-c"]
compiler-builtins-mem = ["alloc/compiler-builtins-mem"] compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"] compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]
compiler-builtins-no-f16-f128 = ["alloc/compiler-builtins-no-f16-f128"]
compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"] compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"]
compiler-builtins-weak-intrinsics = ["alloc/compiler-builtins-weak-intrinsics"]
llvm-libunwind = ["unwind/llvm-libunwind"] llvm-libunwind = ["unwind/llvm-libunwind"]
system-llvm-libunwind = ["unwind/system-llvm-libunwind"] system-llvm-libunwind = ["unwind/system-llvm-libunwind"]

View File

@ -16,8 +16,8 @@ backtrace = ["std/backtrace"]
compiler-builtins-c = ["std/compiler-builtins-c"] compiler-builtins-c = ["std/compiler-builtins-c"]
compiler-builtins-mem = ["std/compiler-builtins-mem"] compiler-builtins-mem = ["std/compiler-builtins-mem"]
compiler-builtins-no-asm = ["std/compiler-builtins-no-asm"] compiler-builtins-no-asm = ["std/compiler-builtins-no-asm"]
compiler-builtins-no-f16-f128 = ["std/compiler-builtins-no-f16-f128"]
compiler-builtins-mangled-names = ["std/compiler-builtins-mangled-names"] compiler-builtins-mangled-names = ["std/compiler-builtins-mangled-names"]
compiler-builtins-weak-intrinsics = ["std/compiler-builtins-weak-intrinsics"]
llvm-libunwind = ["std/llvm-libunwind"] llvm-libunwind = ["std/llvm-libunwind"]
system-llvm-libunwind = ["std/system-llvm-libunwind"] system-llvm-libunwind = ["std/system-llvm-libunwind"]
panic-unwind = ["std/panic_unwind"] panic-unwind = ["std/panic_unwind"]