Skip to content

Commit 375fa82

Browse files
committed
rust178: turn off thread local storage for NetBSD/aarch64*.
NetBSD aarch64 has a bug in the thread-local storage implementation, ref. http://gnats.netbsd.org/58154, and this is responsible for the build misery experienced earlier, ref. rust-lang/rust#123551 Therefore: turn it off for now on arm64. Ideally one could check whether the specific OS version has the fix or not, but e.g. __NetBSD_Version__ isn't easily available here that I know, and this goes against the pattern that OS version should not matter as long as it's >= supported version. So until the fix for NetBSD PR#58154 has propagated to NetBSD releases, and the old ones are no longer supported for pkgsrc (which is going to take a while), this is what we do.
1 parent 7a18e1f commit 375fa82

3 files changed

+50
-0
lines changed

rust178/distinfo

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = 6c8f8bbacc544b63b
112112
SHA1 (patch-compiler_rustc__llvm_build.rs) = a4a66d449fc9eb99d648d02a041778a68f4f7ce8
113113
SHA1 (patch-compiler_rustc__target_src_spec_base_netbsd.rs) = 7d910631f49acf2c33fdd191fd3e0f261efae234
114114
SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = a22b5d28997ed9a5565deec9c34322165d563d00
115+
SHA1 (patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs) = b0a26945a8640d53eabca16c27c99fc27c8e5623
116+
SHA1 (patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs) = bd4f1086033ab21160f1edba1d255ffb4451cbcf
115117
SHA1 (patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs) = e97b7978cc525db7eadf967d51f4818a3c145754
116118
SHA1 (patch-library_backtrace_src_symbolize_gimli.rs) = 1ab343595e65ff6348f83cffc30e53d764485ff8
117119
SHA1 (patch-library_backtrace_src_symbolize_gimli_elf.rs) = 3b84a462c6bc8245d579452e4c37e3ce13314952
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$NetBSD$
2+
3+
NetBSD aarch64 has a bug in the thread-local storage implementation,
4+
ref. http://gnats.netbsd.org/58154, and this is responsible for the
5+
build misery experienced earlier, ref.
6+
https://github.com/rust-lang/rust/issues/123551
7+
Turn it off for now on arm64.
8+
Ideally should check whether the specific OS version has the fix
9+
or not, but e.g. __NetBSD_Version__ isn't easily available here
10+
that I know, and this goes against the attitude that OS version
11+
should matter as long as it's >= supported version.
12+
So until the fix for NetBSD PR#58154 has propagated to releases,
13+
this is what we do.
14+
15+
--- compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs.orig 2024-07-23 19:21:34.344805113 +0000
16+
+++ compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs
17+
@@ -18,6 +18,7 @@ pub fn target() -> Target {
18+
max_atomic_width: Some(128),
19+
stack_probes: StackProbeType::Inline,
20+
endian: Endian::Big,
21+
+ has_thread_local: false, // ref. NetBSD PR#58154
22+
..base::netbsd::opts()
23+
},
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$NetBSD$
2+
3+
NetBSD aarch64 has a bug in the thread-local storage implementation,
4+
ref. http://gnats.netbsd.org/58154, and this is responsible for the
5+
build misery experienced earlier, ref.
6+
https://github.com/rust-lang/rust/issues/123551
7+
Turn it off for now on arm64.
8+
Ideally should check whether the specific OS version has the fix
9+
or not, but e.g. __NetBSD_Version__ isn't easily available here
10+
that I know, and this goes against the attitude that OS version
11+
should matter as long as it's >= supported version.
12+
So until the fix for NetBSD PR#58154 has propagated to releases,
13+
this is what we do.
14+
15+
--- compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs.orig 2024-07-23 19:18:44.116841966 +0000
16+
+++ compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs
17+
@@ -17,6 +17,7 @@ pub fn target() -> Target {
18+
mcount: "__mcount".into(),
19+
max_atomic_width: Some(128),
20+
stack_probes: StackProbeType::Inline,
21+
+ has_thread_local: false, // ref. NetBSD PR#58154
22+
..base::netbsd::opts()
23+
},
24+
}

0 commit comments

Comments
 (0)