about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-26 02:10:15 +0000
committerbors <bors@rust-lang.org>2019-01-26 02:10:15 +0000
commit9df043b543bb9bc3e50bc243811c58d52a3aefea (patch)
treecf74ee097b45d0416476ba5726b0feda76de9985 /src/bootstrap
parent37d51aa8f3bca674a50eb7c6204deed6fb4dff80 (diff)
parent059ed4f21f42914028af5fc0083d3eca13a49d6f (diff)
downloadrust-9df043b543bb9bc3e50bc243811c58d52a3aefea.tar.gz
rust-9df043b543bb9bc3e50bc243811c58d52a3aefea.zip
Auto merge of #57675 - cuviper:llvm-monorepo, r=alexcrichton
Rebase to the llvm-project monorepo

The new git submodule src/llvm-project is a monorepo replacing src/llvm
and src/tools/{clang,lld,lldb}.  This also serves as a rebase for these
projects to the new 8.x branch from trunk.

The src/llvm-emscripten fork is unchanged for now.

r? @alexcrichton
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py12
-rw-r--r--src/bootstrap/dist.rs25
-rw-r--r--src/bootstrap/native.rs15
3 files changed, 32 insertions, 20 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index e8c1594bda3..119b38bcc99 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -701,21 +701,13 @@ class RustBuild(object):
         filtered_submodules = []
         submodules_names = []
         for module in submodules:
-            if module.endswith("llvm"):
-                if self.get_toml('llvm-config'):
+            if module.endswith("llvm-project"):
+                if self.get_toml('llvm-config') and self.get_toml('lld') != 'true':
                     continue
             if module.endswith("llvm-emscripten"):
                 backends = self.get_toml('codegen-backends')
                 if backends is None or not 'emscripten' in backends:
                     continue
-            if module.endswith("lld"):
-                config = self.get_toml('lld')
-                if config is None or config == 'false':
-                    continue
-            if module.endswith("lldb") or module.endswith("clang"):
-                config = self.get_toml('lldb')
-                if config is None or config == 'false':
-                    continue
             check = self.check_submodule(module, slow_submodules)
             filtered_submodules.append((module, check))
             submodules_names.append(module)
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 71662e8b941..98d2fb1e2d0 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -788,7 +788,24 @@ fn copy_src_dirs(builder: &Builder, src_dirs: &[&str], exclude_dirs: &[&str], ds
         if spath.ends_with("~") || spath.ends_with(".pyc") {
             return false
         }
-        if (spath.contains("llvm/test") || spath.contains("llvm\\test")) &&
+
+        const LLVM_PROJECTS: &[&str] = &[
+            "llvm-project/clang", "llvm-project\\clang",
+            "llvm-project/lld", "llvm-project\\lld",
+            "llvm-project/lldb", "llvm-project\\lldb",
+            "llvm-project/llvm", "llvm-project\\llvm",
+        ];
+        if spath.contains("llvm-project") && !spath.ends_with("llvm-project")
+            && !LLVM_PROJECTS.iter().any(|path| spath.contains(path))
+        {
+            return false;
+        }
+
+        const LLVM_TEST: &[&str] = &[
+            "llvm-project/llvm/test", "llvm-project\\llvm\\test",
+            "llvm-emscripten/test", "llvm-emscripten\\test",
+        ];
+        if LLVM_TEST.iter().any(|path| spath.contains(path)) &&
             (spath.ends_with(".ll") ||
              spath.ends_with(".td") ||
              spath.ends_with(".s")) {
@@ -2076,7 +2093,7 @@ impl Step for LlvmTools {
         }
 
         builder.info(&format!("Dist LlvmTools stage{} ({})", stage, target));
-        let src = builder.src.join("src/llvm");
+        let src = builder.src.join("src/llvm-project/llvm");
         let name = pkgname(builder, "llvm-tools");
 
         let tmp = tmpdir(builder);
@@ -2135,7 +2152,7 @@ impl Step for Lldb {
     const DEFAULT: bool = true;
 
     fn should_run(run: ShouldRun) -> ShouldRun {
-        run.path("src/tools/lldb")
+        run.path("src/llvm-project/lldb").path("src/tools/lldb")
     }
 
     fn make_run(run: RunConfig) {
@@ -2160,7 +2177,7 @@ impl Step for Lldb {
         }
 
         builder.info(&format!("Dist Lldb ({})", target));
-        let src = builder.src.join("src/tools/lldb");
+        let src = builder.src.join("src/llvm-project/lldb");
         let name = pkgname(builder, "lldb");
 
         let tmp = tmpdir(builder);
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index f5bacd63e68..b1bc2e6cad5 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -36,7 +36,10 @@ impl Step for Llvm {
     const ONLY_HOSTS: bool = true;
 
     fn should_run(run: ShouldRun) -> ShouldRun {
-        run.path("src/llvm").path("src/llvm-emscripten")
+        run.path("src/llvm-project")
+            .path("src/llvm-project/llvm")
+            .path("src/llvm")
+            .path("src/llvm-emscripten")
     }
 
     fn make_run(run: RunConfig) {
@@ -97,7 +100,7 @@ impl Step for Llvm {
         t!(fs::create_dir_all(&out_dir));
 
         // http://llvm.org/docs/CMake.html
-        let root = if self.emscripten { "src/llvm-emscripten" } else { "src/llvm" };
+        let root = if self.emscripten { "src/llvm-emscripten" } else { "src/llvm-project/llvm" };
         let mut cfg = cmake::Config::new(builder.src.join(root));
 
         let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) {
@@ -189,10 +192,10 @@ impl Step for Llvm {
         }
 
         if want_lldb {
-            cfg.define("LLVM_EXTERNAL_CLANG_SOURCE_DIR", builder.src.join("src/tools/clang"));
-            cfg.define("LLVM_EXTERNAL_LLDB_SOURCE_DIR", builder.src.join("src/tools/lldb"));
+            cfg.define("LLVM_ENABLE_PROJECTS", "clang;lldb");
             // For the time being, disable code signing.
             cfg.define("LLDB_CODESIGN_IDENTITY", "");
+            cfg.define("LLDB_NO_DEBUGSERVER", "ON");
         } else {
             // LLDB requires libxml2; but otherwise we want it to be disabled.
             // See https://github.com/rust-lang/rust/pull/50104
@@ -411,7 +414,7 @@ impl Step for Lld {
     const ONLY_HOSTS: bool = true;
 
     fn should_run(run: ShouldRun) -> ShouldRun {
-        run.path("src/tools/lld")
+        run.path("src/llvm-project/lld").path("src/tools/lld")
     }
 
     fn make_run(run: RunConfig) {
@@ -441,7 +444,7 @@ impl Step for Lld {
         let _time = util::timeit(&builder);
         t!(fs::create_dir_all(&out_dir));
 
-        let mut cfg = cmake::Config::new(builder.src.join("src/tools/lld"));
+        let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld"));
         configure_cmake(builder, target, &mut cfg);
 
         // This is an awful, awful hack. Discovered when we migrated to using