Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 78f447d

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

File tree

17 files changed

+52
-12
lines changed

17 files changed

+52
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
defaults:
6666
run:
6767
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}
68-
timeout-minutes: 600
68+
timeout-minutes: 120
6969
env:
7070
CI_JOB_NAME: ${{ matrix.image }}
7171
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

Cargo.lock

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

801801
[[package]]
802802
name = "compiler_builtins"
803-
version = "0.1.109"
804-
source = "registry+https://github.com/rust-lang/crates.io-index"
805-
checksum = "f11973008a8cf741fe6d22f339eba21fd0ca81e2760a769ba8243ed6c21edd7e"
803+
version = "0.1.113"
804+
source = "git+https://github.com/tgross35/compiler-builtins.git?branch=android-testing#42538d8077cb3e2e86ccd4b73266b8f352af3f77"
806805
dependencies = [
807806
"cc",
808807
"rustc-std-workspace-core",

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,4 @@ strip = true
111111
rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
112112
rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
113113
rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
114+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", branch = "android-testing"}

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_sysroot/Cargo.toml

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

compiler/rustc_codegen_gcc/build_system/src/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,14 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
112112
}
113113
let mut env = env.clone();
114114

115-
let mut args: Vec<&dyn AsRef<OsStr>> = vec![&"cargo", &"build", &"--target", &config.target];
115+
let mut args: Vec<&dyn AsRef<OsStr>> = vec![
116+
&"cargo",
117+
&"build",
118+
&"--target",
119+
&config.target,
120+
&"--features",
121+
&"compiler-builtins-no-f16-f128",
122+
];
116123

117124
if config.no_default_features {
118125
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", branch = "android-testing"}

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", branch = "android-testing"}

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", branch = "android-testing"}

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", branch = "android-testing"}

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", branch = "android-testing"}

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

@@ -108,3 +108,6 @@ check-cfg = [
108108
# of declared features, we therefor expect any feature cfg
109109
'cfg(feature, values(any()))',
110110
]
111+
112+
[patch.crates-io]
113+
compiler_builtins = { git = "https://github.com/tgross35/compiler-builtins.git", branch = "android-testing"}

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", branch = "android-testing"}

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)