-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustbuild: Tweak LLVM distribution layout #53955
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. (You can r=me if that makes sense)
@bors: try Gonna run this through bors to double check it's working as expected. |
rustbuild: Tweak LLVM distribution layout This commit tweaks the layout of a few components that we distribute to hopefully fix across all platforms the recent issues with LLD being unable to find the LLVM shared object. In #53245 we switched to building LLVM as a dynamic library, which means that LLVM tools by default link to LLVM dynamically rather than statically. This in turn means that the tools, at runtime, need to find the LLVM shared library. LLVM's shared library is currently distributed as part of the rustc component. This library is located, however, at `$sysroot/lib`. The LLVM tools we ship are in two locations: * LLD is shipped at `$sysroot/lib/rustlib/$host/bin/rust-lld` * Other LLVM tools are shipped at `$sysroot/bin` Each LLVM tool has an embedded rpath directive indicating where it will search for dynamic libraries. This currently points to `../lib` and is presumably inserted by LLVM's build system. Unfortunately, though, this directive is only correct for the LLVM tools at `$sysroot/bin`, not LLD! This commit is targeted at fixing this situation by making two changes: * LLVM tools other than LLD are moved in the distribution to `$sysroot/lib/rustlib/$host/bin`. This moves them next to LLD and should position them for... * The LLVM shared object is moved to `$sysroot/lib/rustlib/$host/lib` Together this means that all tools should natively be able to find the shared object and the shared object should be installed all the time for the various tools. Overall this should... Closes #53813
☀️ Test successful - status-travis |
This would partly fix #53852 too, but stable, beta and nightly would install the same file (once it reaches stable), so adding a way to customize |
ace1929
to
60584a3
Compare
@bors: r=japaric |
📌 Commit 60584a36dbac1427f341ab073c1e9cce0e89d869 has been approved by |
@bors: p=1 (fixing a regression for a number of targets on nightly) |
This commit tweaks the layout of a few components that we distribute to hopefully fix across all platforms the recent issues with LLD being unable to find the LLVM shared object. In rust-lang#53245 we switched to building LLVM as a dynamic library, which means that LLVM tools by default link to LLVM dynamically rather than statically. This in turn means that the tools, at runtime, need to find the LLVM shared library. LLVM's shared library is currently distributed as part of the rustc component. This library is located, however, at `$sysroot/lib`. The LLVM tools we ship are in two locations: * LLD is shipped at `$sysroot/lib/rustlib/$host/bin/rust-lld` * Other LLVM tools are shipped at `$sysroot/bin` Each LLVM tool has an embedded rpath directive indicating where it will search for dynamic libraries. This currently points to `../lib` and is presumably inserted by LLVM's build system. Unfortunately, though, this directive is only correct for the LLVM tools at `$sysroot/bin`, not LLD! This commit is targeted at fixing this situation by making two changes: * LLVM tools other than LLD are moved in the distribution to `$sysroot/lib/rustlib/$host/bin`. This moves them next to LLD and should position them for... * The LLVM shared object is moved to `$sysroot/lib/rustlib/$host/lib` Together this means that all tools should natively be able to find the shared object and the shared object should be installed all the time for the various tools. Overall this should... Closes rust-lang#53813
60584a3
to
bce09b6
Compare
@bors: r=japaric |
@Keruspe if you're trying to install multiple versions to a shared sysroot, how do you deal with the existing conflicts? At least |
I made the codegen-backends directory name configurable a couple of weeks
after its first appearance for the same reason, and we do not install llvm
tools so no bin/
…On Wed 5 Sep 2018 at 18:26, Josh Stone ***@***.***> wrote:
@Keruspe <https://github.com/Keruspe> if you're trying to install
multiple versions to a shared sysroot, how do you deal with the existing
conflicts? At least bin/ and lib/rustlib/$target/codegen-backends/ are
not uniquely named.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#53955 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AANm3jzglDO3outP6uL-8dAY5V-R9ysZks5uX_sZgaJpZM4WZr4S>
.
|
@bors: r=japaric |
📌 Commit bce09b6 has been approved by |
rustbuild: Tweak LLVM distribution layout This commit tweaks the layout of a few components that we distribute to hopefully fix across all platforms the recent issues with LLD being unable to find the LLVM shared object. In #53245 we switched to building LLVM as a dynamic library, which means that LLVM tools by default link to LLVM dynamically rather than statically. This in turn means that the tools, at runtime, need to find the LLVM shared library. LLVM's shared library is currently distributed as part of the rustc component. This library is located, however, at `$sysroot/lib`. The LLVM tools we ship are in two locations: * LLD is shipped at `$sysroot/lib/rustlib/$host/bin/rust-lld` * Other LLVM tools are shipped at `$sysroot/bin` Each LLVM tool has an embedded rpath directive indicating where it will search for dynamic libraries. This currently points to `../lib` and is presumably inserted by LLVM's build system. Unfortunately, though, this directive is only correct for the LLVM tools at `$sysroot/bin`, not LLD! This commit is targeted at fixing this situation by making two changes: * LLVM tools other than LLD are moved in the distribution to `$sysroot/lib/rustlib/$host/bin`. This moves them next to LLD and should position them for... * The LLVM shared object is moved to `$sysroot/lib/rustlib/$host/lib` Together this means that all tools should natively be able to find the shared object and the shared object should be installed all the time for the various tools. Overall this should... Closes #53813
☀️ Test successful - status-appveyor, status-travis |
We're shipping a rust-enabled lldb, but the "lldb" executable is not installed into the "bin" directory by rustup. See the discussion in rust-lang/rustup#1492 for background on this decision. There, we agreed to have rust-lldb prefer the rust-enabled lldb if it is installed. This patch changes dist.rs to put lldb into rustlib, following what was done for the other LLVM tools in rust-lang#53955, and then fixes rust-lldb to prefer that lldb, if it exists. See issue rust-lang#48168
This commit tweaks the layout of a few components that we distribute to
hopefully fix across all platforms the recent issues with LLD being unable to
find the LLVM shared object. In #53245 we switched to building LLVM as a dynamic
library, which means that LLVM tools by default link to LLVM dynamically rather
than statically. This in turn means that the tools, at runtime, need to find the
LLVM shared library.
LLVM's shared library is currently distributed as part of the rustc component.
This library is located, however, at
$sysroot/lib
. The LLVM tools we ship arein two locations:
$sysroot/lib/rustlib/$host/bin/rust-lld
$sysroot/bin
Each LLVM tool has an embedded rpath directive indicating where it will search
for dynamic libraries. This currently points to
../lib
and is presumablyinserted by LLVM's build system. Unfortunately, though, this directive is only
correct for the LLVM tools at
$sysroot/bin
, not LLD!This commit is targeted at fixing this situation by making two changes:
$sysroot/lib/rustlib/$host/bin
. This moves them next to LLD and shouldposition them for...
$sysroot/lib/rustlib/$host/lib
Together this means that all tools should natively be able to find the shared
object and the shared object should be installed all the time for the various
tools. Overall this should...
Closes #53813