Skip to content

offload: add libLLVM rpath for libomptarget - #162860

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
sgasho:offload-remove-ldlibrarypath
Sep 18, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
sgasho:offload-remove-ldlibrarypath

Conversation

@sgasho

@sgasho sgasho commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

fix: #162309 (comment)

We can remove LD_LIBRARY_PATH=$(rustc +nightly --print sysroot)/lib when we run the offload code after this PR lands.

libomptarget.so is in lib/rustlib/${target}/lib, and libLLVM is in lib/, three hierarchy above libomptarget. So we can specify $ORIGIN/../../../

Lld::run uses the same logic.

スクリーンショット 2026-09-17 3 16 48 スクリーンショット 2026-09-17 3 17 02

I have not verified if it works yet. I'll share the result I can test on my local machine later, but testing using tarballs would be better?

r? @ZuseZ4

@rustbot

rustbot commented Sep 16, 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 16, 2026
@ZuseZ4

ZuseZ4 commented Sep 17, 2026

Copy link
Copy Markdown
Member

I think you'll need to rebase before this works, but let's try.

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

@ZuseZ4

ZuseZ4 commented Sep 17, 2026

Copy link
Copy Markdown
Member

I tested dist locally and it works. You just shouldn't need the target check anymore after the rebase, since we simplified the build in a pr merged yesterday.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the offload-remove-ldlibrarypath branch from c5e7260 to 0db4e55 Compare September 17, 2026 13:23
@ZuseZ4

ZuseZ4 commented Sep 17, 2026

Copy link
Copy Markdown
Member

@bors try jobs=dist-x86_64-linux

rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
offload: add libLLVM rpath for libomptarget


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

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f0c72e2 (f0c72e29adf7edd84cb0d60241f2c8923c631036)
Base parent: c999cef (c999cef531ea9059e189e82fe0e82c5daf249bc9)

@ZuseZ4

ZuseZ4 commented Sep 17, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0db4e55 has been approved by ZuseZ4

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 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #161987 (fix `is_single_fp_element` for `s390x` and `x86`)
 - #162366 (Replace hard linked `metadata.rmeta` with a copy when finalizing the incremental compilation session dir fails)
 - #162552 (RISC-V: Add Zmmul target feature)
 - #162602 (Ensure concurrent rustc instances in the same process correctly lock the session dir)
 - #162885 (Remove one remaining use of `Level::Help`)
 - #162606 (c-b: Export `fmaf16` now that we have an implementation)
 - #162817 (rustc_{codegen_,}llvm: adapt to new ThreadModel API)
 - #162860 (offload: add libLLVM rpath for libomptarget)
 - #162895 (Avoid derive edits on macro-generated types)
 - #162899 (Error on invalid placements of the `cfi_encoding` attribute.)
@rust-bors
rust-bors Bot merged commit 789d24b into rust-lang:main Sep 18, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
Rollup merge of #162860 - sgasho:offload-remove-ldlibrarypath, r=ZuseZ4

offload: add libLLVM rpath for libomptarget

fix: #162309 (comment)

We can remove LD_LIBRARY_PATH=$(rustc +nightly --print sysroot)/lib when we run the offload code after this PR lands.

libomptarget.so is in lib/rustlib/${target}/lib, and libLLVM is in lib/, three hierarchy above libomptarget. So we can specify $ORIGIN/../../../

Lld::run uses the same logic.

<img width="520" height="285" alt="スクリーンショット 2026-09-17 3 16 48" src="https://github.com/user-attachments/assets/d8f4938d-7e37-4e56-af61-9f2ed7f2e5fc" />

<img width="589" height="454" alt="スクリーンショット 2026-09-17 3 17 02" src="https://github.com/user-attachments/assets/b5e8bf27-38b1-460c-a113-20176a669a05" />

I have not verified if it works yet. I'll share the result I can test on my local machine later, but testing using tarballs would be better?

r? @ZuseZ4
@ZuseZ4

ZuseZ4 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Once we verified it works on nightly, we should update the dev guide

pull Bot pushed a commit to xtqqczze/rust-lang-rust-analyzer that referenced this pull request Sep 21, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#161987 (fix `is_single_fp_element` for `s390x` and `x86`)
 - rust-lang/rust#162366 (Replace hard linked `metadata.rmeta` with a copy when finalizing the incremental compilation session dir fails)
 - rust-lang/rust#162552 (RISC-V: Add Zmmul target feature)
 - rust-lang/rust#162602 (Ensure concurrent rustc instances in the same process correctly lock the session dir)
 - rust-lang/rust#162885 (Remove one remaining use of `Level::Help`)
 - rust-lang/rust#162606 (c-b: Export `fmaf16` now that we have an implementation)
 - rust-lang/rust#162817 (rustc_{codegen_,}llvm: adapt to new ThreadModel API)
 - rust-lang/rust#162860 (offload: add libLLVM rpath for libomptarget)
 - rust-lang/rust#162895 (Avoid derive edits on macro-generated types)
 - rust-lang/rust#162899 (Error on invalid placements of the `cfi_encoding` attribute.)
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.

3 participants