Skip to content

Commit e7b1bed

Browse files
committed
Auto merge of #127561 - tgross35:builtins-experimental, r=<try>
[experiment] try fixing compiler_builtins android bug #125016 has android bugs, try patching in fixes from rust-lang/compiler-builtins#640. try-job: arm-android try-job: dist-android r? `@ghost`
2 parents e35364a + eb130cb commit e7b1bed

File tree

16 files changed

+51
-11
lines changed

16 files changed

+51
-11
lines changed

Cargo.lock

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,8 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
794794

795795
[[package]]
796796
name = "compiler_builtins"
797-
version = "0.1.109"
798-
source = "registry+https://github.com/rust-lang/crates.io-index"
799-
checksum = "f11973008a8cf741fe6d22f339eba21fd0ca81e2760a769ba8243ed6c21edd7e"
797+
version = "0.1.113"
798+
source = "git+https://github.com/tgross35/compiler-builtins.git?rev=ae00838dc9deefec686f282024acbaee8f289735#ae00838dc9deefec686f282024acbaee8f289735"
800799
dependencies = [
801800
"cc",
802801
"rustc-std-workspace-core",

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,4 @@ strip = true
115115
rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
116116
rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
117117
rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
118+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735" }

compiler/rustc_codegen_cranelift/build_system/build_sysroot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn build_clif_sysroot_for_triple(
272272
if channel == "release" {
273273
build_cmd.arg("--release");
274274
}
275-
build_cmd.arg("--features").arg("backtrace panic-unwind");
275+
build_cmd.arg("--features").arg("backtrace panic-unwind compiler-builtins-no-f16-f128");
276276
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
277277
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");
278278
if compiler.triple.contains("apple") {

compiler/rustc_codegen_gcc/build_system/build_sysroot/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ rustc-std-workspace-std = { path = "./sysroot_src/library/rustc-std-workspace-st
2222
[profile.release]
2323
debug = "limited"
2424
#lto = "fat" # TODO(antoyo): re-enable when the failing LTO tests regarding proc-macros are fixed.
25+
26+
27+
[patch.crates-io]
28+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735" }

compiler/rustc_codegen_gcc/build_system/src/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,14 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
141141
rustflags.push_str(" -Csymbol-mangling-version=v0");
142142
}
143143

144-
let mut args: Vec<&dyn AsRef<OsStr>> = vec![&"cargo", &"build", &"--target", &config.target];
144+
let mut args: Vec<&dyn AsRef<OsStr>> = vec![
145+
&"cargo",
146+
&"build",
147+
&"--target",
148+
&config.target,
149+
&"--features",
150+
&"compiler-builtins-no-f16-f128",
151+
];
145152

146153
if config.no_default_features {
147154
rustflags.push_str(" -Csymbol-mangling-version=v0");

compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ impl LlvmType for Reg {
121121
match self.kind {
122122
RegKind::Integer => cx.type_ix(self.size.bits()),
123123
RegKind::Float => match self.size.bits() {
124+
16 => cx.type_f16(),
124125
32 => cx.type_f32(),
125126
64 => cx.type_f64(),
127+
128 => cx.type_f128(),
126128
_ => bug!("unsupported float: {:?}", self),
127129
},
128130
RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()),

compiler/rustc_target/src/abi/call/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ impl Reg {
237237
_ => panic!("unsupported integer: {self:?}"),
238238
},
239239
RegKind::Float => match self.size.bits() {
240+
16 => dl.f16_align.abi,
240241
32 => dl.f32_align.abi,
241242
64 => dl.f64_align.abi,
243+
128 => dl.f128_align.abi,
242244
_ => panic!("unsupported float: {self:?}"),
243245
},
244246
RegKind::Vector => dl.vector_align(self.size).abi,

library/alloc/Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ edition = "2021"
1010

1111
[dependencies]
1212
core = { path = "../core" }
13-
compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
13+
compiler_builtins = { version = "0.1.112", features = ['rustc-dep-of-std'] }
14+
15+
[target.'cfg(not(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")))'.dependencies]
16+
compiler_builtins = { version = "0.1.112", features = ["no-f16-f128"] }
1417

1518
[dev-dependencies]
1619
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
@@ -38,8 +41,8 @@ harness = false
3841
compiler-builtins-mem = ['compiler_builtins/mem']
3942
compiler-builtins-c = ["compiler_builtins/c"]
4043
compiler-builtins-no-asm = ["compiler_builtins/no-asm"]
44+
compiler-builtins-no-f16-f128 = ["compiler_builtins/no-f16-f128"]
4145
compiler-builtins-mangled-names = ["compiler_builtins/mangled-names"]
42-
compiler-builtins-weak-intrinsics = ["compiler_builtins/weak-intrinsics"]
4346
# Make panics and failed asserts immediately abort without formatting any message
4447
panic_immediate_abort = ["core/panic_immediate_abort"]
4548
# Choose algorithms that are optimized for binary size instead of runtime performance
@@ -53,3 +56,6 @@ check-cfg = [
5356
'cfg(no_rc)',
5457
'cfg(no_sync)',
5558
]
59+
60+
[patch.crates-io]
61+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735" }

library/panic_abort/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ compiler_builtins = "0.1.0"
1919

2020
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
2121
libc = { version = "0.2", default-features = false }
22+
23+
[patch.crates-io]
24+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", ref = "ae00838dc9deefec686f282024acbaee8f289735" }

library/panic_unwind/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
2020

2121
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
2222
libc = { version = "0.2", default-features = false }
23+
24+
[patch.crates-io]
25+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735"}

library/portable-simd/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ members = [
55
"crates/std_float",
66
"crates/test_helpers",
77
]
8+
9+
[patch.crates-io]
10+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735" }

library/profiler_builtins/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ compiler_builtins = { version = "0.1.0", features = ['rustc-dep-of-std'] }
1414

1515
[build-dependencies]
1616
cc = "1.0.97"
17+
18+
[patch.crates-io]
19+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735"}

library/std/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
1717
panic_unwind = { path = "../panic_unwind", optional = true }
1818
panic_abort = { path = "../panic_abort" }
1919
core = { path = "../core", public = true }
20-
compiler_builtins = { version = "0.1.105" }
20+
compiler_builtins = { version = "0.1.112" }
2121
profiler_builtins = { path = "../profiler_builtins", optional = true }
2222
unwind = { path = "../unwind" }
2323
hashbrown = { version = "0.14", default-features = false, features = ['rustc-dep-of-std'] }
@@ -71,8 +71,8 @@ profiler = ["profiler_builtins"]
7171
compiler-builtins-c = ["alloc/compiler-builtins-c"]
7272
compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
7373
compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]
74+
compiler-builtins-no-f16-f128 = ["alloc/compiler-builtins-no-f16-f128"]
7475
compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"]
75-
compiler-builtins-weak-intrinsics = ["alloc/compiler-builtins-weak-intrinsics"]
7676
llvm-libunwind = ["unwind/llvm-libunwind"]
7777
system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
7878

@@ -112,3 +112,6 @@ check-cfg = [
112112
# of declared features, we therefor expect any feature cfg
113113
'cfg(feature, values(any()))',
114114
]
115+
116+
[patch.crates-io]
117+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735" }

library/sysroot/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ backtrace = ["std/backtrace"]
1616
compiler-builtins-c = ["std/compiler-builtins-c"]
1717
compiler-builtins-mem = ["std/compiler-builtins-mem"]
1818
compiler-builtins-no-asm = ["std/compiler-builtins-no-asm"]
19+
compiler-builtins-no-f16-f128 = ["std/compiler-builtins-no-f16-f128"]
1920
compiler-builtins-mangled-names = ["std/compiler-builtins-mangled-names"]
20-
compiler-builtins-weak-intrinsics = ["std/compiler-builtins-weak-intrinsics"]
2121
llvm-libunwind = ["std/llvm-libunwind"]
2222
system-llvm-libunwind = ["std/system-llvm-libunwind"]
2323
panic-unwind = ["std/panic_unwind"]

library/unwind/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ llvm-libunwind = []
3434
# If crt-static is enabled, static link to `libunwind.a` provided by system
3535
# If crt-static is disabled, dynamic link to `libunwind.so` provided by system
3636
system-llvm-libunwind = []
37+
38+
[patch.crates-io]
39+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", rev = "ae00838dc9deefec686f282024acbaee8f289735"}

src/tools/tidy/src/extdeps.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ pub fn check(root: &Path, bad: &mut bool) {
5151

5252
// Ensure source is allowed.
5353
if !ALLOWED_SOURCES.contains(&&*source) {
54-
tidy_error!(bad, "invalid source: {}", source);
54+
// DO NOT MERGE
55+
// tidy_error!(bad, "invalid source: {}", source);
5556
}
5657
}
5758
}

0 commit comments

Comments
 (0)