Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch the linker to LLD #10

Closed
pietroalbini opened this issue Aug 10, 2023 · 4 comments
Closed

Switch the linker to LLD #10

pietroalbini opened this issue Aug 10, 2023 · 4 comments
Assignees

Comments

@pietroalbini
Copy link
Member

Right now, all targets require the use of GCC 7.5.x as the linker, which is suboptimal for everyone not using Ubuntu 18.04 LTS. This was done because we need to test the exact linker version customers will use for qualification, and we had to pick one.

The solution we should move towards is using the LLD bundled with Ferrocene as the linker. This means updating the target specs, updating the self-testing tool to check for the right linker, and updating the target documentation.

For bare metal targets, this is as simple as changing the linker, as LLD can work with them by default (and that's actually upstream's behavior, we had to override it). Then the self-test tool can be updated to verify the presence of LLD (the code should already be there, just an enum change should be needed).

For Linux targets though we cannot invoke LLD directly, as LLD does not know where the system libraries are located. Thus, we need to use the system GCC or clang as the default linker, passing -fuse-ld=lld to it. That flag seems to work from GCC 9 onwards. This requires wider changes:

  • Change the target spec to always use LLD.
  • Change the self-testing tool to check for the presence of LLD, and the system linker (either gcc or clang).
  • Add a new check in the self-test tool, that when compiling something, GCC or clang end up invoking LLD with the correct flags. This can be implemented by creating a fake LLD binary that checks the flags are correct: GCC/clang can then be invoked with some flags pointing to the fake LLD, which will error out if the flags are not passed through and the system flags are not present.
  • In the safety manual, add a requirement for how GCC/clang should behave, and mention the self-test tool performs that check automatically.
@jonathanpallant
Copy link
Contributor

Only GCC 9 and higher support -fuse-ld=ld.lld. However all this argument does is make GCC call ld.lld in your $PATH instead of ld - it makes no difference to the arguments.

So we could just rename ld.lld to ld and ensure it appears in the $PATH before the real GNU ld.

I also note that GCC and clang have a -B<prefix> argument which controls where it looks for tools it shells out to. That might be easier than trying to rig the $PATH so that our special ld appears first. Needs some testing though.

Note that you can test whether a binary was linked with ld or ld.lld, because ld produces a 14 byte Build ID and ld.lld produces an 8 byte Build ID.

Also note that ld.lld is a wrapper that calls ../rust-lld (i.e. one directory level above where ld.lld is), passing on all arguments but also adding -flavour=gnu so that rust-lld knows it should pretend to be a GNU linker (as opposed to a Windows linker, or a macOS linker, or a WASM linker).

@pietroalbini pietroalbini transferred this issue from another repository Oct 3, 2023
@jonathanpallant
Copy link
Contributor

Completed in #100, however we still need to update the documentation (#106) and the self-test program (#107)

@pietroalbini
Copy link
Member Author

Let's track them separately, and close this issue.

@jonathanpallant
Copy link
Contributor

Also, I want to clarify here some changes to our thinking. Rather than try and produce a binary called ld (which runs the risk of clashing with the system provided ld), we instead decided to check if the system supplied C compiler supports -fuse-ld=lld and if not, check to see if a suitable clang was installed. Clang is available on Ubuntu 18.04, and also knows where the system libraries live, so works as a system C compiler for our purposes.

You can also verify which linker produced any given ELF file by running:

$ readelf --string-dump .comment /path/to/elf
String dump of section '.comment':
  [     1]  rustc version 1.75.0-dev
  [    1a]  Linker: LLD 17.0.4

bors-ferrocene bot added a commit that referenced this issue Nov 21, 2023
133: Draft: Update target docs. r=pietroalbini a=jonathanpallant

Updates the docs for `aarch64-unknown-none` and `x86_64-unknown-linux-gnu` to reflect our new choices around which linker we use (see #10)

Co-authored-by: Jonathan Pallant (Ferrous Systems) <jonathan.pallant@ferrous-systems.com>
github-actions bot pushed a commit that referenced this issue Dec 6, 2023
Change prefetch to avoid deadlock

Was abled to reproduce the deadlock in #118205 and created a coredump when it happen. When looking at the backtraces  I noticed that the prefetch of exported_symbols (Thread 17 frame 4) started after the "actual" exported_symbols (Thread 2 frame 18) but it also is working on some of the collect_crate_mono_items (Thread 17 frame12 ) that Thread 2 is blocked on resulting in a deadlock.

This PR results in less parallell work that can be done at the same time but from what I can find we do not call the query exported_symbols from multiple places in the same join call any more.

```
Thread 17 (Thread 0x7f87b6299700 (LWP 11370)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f87be5166a9 in <parking_lot::condvar::Condvar>::wait_until_internal () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#2  0x00007f87be12d854 in <rustc_query_system::query::job::QueryLatch>::wait_on () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#3  0x00007f87bd27d16f in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::CrateNum, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#4  0x00007f87bd0b5b6a in rustc_query_impl::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#5  0x00007f87bdaebb0a in rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#1} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#6  0x00007f87bdae1509 in rayon_core::join::join_context::call_b::<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#1}, (), &[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>::{closure#0}::{closure#1}>::{closure#0}>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#7  0x00007f87bdae32ff in <rayon_core::job::StackJob<rayon_core::latch::SpinLatch, rayon_core::join::join_context::call_b<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}::{closure#1}, (), &[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>::{closure#0}::{closure#1}>::{closure#0}>::{closure#0}, core::option::Option<rustc_data_structures::marker::FromDyn<&[(rustc_middle::middle::exported_symbols::ExportedSymbol, rustc_middle::middle::exported_symbols::SymbolExportInfo)]>>> as rayon_core::job::Job>::execute () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#8  0x00007f87b8338823 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#9  0x00007f87bc2edbaf in rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#10 0x00007f87bc2ed313 in rayon_core::registry::in_worker::<rayon_core::join::join_context<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0}, ((), ())> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#11 0x00007f87bc2db2a4 in rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#12 0x00007f87bc2eead2 in <rayon_core::job::StackJob<rayon_core::latch::SpinLatch, rayon_core::join::join_context::call_b<(), rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}>::{closure#0}, ()> as rayon_core::job::Job>::execute () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#13 0x00007f87b8338823 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#14 0x00007f87be52d1f9 in <rayon_core::registry::ThreadBuilder>::run () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#15 0x00007f87b8461c57 in <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}, ()> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#16 0x00007f87b846e465 in rustc_span::set_session_globals_then::<(), rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#17 0x00007f87b844f282 in <<crossbeam_utils::thread::ScopedThreadBuilder>::spawn<<rayon_core::ThreadPoolBuilder>::build_scoped<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#18 0x00007f87b846af58 in <<std::thread::Builder>::spawn_unchecked_<alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output = ()> + core::marker::Send>, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#19 0x00007f87b7898e85 in std::sys::unix::thread::Thread::new::thread_start () from /home/andjo403/.rustup/toolchains/stage1/lib/libstd-d570b0650d35d951.so
#20 0x00007f87b7615609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x00007f87b7755133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f87b729b700 (LWP 11368)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f87b7887b51 in std::sys::unix::locks::futex_condvar::Condvar::wait () from /home/andjo403/.rustup/toolchains/stage1/lib/libstd-d570b0650d35d951.so
#2  0x00007f87b8339478 in <rayon_core::sleep::Sleep>::sleep () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#3  0x00007f87b83387c3 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#4  0x00007f87bc2edbaf in rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#5  0x00007f87bc2ed313 in rayon_core::registry::in_worker::<rayon_core::join::join_context<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::vec::DrainProducer<rustc_middle::mir::mono::MonoItem>, rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0}, ((), ())> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#6  0x00007f87bc2db50c in <rayon::vec::IntoIter<rustc_middle::mir::mono::MonoItem> as rayon::iter::ParallelIterator>::for_each::<rustc_data_structures::sync::parallel::enabled::par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#7  0x00007f87bc2e8cd7 in <rustc_session::session::Session>::time::<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#8  0x00007f87bc2b8f2c in rustc_monomorphize::collector::collect_crate_mono_items () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#9  0x00007f87bc2c30d9 in rustc_monomorphize::partitioning::collect_and_partition_mono_items () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#10 0x00007f87bcf2cde6 in rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#11 0x00007f87bd156a3c in <rustc_query_impl::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#12 0x00007f87bd1c6a7d in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#13 0x00007f87bd15df40 in rustc_query_impl::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#14 0x00007f87bd7a0ad9 in rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#15 0x00007f87bcf29acb in rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::exported_symbols::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#16 0x00007f87bcfdb350 in <rustc_query_impl::query_impl::exported_symbols::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::CrateNum)>>::call_once () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#17 0x00007f87bd27d64f in rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::CrateNum, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#18 0x00007f87bd0b5b6a in rustc_query_impl::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#19 0x00007f87bda927ce in rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::VecCache<rustc_span::def_id::CrateNum, rustc_middle::query::erase::Erased<[u8; 16]>>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#20 0x00007f87bda9c93f in <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#21 0x00007f87bdaa6ef7 in rustc_metadata::rmeta::encoder::encode_metadata_impl () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#22 0x00007f87bdae0b77 in rayon_core::join::join_context::<rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#0}>::{closure#0}, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#1}>::{closure#0}, core::option::Option<rustc_data_structures::marker::FromDyn<()>>, core::option::Option<rustc_data_structures::marker::FromDyn<()>>>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#23 0x00007f87bdaded2f in rayon_core::registry::in_worker::<rayon_core::join::join_context<rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#0}>::{closure#0}, rayon_core::join::join::call<core::option::Option<rustc_data_structures::marker::FromDyn<()>>, rustc_data_structures::sync::parallel::enabled::join<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>::{closure#0}::{closure#1}>::{closure#0}, core::option::Option<rustc_data_structures::marker::FromDyn<()>>, core::option::Option<rustc_data_structures::marker::FromDyn<()>>>::{closure#0}, (core::option::Option<rustc_data_structures::marker::FromDyn<()>>, core::option::Option<rustc_data_structures::marker::FromDyn<()>>)> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#24 0x00007f87bdaa5a03 in rustc_metadata::rmeta::encoder::encode_metadata () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#25 0x00007f87bdaed628 in rustc_metadata::fs::encode_and_write_metadata () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#26 0x00007f87b86608be in rustc_interface::passes::start_codegen () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#27 0x00007f87b8664946 in <rustc_middle::ty::context::GlobalCtxt>::enter::<<rustc_interface::queries::Queries>::codegen_and_build_linker::{closure#0}, core::result::Result<rustc_interface::queries::Linker, rustc_span::ErrorGuaranteed>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#28 0x00007f87b864db00 in <rustc_interface::queries::Queries>::codegen_and_build_linker () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#29 0x00007f87b849400f in <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#0}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#30 0x00007f87b846e067 in rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#31 0x00007f87b844dc13 in <rayon_core::thread_pool::ThreadPool>::install::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#32 0x00007f87b84509a1 in <rayon_core::job::StackJob<rayon_core::latch::LatchRef<rayon_core::latch::LockLatch>, <rayon_core::registry::Registry>::in_worker_cold<<rayon_core::thread_pool::ThreadPool>::install<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>> as rayon_core::job::Job>::execute () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#33 0x00007f87b8338823 in <rayon_core::registry::WorkerThread>::wait_until_cold () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#34 0x00007f87be52d1f9 in <rayon_core::registry::ThreadBuilder>::run () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#35 0x00007f87b8461c57 in <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}, ()> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#36 0x00007f87b846e465 in rustc_span::set_session_globals_then::<(), rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}> () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#37 0x00007f87b844f282 in <<crossbeam_utils::thread::ScopedThreadBuilder>::spawn<<rayon_core::ThreadPoolBuilder>::build_scoped<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#38 0x00007f87b846af58 in <<std::thread::Builder>::spawn_unchecked_<alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output = ()> + core::marker::Send>, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/andjo403/.rustup/toolchains/stage1/lib/librustc_driver-70ddb84e8f7ce707.so
#39 0x00007f87b7898e85 in std::sys::unix::thread::Thread::new::thread_start () from /home/andjo403/.rustup/toolchains/stage1/lib/libstd-d570b0650d35d951.so
#40 0x00007f87b7615609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#41 0x00007f87b7755133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

```

fixes #118205
fixes #117759 from the latest logs it is the same query map as in #118205
fixes #118529
fixes #117784
cc #118206

r? `@SparrowLii`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants