Skip to content

rustc-1.88.0 does not build using external LLVM due to missing rust-lld #143076

Open

Description

@debohman

When building using an external LLVM, the build fails due to a missing rust-lld even when lld is present in path.

Summary

Here is the end of the build log:

Dist rust-docs-1.88.0-x86_64-apple-darwin
	finished in 27.638 seconds
Installing stage2 docs (x86_64-apple-darwin)
install: creating uninstall script at /tmp/dst.rustc/usr/local/lib/rustlib/uninstall.sh
install: installing component 'rust-docs'

    rust docs installed.

Dist rust-std-1.88.0-x86_64-apple-darwin
	finished in 0.442 seconds
Installing stage2 std (x86_64-apple-darwin)
install: creating uninstall script at /tmp/dst.rustc/usr/local/lib/rustlib/uninstall.sh
install: installing component 'rust-std-x86_64-apple-darwin'

    rust std installed.


thread 'main' panicked at src/bootstrap/src/lib.rs:1779:24:
src.symlink_metadata() failed with No such file or directory (os error 2) ("src = /tera/tera/debo/Projects/rustc/rustc-1.88.0-src/build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/bin/rust-lld")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Panic was initiated from src/bootstrap/src/lib.rs:1779:24
Build completed unsuccessfully in 0:26:40

Command used

DESTDIR=/tmp/dst.rustc x.py install

Note the error from bootstrap in the log:

Warning: LLD is enabled when using external llvm-config. LLD will not be built and copied to the sysroot.

Expected behaviour

I expected it to build.

Actual behaviour

Failed to build. See above log snippet. Entire log is attached.

rustc-1.88-log.txt

Bootstrap configuration (bootstrap.toml)

I am using a system LLVM llvm-20.1.7:

llvm-config = "/usr/local/bin/llvm-config"

Operating system

macOS 10.12.6

HEAD

6b00bc3880198600130e1cf62b8f8a93494488cc

Activity

  1. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    C-bugCategory: This is a bug.
    on Jun 27, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 27, 2025
  3. debohman commented on Jun 27, 2025

    @debohman
    Author

    I was able to successfully complete the build by doing the following:

    Copy ldd to build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/bin/rust-lld

    Create a directory build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/bin/gcc-ld

    Inside that directory, hardlink ld.lld, ld64.lld, lld-link, wasm-ld to rust-lld

    The question is: If the build requires it, then why isn't the stage2 directory correctly populated?

  4. debohman commented on Jun 27, 2025

    @debohman
    Author

    Note that I also worked around the issue in #139400.

  5. jpalus commented on Jun 27, 2025

    @jpalus

    Note: issue is not Darwin specific, I see the same on Linux using system installed llvm.

  6. jpalus commented on Jun 27, 2025

    @jpalus

    In case it's useful here's full backtrace:

    backtrace
    thread 'main' panicked at src/bootstrap/src/lib.rs:1779:24:
    src.symlink_metadata() failed with No such file or directory (os error 2) ("src = /home/users/builder/rpm/BUILD/rust-1.88.0-build/rustc-1.88.0-src/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/bin/rust-lld")
    stack backtrace:
       0:     0xaaaab09917c8 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h887f38dba00b5b2a
       1:     0xaaaab09af59c - core::fmt::write::h2a34afd9df67012f
       2:     0xaaaab095d420 - std::io::Write::write_fmt::hffb2973b22859382
       3:     0xaaaab09916c4 - std::sys::backtrace::BacktraceLock::print::h9625458d31d2622b
       4:     0xaaaab0995c4c - std::panicking::default_hook::{{closure}}::h6a1a2410bed9bb2f
       5:     0xaaaab0995b44 - std::panicking::default_hook::h2781aa184b70a849
       6:     0xaaaab099618c - std::panicking::rust_panic_with_hook::h6924c0fb82d17bc5
       7:     0xaaaab0991bd4 - std::panicking::begin_panic_handler::{{closure}}::hdebafdaae531983f
       8:     0xaaaab0991a1c - std::sys::backtrace::__rust_end_short_backtrace::h9fd1b6471baf08f9
       9:     0xaaaab0995ce8 - __rustc[aaf4a02f2f9ab86b]::rust_begin_unwind
      10:     0xaaaaaff559b4 - core::panicking::panic_fmt::h60a77bb2c5cb27f3
      11:     0xaaaab01c5300 - bootstrap::Build::copy_link_internal::hdbdbd10eaa6bb9af
      12:     0xaaaab01c456c - bootstrap::Build::copy_link::h4d03dd04aad54a94
      13:     0xaaaab0200344 - <bootstrap::core::build_steps::dist::Rustc as bootstrap::core::builder::Step>::run::prepare_image::he9cfea7987feaea1
      14:     0xaaaab01ff6c4 - <bootstrap::core::build_steps::dist::Rustc as bootstrap::core::builder::Step>::run::h3031a9df80cf4512
      15:     0xaaaab00ce164 - bootstrap::core::builder::Builder::ensure::h85cf508fac3dfa57
      16:     0xaaaab01ff5b0 - <bootstrap::core::build_steps::dist::Rustc as bootstrap::core::builder::Step>::make_run::hd7eef2b4e3696bb5
      17:     0xaaaab04c3a34 - bootstrap::core::builder::StepDescription::maybe_run::h96f8253d4fbf8942
      18:     0xaaaab04c4658 - bootstrap::core::builder::StepDescription::run::h1d8ef1312383bc01
      19:     0xaaaab04c951c - bootstrap::core::builder::Builder::run_step_descriptions::hc5e4488356b98424
      20:     0xaaaab04c92dc - bootstrap::core::builder::Builder::execute_cli::hb6e5e1cdc3baf344
      21:     0xaaaab01be984 - bootstrap::Build::build::h046ecdaff4a19fca
      22:     0xaaaaaff5a530 - bootstrap::main::h06cef34dae0473b8
      23:     0xaaaaaff5d1b0 - core::ops::function::FnOnce::call_once::hf1a679c885cbfb5c
      24:     0xaaaaaff5ce58 - std::sys::backtrace::__rust_begin_short_backtrace::h28d569c780c0ed5d
      25:     0xaaaaaff5c0ec - std::rt::lang_start::{{closure}}::h4e3747e7ac742d62
      26:     0xaaaab0997ba4 - std::rt::lang_start_internal::h8706a62a5edce61c
      27:     0xaaaaaff5c0d4 - std::rt::lang_start::h4b13ebde88700676
      28:     0xaaaaaff5bab8 - main
      29:     0xffff969d2218 - <unknown>
      30:     0xffff969d22f4 - __libc_start_main
      31:     0xaaaaaff560f0 - _start
  7. changed the title [-]rustc-1.88.0 does not build on Darwin due missing rust-lld[/-] [+]rustc-1.88.0 does not build using external LLVM due to missing rust-lld[/+] on Jun 27, 2025
  8. jpalus commented on Jun 28, 2025

    @jpalus

    #139853 might possibly be related (cc @Kobzol)

  9. added a commit that references this issue on Jun 29, 2025
  10. Kobzol commented on Jun 29, 2025

    @Kobzol
    Member

    Thanks for the report, this is indeed a bootstrap bug. I'll try fixing it in #143175.

  11. Kobzol commented on Jun 30, 2025

    @Kobzol
    Member

    #143175 will solve this for the future. For 1.88.0, please set rust.lld = false in bootstrap.toml.

  12. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 30, 2025
  13. jpalus commented on Jun 30, 2025

    @jpalus

    @Kobzol I'm not sure if i follow linked PR but I suppose rust.lld = false will be required in later releases too, is that correct? If yes would it be possible to change rust.lld default to !system_llvm?

  14. added a commit that references this issue on Jun 30, 2025
  15. Kobzol commented on Jun 30, 2025

    @Kobzol
    Member

    Oh, good point, I didn't realize it's in fact enabled by default in dist. I'll change the default as you said.

  16. Kobzol commented on Jun 30, 2025

    @Kobzol
    Member

    #143255 should resolve the default.

  17. added 2 commits that reference this issue on Jun 30, 2025
  18. added a commit that references this issue on Jul 1, 2025
  19. added a commit that references this issue on Jul 1, 2025
  20. added a commit that references this issue on Jul 1, 2025
  21. added a commit that references this issue on Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions