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

Introduce -Zsplit-metadata to split metadata out of rlibs/dylibs #137535

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Feb 24, 2025

This is a continuation of #120855 (I was mentored by @bjorn3 to move it forward). Most of the original code was written by bjorn3, I tried to clean it up a bit and add some documentation and tests.

This PR introduces a new unstable compiler flag called -Zsplit-metadata (see #57076 for context). When used, rustc will only store a small metadata stub inside rlibs/dylibs instead of the full metadata, to keep their size smaller. It should be used in combination with --emit=metadata, so that the users of such a compiled library can still read the metadata from the corresponding .rmeta file. This comment shows an example of binary/artifact size wins that can be achieved using this approach.

Contrary to #120855, this PR only introduces the new flag, along with a couple of run-make tests and documentation, but does not yet use it in bootstrap to actually compile rustc. I plan to do that as a follow-up step (along with integration in Cargo, which should ideally just always pass this flag to reduce the size of target directories).

There is one unresolved thing that I wanted to discuss with the reviewer(s) first, and one smaller nit.

Lookup of .rmeta files

With -Zsplit-metadata, when rustc tries to link against a rlib/dylib that only has the stub metadata, it needs to be able to find the corresponding .rmeta file somehow. Currently, there are two codepaths taken in rustc regarding this dependency lookup:

  • If you don't specify --extern, the usual list of possible dependency locations is searched (including -L). The compiler already does this and finds the corresponding .rmeta files. This already works out of the box also with -Zsplit-metadata in this PR.

  • If you do specify --extern, the step above is skipped, and the --extern paths are searched instead. This is not fully supported yet in this PR. What we do now is add a simple heuristic that tries to add a .rmeta file path located in the same directory as the corresponding rlib/dylib file to the search paths. This will probably work for the majority of use-cases, but is not a fully general solution. If the .rmeta file is not found at this location, we should probably invoke the general library search path lookup linked above. However, the locator code is currently structured in a way where this is not completely trivial. So I wanted to ask which approach do you consider to be better:

    • First run find_commandline_library, and store the information whether we only found a stub or not. Then, if we only found a stub, but no .rmeta file, invoke find_library_crate to try to find a corresponding .rmeta file, and use it instead (if found).
    • Refactor the crate locating logic so that find_commandline_library is not exclusive with find_library_crate, so that the library search paths and the --extern paths are first combined together (with --extern probably taking priority), and only then is the final SVH/metadata lookup performed. This would pretty much make this work also with split metadata. I found it quite surprising that when --extern is passed, the -L search logic is completely skipped, so this also looks like a nice cleanup. I'm not sure if it wouldn't have some unexpected behavior change though.

Note that currently it is not possible to pass a full path to the corresponding .rmeta file explicitly, outside of using -L, but I don't think that it should be needed. In theory, we could also literally store the (relative) path to the .rmeta file on disk in the stub metadata header, but that's probably also not ideal, because the .rmeta/rlib/dylib file could move independently of one another.

Interaction with --emit=metadata

Currently, if the user does not use --emit=metadata with -Zsplit-metadata, no metadata will be emitted (there will be no .rmeta file, and the rlib/dylib will only contain a stub). This is most likely a usage error, but in theory it could be a valid use-case (same as we e.g. allow --emit=metadata for binaries, which just produces an empty .rmeta file without any warning). As an alternative, we could emit a warning/error about this, or automatically fill in --emit=metadata when -Zsplit-metadata is used if no --emit flag was specified.

Fixes #23366
Closes #29511
Fixes #57076

Another attempt of #93945 and #120855.

r? @petrochenkov

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 24, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#21 exporting to docker image format
#21 sending tarball 29.7s done
#21 DONE 35.9s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
  Downloaded boml v0.3.1
   Compiling boml v0.3.1
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
    Finished `release` profile [optimized] target(s) in 4.31s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
Using system GCC
warning: target feature `x87` must be enabled to ensure that the ABI of the current target can be implemented correctly
  |
  = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>
---
---- [run-make] tests/run-make/split-metadata stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/split-metadata/rmake_out" && env -u RUSTFLAGS AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/cargo" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/usr/lib/llvm-18/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen codegentypes core coroutines coverage debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi textapibinaryreader transformutils ve veasmparser vecodegen vectorize vedesc vedisassembler veinfo webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/usr/lib/llvm-18/bin/FileCheck" NODE="/usr/bin/node" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" TARGET_RPATH_ENV="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/split-metadata/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/split-metadata/rmake"
--- stderr -------------------------------
Testing library kind Rlib
command failed at line 43
command failed at line 43
Command { cmd: LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/split-metadata/temporary-directory:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/split-metadata/temporary-directory" "foo.rs", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc", defused: true, armed_location: Location { file: "/checkout/tests/run-make/split-metadata/rmake.rs", line: 43, col: 9 } }, already_executed: true }
output status: `exit status: 101`
=== STDOUT ===


=== STDERR ===

---
   8:     0x7f4fa806af1b - std[1b36a9b3e2321cd0]::panicking::begin_panic_handler::{closure#0}
   9:     0x7f4fa80681a9 - std[1b36a9b3e2321cd0]::sys::backtrace::__rust_end_short_backtrace::<std[1b36a9b3e2321cd0]::panicking::begin_panic_handler::{closure#0}, !>
  10:     0x7f4fa806ab35 - rust_begin_unwind
  11:     0x7f4fa3eed532 - core[87d8de562df86e0e]::panicking::panic_fmt
  12:     0x7f4fa3ee9e46 - <rustc_serialize[2a0ca79c5c179d6e]::opaque::MemDecoder>::decoder_exhausted
  13:     0x7f4fa71d18b7 - rustc_serialize[2a0ca79c5c179d6e]::leb128::read_usize_leb128
  14:     0x7f4fa71d3323 - <rustc_metadata[ea0efcbd17c2d30a]::rmeta::decoder::DecodeContext as rustc_serialize[2a0ca79c5c179d6e]::serialize::Decoder>::read_str
  15:     0x7f4fa71d61cd - <rustc_metadata[ea0efcbd17c2d30a]::rmeta::CrateRoot as rustc_serialize[2a0ca79c5c179d6e]::serialize::Decodable<rustc_metadata[ea0efcbd17c2d30a]::rmeta::decoder::DecodeContext>>::decode
  16:     0x7f4fa72158f6 - <rustc_metadata[ea0efcbd17c2d30a]::rmeta::decoder::MetadataBlob>::get_root
  17:     0x7f4fa7155fd1 - <rustc_metadata[ea0efcbd17c2d30a]::creader::CrateLoader>::load
  18:     0x7f4fa7150d16 - <rustc_metadata[ea0efcbd17c2d30a]::creader::CrateLoader>::maybe_resolve_crate
  19:     0x7f4fa714f5c7 - <rustc_metadata[ea0efcbd17c2d30a]::creader::CrateLoader>::resolve_crate
  20:     0x7f4fa7159d60 - <rustc_metadata[ea0efcbd17c2d30a]::creader::CrateLoader>::process_extern_crate
  21:     0x7f4fa5d19a38 - <rustc_resolve[7cc96f8fc6cdbab8]::Resolver>::crate_loader::<core[87d8de562df86e0e]::option::Option<rustc_span[dc91d7b7a49d219c]::def_id::CrateNum>, <rustc_resolve[7cc96f8fc6cdbab8]::build_reduced_graph::BuildReducedGraphVisitor>::build_reduced_graph_for_extern_crate::{closure#0}>
  22:     0x7f4fa5e40a0d - <rustc_resolve[7cc96f8fc6cdbab8]::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast[a500c1de1b33acbb]::visit::Visitor>::visit_item
  23:     0x7f4fa5e43bce - <rustc_resolve[7cc96f8fc6cdbab8]::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast[a500c1de1b33acbb]::visit::Visitor>::visit_crate
  24:     0x7f4fa5d06e55 - <rustc_resolve[7cc96f8fc6cdbab8]::Resolver as rustc_expand[ecf4876e26faa4ee]::base::ResolverExpand>::visit_ast_fragment_with_placeholders
  25:     0x7f4fa7311704 - <rustc_expand[ecf4876e26faa4ee]::expand::MacroExpander>::collect_invocations
  26:     0x7f4fa730b3ce - <rustc_expand[ecf4876e26faa4ee]::expand::MacroExpander>::fully_expand_fragment
  27:     0x7f4fa730afd2 - <rustc_expand[ecf4876e26faa4ee]::expand::MacroExpander>::expand_crate
  28:     0x7f4fa42da009 - <rustc_session[abf0c519ca9e2e2b]::session::Session>::time::<rustc_ast[a500c1de1b33acbb]::ast::Crate, rustc_interface[e3342892a47d9ab8]::passes::configure_and_expand::{closure#1}>
  29:     0x7f4fa41cf2b1 - rustc_interface[e3342892a47d9ab8]::passes::resolver_for_lowering_raw
  30:     0x7f4fa6441ef8 - rustc_query_impl[2a9e3d5c3a9147ad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2a9e3d5c3a9147ad]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[b8f1cd3a173958f4]::query::erase::Erased<[u8; 16usize]>>
  31:     0x7f4fa63acc09 - <rustc_query_impl[2a9e3d5c3a9147ad]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[87d8de562df86e0e]::ops::function::FnOnce<(rustc_middle[b8f1cd3a173958f4]::ty::context::TyCtxt, ())>>::call_once
  32:     0x7f4fa63392b8 - <std[1b36a9b3e2321cd0]::thread::local::LocalKey<core[87d8de562df86e0e]::cell::Cell<*const ()>>>::with::<rustc_middle[b8f1cd3a173958f4]::ty::context::tls::enter_context<rustc_query_system[86acc13612db55b]::query::plumbing::execute_job_non_incr<rustc_query_impl[2a9e3d5c3a9147ad]::DynamicConfig<rustc_query_system[86acc13612db55b]::query::caches::SingleCache<rustc_middle[b8f1cd3a173958f4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[2a9e3d5c3a9147ad]::plumbing::QueryCtxt>::{closure#0}, rustc_middle[b8f1cd3a173958f4]::query::erase::Erased<[u8; 16usize]>>::{closure#0}, rustc_middle[b8f1cd3a173958f4]::query::erase::Erased<[u8; 16usize]>>
  33:     0x7f4fa626def1 - rustc_query_system[86acc13612db55b]::query::plumbing::try_execute_query::<rustc_query_impl[2a9e3d5c3a9147ad]::DynamicConfig<rustc_query_system[86acc13612db55b]::query::caches::SingleCache<rustc_middle[b8f1cd3a173958f4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[2a9e3d5c3a9147ad]::plumbing::QueryCtxt, false>
  34:     0x7f4fa6604cec - rustc_query_impl[2a9e3d5c3a9147ad]::query_impl::resolver_for_lowering_raw::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7f4fa77e8147 - <rustc_middle[b8f1cd3a173958f4]::ty::context::TyCtxt>::resolver_for_lowering
  36:     0x7f4fa3ff91eb - <std[1b36a9b3e2321cd0]::thread::local::LocalKey<core[87d8de562df86e0e]::cell::Cell<*const ()>>>::with::<rustc_middle[b8f1cd3a173958f4]::ty::context::tls::enter_context<<rustc_middle[b8f1cd3a173958f4]::ty::context::GlobalCtxt>::enter<rustc_interface[e3342892a47d9ab8]::passes::create_and_enter_global_ctxt<core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>>::{closure#1}, core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>>::{closure#0}, core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>>
  37:     0x7f4fa3f8edc0 - <rustc_middle[b8f1cd3a173958f4]::ty::context::TyCtxt>::create_global_ctxt::<core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>, rustc_interface[e3342892a47d9ab8]::passes::create_and_enter_global_ctxt<core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  38:     0x7f4fa3f8cf14 - <rustc_interface[e3342892a47d9ab8]::passes::create_and_enter_global_ctxt<core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[87d8de562df86e0e]::ops::function::FnOnce<(&rustc_session[abf0c519ca9e2e2b]::session::Session, rustc_middle[b8f1cd3a173958f4]::ty::context::CurrentGcx, &std[1b36a9b3e2321cd0]::sync::once_lock::OnceLock<rustc_middle[b8f1cd3a173958f4]::ty::context::GlobalCtxt>, &rustc_data_structures[a66926230b4ccfed]::sync::worker_local::WorkerLocal<rustc_middle[b8f1cd3a173958f4]::arena::Arena>, &rustc_data_structures[a66926230b4ccfed]::sync::worker_local::WorkerLocal<rustc_hir[44d5bee511119f4]::Arena>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  39:     0x7f4fa3fd455b - <alloc[b0929b49c7791218]::boxed::Box<dyn for<'a> core[87d8de562df86e0e]::ops::function::FnOnce<(&'a rustc_session[abf0c519ca9e2e2b]::session::Session, rustc_middle[b8f1cd3a173958f4]::ty::context::CurrentGcx, &'a std[1b36a9b3e2321cd0]::sync::once_lock::OnceLock<rustc_middle[b8f1cd3a173958f4]::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures[a66926230b4ccfed]::sync::worker_local::WorkerLocal<rustc_middle[b8f1cd3a173958f4]::arena::Arena<'a>>, &'a rustc_data_structures[a66926230b4ccfed]::sync::worker_local::WorkerLocal<rustc_hir[44d5bee511119f4]::Arena<'a>>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2}), Output = core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>>> as core[87d8de562df86e0e]::ops::function::FnOnce<(&rustc_session[abf0c519ca9e2e2b]::session::Session, rustc_middle[b8f1cd3a173958f4]::ty::context::CurrentGcx, &std[1b36a9b3e2321cd0]::sync::once_lock::OnceLock<rustc_middle[b8f1cd3a173958f4]::ty::context::GlobalCtxt>, &rustc_data_structures[a66926230b4ccfed]::sync::worker_local::WorkerLocal<rustc_middle[b8f1cd3a173958f4]::arena::Arena>, &rustc_data_structures[a66926230b4ccfed]::sync::worker_local::WorkerLocal<rustc_hir[44d5bee511119f4]::Arena>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2})>>::call_once
  40:     0x7f4fa3f8b77d - rustc_interface[e3342892a47d9ab8]::passes::create_and_enter_global_ctxt::<core[87d8de562df86e0e]::option::Option<rustc_interface[e3342892a47d9ab8]::queries::Linker>, rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}::{closure#2}>
  41:     0x7f4fa3fbda34 - <scoped_tls[4c63abcec0c49958]::ScopedKey<rustc_span[dc91d7b7a49d219c]::SessionGlobals>>::set::<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_with_globals<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_pool_with_globals<rustc_interface[e3342892a47d9ab8]::interface::run_compiler<(), rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  42:     0x7f4fa3ff825c - rustc_span[dc91d7b7a49d219c]::create_session_globals_then::<(), rustc_interface[e3342892a47d9ab8]::util::run_in_thread_with_globals<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_pool_with_globals<rustc_interface[e3342892a47d9ab8]::interface::run_compiler<(), rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
  43:     0x7f4fa3f648d1 - std[1b36a9b3e2321cd0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_with_globals<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_pool_with_globals<rustc_interface[e3342892a47d9ab8]::interface::run_compiler<(), rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  44:     0x7f4fa3ff5c50 - <<std[1b36a9b3e2321cd0]::thread::Builder>::spawn_unchecked_<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_with_globals<rustc_interface[e3342892a47d9ab8]::util::run_in_thread_pool_with_globals<rustc_interface[e3342892a47d9ab8]::interface::run_compiler<(), rustc_driver_impl[1019500eb6a6c9a3]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[87d8de562df86e0e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7f4fa328aaa4 - <unknown>
  47:     0x7f4fa3317c3c - <unknown>
  48:                0x0 - <unknown>

@Kobzol
Copy link
Contributor Author

Kobzol commented Feb 24, 2025

(The test failure is the one situation not yet implemented, which is described in the PR description - --extern plus .rmeta in a different directory than the rlib/dylib).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
5 participants