Skip to content

Commit c6047ea

Browse files
committed
Auto merge of #53828 - alexcrichton:dist-llvm-shared, r=japaric
rustbuild: Distribute libLLVM.so with rustc A recent change (#53245) started to build LLVM with ThinLTO enabled and to ensure that compile times are kept down it builds LLVM dynamically by default to ensure that all the various LLVM tools aren't redoing all that optimization work. This means, however, that all LLVM tools depend on LLVM's dynamic library by default. While the LLVM tools and LLDB components were updated to include the shared library we accidentally forgot about LLD, included with the main rustc component. LLD also links dynamically to LLVM and ships a non-working binary right now because of this! This commit updates our distribution to ship the LLVM dynamic library with the compiler libraries. While not technically needed for rustc itself to operate (right now) it may be needed for LLD, and otherwise it serves as a good basis for the other LLVM tools components to work with as well. This should... Closes #53813
2 parents f8d3459 + b7a604a commit c6047ea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/bootstrap/dist.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,13 @@ impl Step for Rustc {
501501
t!(fs::create_dir_all(&backends_dst));
502502
builder.cp_r(&backends_src, &backends_dst);
503503

504+
// Copy libLLVM.so to the lib dir as well, if needed. While not
505+
// technically needed by rustc itself it's needed by lots of other
506+
// components like the llvm tools and LLD. LLD is included below and
507+
// tools/LLDB come later, so let's just throw it in the rustc
508+
// component for now.
509+
maybe_install_llvm_dylib(builder, host, image);
510+
504511
// Copy over lld if it's there
505512
if builder.config.lld_enabled {
506513
let exe = exe("rust-lld", &compiler.host);
@@ -1967,8 +1974,6 @@ impl Step for LlvmTools {
19671974
builder.install(&exe, &dst_bindir, 0o755);
19681975
}
19691976

1970-
maybe_install_llvm_dylib(builder, target, &image);
1971-
19721977
// Prepare the overlay
19731978
let overlay = tmp.join("llvm-tools-overlay");
19741979
drop(fs::remove_dir_all(&overlay));
@@ -2087,9 +2092,6 @@ impl Step for Lldb {
20872092
}
20882093
}
20892094

2090-
// Copy libLLVM.so to the lib dir as well, if needed.
2091-
maybe_install_llvm_dylib(builder, target, &image);
2092-
20932095
// Prepare the overlay
20942096
let overlay = tmp.join("lldb-overlay");
20952097
drop(fs::remove_dir_all(&overlay));

0 commit comments

Comments
 (0)