From df0466d0bb807a7266cc8ac9931cd43b3e84b62e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 16 Jan 2019 09:59:03 -0800 Subject: 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. --- src/bootstrap/bootstrap.py | 12 ++---------- src/bootstrap/dist.rs | 25 +++++++++++++++++++++---- src/bootstrap/native.rs | 14 ++++++++------ 3 files changed, 31 insertions(+), 20 deletions(-) (limited to 'src/bootstrap') 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..337c6965a30 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,8 +192,7 @@ 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", ""); } else { @@ -411,7 +413,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 +443,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 -- cgit 1.4.1-3-g733a5 From 15cf179c9316740fb5ddff3bf8075e5436cece11 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 24 Jan 2019 18:02:54 -0800 Subject: Set LLDB_NO_DEBUGSERVER=ON --- src/bootstrap/native.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/bootstrap') diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 337c6965a30..b1bc2e6cad5 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -195,6 +195,7 @@ impl Step for Llvm { 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 -- cgit 1.4.1-3-g733a5