Repository: rust
Issue: rust 1.77.1 fails to build natively on armv7-unknown-netbsd-eabihf
Labels: O-Arm,P-low,T-compiler,regression-from-stable-to-stable,I-unsound,O-netbsd,C-bug,S-needs-repro

While working through the testing of rust 1.77.1 for the various NetBSD targets we try to keep rust running on, I am having trouble getting rust to build "natively" on an emulated armv7 system.

I expected to see this happen: The build of rust should complete.

Instead, this happened: Rust 1.77.1 fails to build, while the build of 1.76.0 succeeded.

The error I see is a SIGSEGV error in the rust build, using the `stage2` rust compiler, which is built with the embedded LLVM in the rust distribution, either when building the `libc` crate, or sometimes (I tried restarting the build multiple times) when building the `proc-macro2` or `unicode-ident` vendor crates.

I initially tried running the build with a parallelism of 3, but have dialed that down to 1 now to eliminate any issues with that and also to make the build log less confusing, and it now looks like it has consistent problems building the `libc-v0.2.151` crate.  This happens quite a bit into the build, initially after 40+ hours, and as mentioned, while using the `stage2` compiler, so this is rustc 1.77.1 itself.  I initially had problems getting any information out of this from gdb, but this now succeeded, hence this problem report.  The end of the build log was in this latest rebuild attempt:

```
   Compiling libc v0.2.151
     Running `/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/bootstrap/debug/rustc /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/bootstrap/debug/rustc --crate-name build_script_build /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/vendor/libc/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="extra_traits"' --cfg 'feature="std"' -Zunstable-options --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C metadata=bfcae1bc36ffd5f3 -C extra-filename=-bfcae1bc36ffd5f3 --out-dir /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/build/libc-bfcae1bc36ffd5f3 -L dependency=/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/deps --cap-lints allow -Z binary-dep-depinfo`

rustc exited with signal: 11 (SIGSEGV) (core dumped)
Did not run successfully: signal: 11 (SIGSEGV) (core dumped)
LD_LIBRARY_PATH="/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib:/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/deps:/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib:/usr/pkgsrc/wip/rust177/work/rust-bootstrap/lib" "/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/bin/rustc" "--crate-name" "build_script_build" "/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/vendor/libc/build.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "bin" "--emit=dep-info,link" "-C" "embed-bitcode=no" "-C" "debug-assertions=off" "--cfg" "feature=\"default\"" "--cfg" "feature=\"extra_traits\"" "--cfg" "feature=\"std\"" "-Zunstable-options" "--check-cfg" "cfg(feature, values(\"align\", \"const-extern-fn\", \"default\", \"extra_traits\", \"rustc-dep-of-std\", \"rustc-std-workspace-core\", \"std\", \"use_std\"))" "-C" "metadata=bfcae1bc36ffd5f3" "-C" "extra-filename=-bfcae1bc36ffd5f3" "--out-dir" "/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/build/libc-bfcae1bc36ffd5f3" "-L" "dependency=/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/deps" "--cap-lints" "allow" "-Z" "binary-dep-depinfo" "-Zunstable-options" "--check-cfg=cfg(bootstrap)"
-------------
error: could not compile `libc` (build script)

Caused by:
  process didn't exit successfully: `/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/bootstrap/debug/rustc /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/bootstrap/debug/rustc --crate-name build_script_build /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/vendor/libc/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="extra_traits"' --cfg 'feature="std"' -Zunstable-options --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C metadata=bfcae1bc36ffd5f3 -C extra-filename=-bfcae1bc36ffd5f3 --out-dir /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/build/libc-bfcae1bc36ffd5f3 -L dependency=/usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2-tools/release/deps --cap-lints allow -Z binary-dep-depinfo` (exit status: 254)
...
```

and the corresponding `gdb` session looks like it actually managed to pick the appropriate information out of the system:

```
armv7: {35} gdb work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/bin/rustc work/rustc-1.77.1-src/vendor/libc/rustc.core
GNU gdb (GDB) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "armv7--netbsdelf-eabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/bin/rustc...
(No debugging symbols found in work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/bin/rustc)
[New process 2]
[New process 1]
Core was generated by `rustc'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x6f9dcae0 in _RNvXs3_NtNtCs3kU7s5G7Zdo_12rustc_middle2ty3adtNtB5_10AdtDefDataINtNtCskL78Bf8MWqU_21rustc_data_structures13stable_hasher10HashStableNtNtNtCsdoQWj0sYDTv_18rustc_query_system3ich3hcx20StableHashingContextE11hash_stable ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
[Current thread is 1 (process 2)]
(gdb) where
#0  0x6f9dcae0 in _RNvXs3_NtNtCs3kU7s5G7Zdo_12rustc_middle2ty3adtNtB5_10AdtDefDataINtNtCskL78Bf8MWqU_21rustc_data_structures13stable_hasher10HashStableNtNtNtCsdoQWj0sYDTv_18rustc_query_system3ich3hcx20StableHashingContextE11hash_stable ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#1  0x6fb1b290 in _RNvXs4_NtCsdSRlzs8Ddzv_13rustc_type_ir7ty_infoINtB5_18WithCachedTypeInfoINtNtB7_7ty_kind6TyKindNtNtNtCs3kU7s5G7Zdo_12rustc_middle2ty7context6TyCtxtEEINtNtCskL78Bf8MWqU_21rustc_data_structures13stable_hasher10HashStableNtNtNtCsdoQWj0sYDTv_18rustc_query_system3ich3hcx20StableHashingContextE11hash_stableB1B_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#2  0x6f2dacc0 in _RNvXNtNtCs3kU7s5G7Zdo_12rustc_middle2ty8impls_tyRINtNtB4_4list4ListNtNtB4_12generic_args10GenericArgEINtNtCskL78Bf8MWqU_21rustc_data_structures13stable_hasher10HashStableNtNtNtCsdoQWj0sYDTv_18rustc_query_system3ich3hcx20StableHashingContextE11hash_stableCs7KzrBXWNv6h_21rustc_symbol_mangling ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#3  0x6f2bf850 in _RNvNtCs7KzrBXWNv6h_21rustc_symbol_mangling6legacy6mangle ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#4  0x6f2ed5c0 in _RNvCs7KzrBXWNv6h_21rustc_symbol_mangling20symbol_name_provider ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#5  0x6ea0542c in _RINvNtCs7RprckPEVMF_16rustc_query_impl8plumbing28___rust_begin_short_backtraceNCNCNvNtNtB4_10query_impl11symbol_name13dynamic_querys0_00INtNtNtCs3kU7s5G7Zdo_12rustc_middle5query5erase6ErasedAhj8_EEB4_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#6  0x6ea6ba20 in _RNvYNCNvNtNtCs7RprckPEVMF_16rustc_query_impl10query_impl11symbol_name13dynamic_querys0_0INtNtNtCs5pfNobr3ZU9_4core3ops8function6FnOnceTNtNtNtCs3kU7s5G7Zdo_12rustc_middle2ty7context6TyCtxtNtNtB2d_8instance8InstanceEE9call_onceBa_.llvm.15086006372759575508 ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#7  0x6ec59258 in _RINvNtNtCsdoQWj0sYDTv_18rustc_query_system5query8plumbing17try_execute_queryINtCs7RprckPEVMF_16rustc_query_impl13DynamicConfigINtNtB4_6caches12DefaultCacheNtNtNtCs3kU7s5G7Zdo_12rustc_middle2ty8instance8InstanceINtNtNtB2z_5query5erase6ErasedAhj8_EEKb0_KB3Y_KB3Y_ENtNtB1f_8plumbing9QueryCtxtKB3Y_EB1f_
    ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#8  0x6eb324cc in _RNvNtNtNtCs7RprckPEVMF_16rustc_query_impl10query_impl11symbol_name18get_query_non_incr26___rust_end_short_backtrace ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#9  0x6f9e171c in _RINvNtNtCs3kU7s5G7Zdo_12rustc_middle5query8plumbing12query_get_atINtNtNtCsdoQWj0sYDTv_18rustc_query_system5query6caches12DefaultCacheNtNtNtB6_2ty8instance8InstanceINtNtB4_5erase6ErasedAhj8_EEEB6_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#10 0x6f9d3bb4 in _RNvMNtNtCs3kU7s5G7Zdo_12rustc_middle3mir4monoNtB2_8MonoItem11symbol_name ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#11 0x6dd8c690 in _RNvXNtNtCs4Gc6o176Yf_5alloc3vec14spec_from_iterINtB4_3VecTRNtNtNtCs3kU7s5G7Zdo_12rustc_middle3mir4mono8MonoItemNtNtB11_2ty10SymbolNameEEINtB2_12SpecFromIterBT_INtNtNtNtCs5pfNobr3ZU9_4core4iter8adapters3map3MapINtNtNtNtCs7UFu2kmhlFP_3std11collections4hash3set4IterBV_ENCINvNtCs1TLur4eufjh_18rustc_monomorphize12partitioning27assert_symbols_are_distinctB3l_E0EE9from_iterB4o_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#12 0x6dd72954 in _RINvNtCs1TLur4eufjh_18rustc_monomorphize12partitioning27assert_symbols_are_distinctINtNtNtNtCs7UFu2kmhlFP_3std11collections4hash3set4IterNtNtNtCs3kU7s5G7Zdo_12rustc_middle3mir4mono8MonoItemEEB4_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#13 0x6dd82b88 in _RINvNtNtNtCskL78Bf8MWqU_21rustc_data_structures4sync8parallel8disabled4joinNCNCNvNtCs1TLur4eufjh_18rustc_monomorphize12partitioning32collect_and_partition_mono_items00NCB1d_s_0RSNtNtNtCs3kU7s5G7Zdo_12rustc_middle3mir4mono11CodegenUnituEB1j_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#14 0x6dd98690 in _RINvMNtCs2PjVAkr1vSw_13rustc_session5utilsNtNtB5_7session7Session4timeTRSNtNtNtCs3kU7s5G7Zdo_12rustc_middle3mir4mono11CodegenUnituENCNvNtCs1T--Type <RET> for more, q to quit, c to continue without paging-- 
Lur4eufjh_18rustc_monomorphize12partitioning32collect_and_partition_mono_items0EB2b_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#15 0x6dd72e64 in _RNvNtCs1TLur4eufjh_18rustc_monomorphize12partitioning32collect_and_partition_mono_items ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#16 0x6ea09a9c in _RINvNtCs7RprckPEVMF_16rustc_query_impl8plumbing28___rust_begin_short_backtraceNCNCNvNtNtB4_10query_impl32collect_and_partition_mono_items13dynamic_querys0_00INtNtNtCs3kU7s5G7Zdo_12rustc_middle5query5erase6ErasedAhjc_EEB4_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#17 0x6ea8d738 in _RNvYNCNvNtNtCs7RprckPEVMF_16rustc_query_impl10query_impl32collect_and_partition_mono_items13dynamic_querys0_0INtNtNtCs5pfNobr3ZU9_4core3ops8function6FnOnceTNtNtNtCs3kU7s5G7Zdo_12rustc_middle2ty7context6TyCtxtuEE9call_onceBa_.llvm.8358421460515107423 ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#18 0x6ec2042c in _RINvNtNtCsdoQWj0sYDTv_18rustc_query_system5query8plumbing17try_execute_queryINtCs7RprckPEVMF_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs3kU7s5G7Zdo_12rustc_middle5query5erase6ErasedAhjc_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtxtKB3s_EB1f_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#19 0x6eb49d04 in _RNvNtNtNtCs7RprckPEVMF_16rustc_query_impl10query_impl32collect_and_partition_mono_items18get_query_non_incr26___rust_end_short_backtrace ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#20 0x6b441e60 in _RINvNtCsaVq8gycyCBQ_17rustc_codegen_ssa4base13codegen_crateNtCs2lMMi7H5m3x_18rustc_codegen_llvm18LlvmCodegenBackendEBX_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#21 0x6b48bddc in _RNvXs5_Cs2lMMi7H5m3x_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCsaVq8gycyCBQ_17rustc_codegen_ssa6traits7backend14CodegenBackend13codegen_crate ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#22 0x6b2ffcb8 in _RINvMNtCs2PjVAkr1vSw_13rustc_session5utilsNtNtB5_7session7Session4timeINtNtCs4Gc6o176Yf_5alloc5boxed3BoxDNtNtCs5pfNobr3ZU9_4core3any3AnyEL_ENCNvNtCsflMcfF6XAXO_15rustc_interface6passes13start_codegen0EB2k_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#23 0x6b2e69e4 in _RNvNtCsflMcfF6XAXO_15rustc_interface6passes13start_codegen
    ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#24 0x6b33732c in _RINvMs7_NtNtCs3kU7s5G7Zdo_12rustc_middle2ty7contextNtB6_10GlobalCtxt5enterNCNvMs3_NtCsflMcfF6XAXO_15rustc_interface7queriesNtB1i_7Queries24codegen_and_build_linker0INtNtCs5pfNobr3ZU9_4core6result6ResultNtB1i_6LinkerNtCsP0Y3IzHQne_10rustc_span15ErrorGuaranteedEEB1k_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#25 0x6b318de4 in _RNvMs3_NtCsflMcfF6XAXO_15rustc_interface7queriesNtB5_7Queries24codegen_and_build_linker ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#26 0x6b123b3c in _RINvCsP0Y3IzHQne_10rustc_span14set_source_mapINtNtCs5pfNobr3ZU9_4core6result6ResultuNtB2_15ErrorGuaranteedENCNCINvNtCsflMcfF6XAXO_15rustc_interface9interface12run_compilerBH_NCNvCsiFCfUHeIUud_17rustc_driver_impl12run_compiler0E00EB2Q_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#27 0x6b14e088 in _RINvMs_CsdyPVYEdwfpq_10scoped_tlsINtB5_9ScopedKeyNtCsP0Y3IzHQne_10rustc_span14SessionGlobalsE3setNCINvNtCsflMcfF6XAXO_15rustc_interface9interface12run_compilerINtNtCs5pfNobr3ZU9_4core6result6ResultuNtBN_15ErrorGuaranteedENCNvCsiFCfUHeIUud_17rustc_driver_impl12run_compiler0E0B2x_EB3B_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#28 0x6b124208 in _RINvCsP0Y3IzHQne_10rustc_span27create_session_globals_thenINtNtCs5pfNobr3ZU9_4core6result6ResultuNtB2_15ErrorGuaranteedENCINvNtCsflMcfF6XAXO_15rustc_interface9interface12run_compilerBU_NCNvCsiFCfUHeIUud_17rustc_driver_impl12run_compiler0E0EB31_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
--Type <RET> for more, q to quit, c to continue without paging--
#29 0x6b13fad4 in _RINvNtNtCs7UFu2kmhlFP_3std10sys_common9backtrace28___rust_begin_short_backtraceNCNCINvNtCsflMcfF6XAXO_15rustc_interface4util26run_in_thread_with_globalsNCINvNtB1o_9interface12run_compilerINtNtCs5pfNobr3ZU9_4core6result6ResultuNtCsP0Y3IzHQne_10rustc_span15ErrorGuaranteedENCNvCsiFCfUHeIUud_17rustc_driver_impl12run_compiler0E0B2Z_E00B2Z_EB4p_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#30 0x6b1635e8 in _RNSNvYNCINvMNtCs7UFu2kmhlFP_3std6threadNtBa_7Builder16spawn_unchecked_NCNCINvNtCsflMcfF6XAXO_15rustc_interface4util26run_in_thread_with_globalsNCINvNtB1f_9interface12run_compilerINtNtCs5pfNobr3ZU9_4core6result6ResultuNtCsP0Y3IzHQne_10rustc_span15ErrorGuaranteedENCNvCsiFCfUHeIUud_17rustc_driver_impl12run_compiler0E0B2Q_E00B2Q_Es_0INtNtNtB2V_3ops8function6FnOnceuE9call_once6vtableB4g_ ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/librustc_driver-92fca06d07ba3c06.so
#31 0x6a9a39cc in std::sys::pal::unix::thread::Thread::new::thread_start ()
   from /usr/pkgsrc/wip/rust177/work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/libstd-fc5163e045403682.so
#32 0x6a53c0a4 in ?? () from /usr/lib/libpthread.so.1
#33 0x6a8d8874 in __mknod50 () from /usr/lib/libc.so.12
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) i regi
r0             0x6a384010          1782071312
r1             0x0                 0
r2             0x80808080          2155905152
r3             0x0                 0
r4             0x33858274          864387700
r5             0x0                 0
r6             0x69ff0664          1778320996
r7             0x0                 0
r8             0x69ff03c0          1778320320
r9             0x0                 0
r10            0x69ff04b0          1778320560
r11            0x0                 0
r12            0xfefefeff          4278124287
sp             0x69ff0220          0x69ff0220
lr             0x19191919          421075225
pc             0x6f9dcae0          0x6f9dcae0 <_RNvXs3_NtNtCs3kU7s5G7Zdo_12rustc_middle2ty3adtNtB5_10AdtDefDataINtNtCskL78Bf8MWqU_21rustc_data_structures13stable_hasher10HashStableNtNtNtCsdoQWj0sYDTv_18rustc_query_system3ich3hcx20StableHashingContextE11hash_stable+240>
cpsr           0x60080010          1611137040
(gdb) x/i 0x6f9dcae0
=> 0x6f9dcae0 <_RNvXs3_NtNtCs3kU7s5G7Zdo_12rustc_middle2ty3adtNtB5_10AdtDefDataINtNtCskL78Bf8MWqU_21rustc_data_structures13stable_hasher10HashStableNtNtNtCsdoQWj0sYDTv_18rustc_query_system3ich3hcx20StableHashingContextE11hash_stable+240>:      ldr     r10, [r7, r3]
(gdb) 
```

So ... this looks at least on the surface of it like a "boring" NULL pointer de-reference.

However, I am also having issues building rust 1.71.1 natively on arm64 (not yet reported), and on that platform a stack overflow is flagged, so I wonder if this could be the same problem.  The stack in the above backtrace is kind of long...

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
armv7: {14} env LD_LIBRARY_PATH=work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/lib/ tcsh
armv7: {1} work/rustc-1.77.1-src/build/armv7-unknown-netbsd-eabihf/stage2/bin/rustc --version
rustc 1.77.1 (7cf61ebde 2024-03-27) (built from a source tarball)
armv7: {2} 
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary>Backtrace</summary>
<p>

See above.

</p>
</details>