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

Building with lld and download-ci-llvm #98340

Closed
SimonSapin opened this issue Jun 21, 2022 · 0 comments · Fixed by #104748
Closed

Building with lld and download-ci-llvm #98340

SimonSapin opened this issue Jun 21, 2022 · 0 comments · Fixed by #104748
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@SimonSapin
Copy link
Contributor

I order to try local patches on a cross-compiled project, I built with ./x.py build --target x86_64-unknown-linux-gnu,riscv32i-unknown-none-elf then, in my project set rust-toolchain.toml to path = "/home/simon/projects/rust/build/x86_64-unknown-linux-gnu/stage1/". The first error message was:

  = note: Could not find tool: lld
          at: /home/simon/projects/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld
          Consider `rustup component add llvm-tools-preview`

It was not obvious in ./x.py build --help or config.toml.example how to build llvm-tools-preview for a local toolchain, but folks on Zulip pointed me to adding [rust] lld = true to config.toml.

Rebuilding the toolchain failed with:

Writer.cpp:(.text._ZN3lld4wasm12_GLOBAL__N_16Writer3runEv+0x23f8): undefined reference to `llvm::parallelForEachN(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>)'

My config.toml also had profile = "compiler" which enables download-ci-llvm = "if-available". It looks like building LLD from source doesn’t work when LLVM artifacts are downloaded from CI.

This configuration should either download LLD from CI too, or print a better error message.

@SimonSapin SimonSapin added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 21, 2022
jyn514 added a commit to jyn514/rust that referenced this issue Aug 1, 2022
@bors bors closed this as completed in 752c0f5 Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
1 participant