about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-08-30 09:43:15 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-08-30 09:43:15 -0700
commitb7a604ab34ac247f13b1f91f8351a0e3c50df52f (patch)
tree9a2c48b4985902abc43e01a40ba5adc34cf3a7bf /src/bootstrap
parent0e98621e69890d67d906a436a68436d03a3edb89 (diff)
downloadrust-b7a604ab34ac247f13b1f91f8351a0e3c50df52f.tar.gz
rust-b7a604ab34ac247f13b1f91f8351a0e3c50df52f.zip
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
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/dist.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index c6ff63ad71b..92c0a088b5e 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -501,6 +501,13 @@ impl Step for Rustc {
             t!(fs::create_dir_all(&backends_dst));
             builder.cp_r(&backends_src, &backends_dst);
 
+            // Copy libLLVM.so to the lib dir as well, if needed. While not
+            // technically needed by rustc itself it's needed by lots of other
+            // components like the llvm tools and LLD. LLD is included below and
+            // tools/LLDB come later, so let's just throw it in the rustc
+            // component for now.
+            maybe_install_llvm_dylib(builder, host, image);
+
             // Copy over lld if it's there
             if builder.config.lld_enabled {
                 let exe = exe("rust-lld", &compiler.host);
@@ -1967,8 +1974,6 @@ impl Step for LlvmTools {
             builder.install(&exe, &dst_bindir, 0o755);
         }
 
-        maybe_install_llvm_dylib(builder, target, &image);
-
         // Prepare the overlay
         let overlay = tmp.join("llvm-tools-overlay");
         drop(fs::remove_dir_all(&overlay));
@@ -2087,9 +2092,6 @@ impl Step for Lldb {
             }
         }
 
-        // Copy libLLVM.so to the lib dir as well, if needed.
-        maybe_install_llvm_dylib(builder, target, &image);
-
         // Prepare the overlay
         let overlay = tmp.join("lldb-overlay");
         drop(fs::remove_dir_all(&overlay));