Skip to content

link the offload with in-tree lld if possible - #162824

Open
ZuseZ4 wants to merge 1 commit into
rust-lang:mainfrom
ZuseZ4:use-lld-more
Open

ZuseZ4 wants to merge 1 commit into
rust-lang:mainfrom
ZuseZ4:use-lld-more

Conversation

@ZuseZ4

@ZuseZ4 ZuseZ4 commented Sep 15, 2026

Copy link
Copy Markdown
Member

View all comments

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: #160584

@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 15, 2026
@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

kobzol is not on the review rotation at the moment.
They may take a while to respond.

@ZuseZ4

ZuseZ4 commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

This should be the last bootstrap PR for a while.
I then (might) just come with a really big one in the future to delete most of this ^^
Now that @sgasho's PR is in, we don't rely on the clang-linker-wrapper anymore and have a bit more control.
The OffloadBinary format was only needed when passing artifacts around between clang tooling, which keeps wrapping and unwrapping IR/asm. Since we're in full control now, we can delete a lot of that.

@ZuseZ4 ZuseZ4 mentioned this pull request Sep 15, 2026
5 tasks
Comment thread src/bootstrap/src/core/build_steps/llvm.rs Outdated
}

let lld_bin = builder.ensure(Lld { target }).join("bin");
ldflags.push_all(format!("-B{} -fuse-ld=lld", lld_bin.display()));

@Kobzol Kobzol Sep 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates the -fuse-ld=lld flag set on line 846, right?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I don't think it's harmful, but I moved it to avoid it.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@ZuseZ4
ZuseZ4 force-pushed the use-lld-more branch 2 times, most recently from 7f7e355 to 752e7c0 Compare September 17, 2026 04:14
@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Kobzol

Kobzol commented Sep 18, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 752e7c0 has been approved by Kobzol

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 18, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
Rollup of 9 pull requests

Successful merges:

 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162423 (Rename the src install build step to rust-src.)
 - #162824 (link Enzyme and the offload with in-tree lld if possible)
 - #161803 (Fix docs of make_ascii_lowercase/make_ascii_upercase)
 - #162256 (Add mentions to sync back `RELEASES.md` to the `main` branch)
 - #162803 (docs(num): add documentation for `NonZero::from_str`)
 - #162906 (Move more `rustdoc-html` tests in the right location)
 - #162922 (An assortment of polonius tweaks)
 - #162930 (Use niche length type for strlen to guarantee `isize::MAX` bound)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #160401 (sparc: make ABI consistent with clang)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162423 (Rename the src install build step to rust-src.)
 - #162740 (stdarch subtree update)
 - #162824 (link Enzyme and the offload with in-tree lld if possible)
 - #162832 (add `Div` and `Mul` for `Complex<{float}>`)
 - #161005 (fix: unfulfilled nested dead code lint)
 - #161803 (Fix docs of make_ascii_lowercase/make_ascii_upercase)
 - #162256 (Add mentions to sync back `RELEASES.md` to the `main` branch)
 - #162661 (simplify `Target::GenericParam`)
 - #162666 (Tidy footnote in `platform-support.md`)
 - #162803 (docs(num): add documentation for `NonZero::from_str`)
 - #162906 (Move more `rustdoc-html` tests in the right location)
 - #162922 (An assortment of polonius tweaks)
 - #162930 (Use niche length type for strlen to guarantee `isize::MAX` bound)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #160401 (sparc: make ABI consistent with clang)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162423 (Rename the src install build step to rust-src.)
 - #162740 (stdarch subtree update)
 - #162824 (link Enzyme and the offload with in-tree lld if possible)
 - #161005 (fix: unfulfilled nested dead code lint)
 - #161803 (Fix docs of make_ascii_lowercase/make_ascii_upercase)
 - #162256 (Add mentions to sync back `RELEASES.md` to the `main` branch)
 - #162661 (simplify `Target::GenericParam`)
 - #162666 (Tidy footnote in `platform-support.md`)
 - #162803 (docs(num): add documentation for `NonZero::from_str`)
 - #162906 (Move more `rustdoc-html` tests in the right location)
 - #162922 (An assortment of polonius tweaks)
 - #162929 (Update unicode_data to Unicode version 18.0.0)
 - #162930 (Use niche length type for strlen to guarantee `isize::MAX` bound)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #160401 (sparc: make ABI consistent with clang)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162740 (stdarch subtree update)
 - #162824 (link Enzyme and the offload with in-tree lld if possible)
 - #161005 (fix: unfulfilled nested dead code lint)
 - #161803 (Fix docs of make_ascii_lowercase/make_ascii_upercase)
 - #162256 (Add mentions to sync back `RELEASES.md` to the `main` branch)
 - #162661 (simplify `Target::GenericParam`)
 - #162666 (Tidy footnote in `platform-support.md`)
 - #162803 (docs(num): add documentation for `NonZero::from_str`)
 - #162906 (Move more `rustdoc-html` tests in the right location)
 - #162922 (An assortment of polonius tweaks)
 - #162929 (Update unicode_data to Unicode version 18.0.0)
 - #162930 (Use niche length type for strlen to guarantee `isize::MAX` bound)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible

I have multiple LLVM builds on all my computers, and often enough ended up with an older lld version on the path, which often breaks Offload builds.
I've also seen autodiff builds take forever since some of it's files are huge, and builds somehow end up using ld.

This fixes both by just using our up-to-date in-tree lld (if available).
I used an LLM to implement a couple of bootstrap fixes, including this one. I then split this one out and cleaned it up.

r? kobzol

closes: rust-lang#160584
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #160401 (sparc: make ABI consistent with clang)
 - #162715 (don't calculate dtors if the self ty has impossible bounds)
 - #162740 (stdarch subtree update)
 - #162824 (link Enzyme and the offload with in-tree lld if possible)
 - #162946 (Simplify query stack printing)
 - #161005 (fix: unfulfilled nested dead code lint)
 - #161246 (Normalize non-rigid aliases in ty_known_to_outlive)
 - #161803 (Fix docs of make_ascii_lowercase/make_ascii_upercase)
 - #162256 (Add mentions to sync back `RELEASES.md` to the `main` branch)
 - #162661 (simplify `Target::GenericParam`)
 - #162666 (Tidy footnote in `platform-support.md`)
 - #162803 (docs(num): add documentation for `NonZero::from_str`)
 - #162879 (use u64 limbs in core::num::bignum)
 - #162903 (PassWrapper: adapt to LLVM reading exception model from module flag)
 - #162905 (c-variadic: add checks for windows i686)
 - #162906 (Move more `rustdoc-html` tests in the right location)
 - #162922 (An assortment of polonius tweaks)
 - #162929 (Update unicode_data to Unicode version 18.0.0)
 - #162930 (Use niche length type for strlen to guarantee `isize::MAX` bound)
 - #162960 (Guard types with unstable `Allocator` params ahead of partial stabilization)
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #162983 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 18, 2026
@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#162983), which was unapproved.

View changes since this unapproval

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=dist-x86_64-llvm-mingw

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
link Enzyme and the offload with in-tree lld if possible


try-job: dist-x86_64-llvm-mingw
@ZuseZ4

ZuseZ4 commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

Oh, this was aimed at and tested on x86-linux, since that's where offload is currently active, but I guess via autodiff it could have broken mingw, even though I'd find it a bit surprising. I'll have a look, sorry

@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

💔 Test for f70d840 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 changed the title link Enzyme and the offload with in-tree lld if possible link the offload with in-tree lld if possible Sep 22, 2026
@ZuseZ4

ZuseZ4 commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

Enzyme only gets a bootstrap time improvement, whereas the offload side needs this improvement to build on some targets. Since Enzyme failed on mingw, I limited it to offload which only runs on linux for now.
@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 22, 2026
link the offload with in-tree lld if possible


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: d721131 (d72113161dd4274d0b068443252f231e2683ed83)
Base parent: b794652 (b794652dc70d72efc28970704c9ebe04d59fea5d)

@ZuseZ4

ZuseZ4 commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

@bors r=Kobzol rollup

@rust-bors

rust-bors Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d296cf2 has been approved by Kobzol

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bootstrap build order - missing lld for autodiff/offload

5 participants