about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-11-12 10:38:41 +0200
committerGitHub <noreply@github.com>2016-11-12 10:38:41 +0200
commit220ff76e0b1b97c7deef11e320d0cb3b3032c73e (patch)
treefdcd9d16204557808d6d36ca1312c91b1dfe61a6 /src/bootstrap
parent6dd4ee6d08064a941e1b628fc54131cfe784b80b (diff)
parent0254f12224032be95dd97441a866e63c8e15a0e3 (diff)
downloadrust-220ff76e0b1b97c7deef11e320d0cb3b3032c73e.tar.gz
rust-220ff76e0b1b97c7deef11e320d0cb3b3032c73e.zip
Rollup merge of #37690 - TimNN:llvm-rel-dbg, r=alexcrichton
rustbuild: support RelWithDebInfo for llvm

r? @alexcrichton
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/config.rs3
-rw-r--r--src/bootstrap/config.toml.example3
-rw-r--r--src/bootstrap/native.rs9
3 files changed, 14 insertions, 1 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 9a939fee43e..a630aaf8af4 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -50,6 +50,7 @@ pub struct Config {
     // llvm codegen options
     pub llvm_assertions: bool,
     pub llvm_optimize: bool,
+    pub llvm_release_debuginfo: bool,
     pub llvm_version_check: bool,
     pub llvm_static_stdcpp: bool,
 
@@ -137,6 +138,7 @@ struct Llvm {
     ninja: Option<bool>,
     assertions: Option<bool>,
     optimize: Option<bool>,
+    release_debuginfo: Option<bool>,
     version_check: Option<bool>,
     static_libstdcpp: Option<bool>,
 }
@@ -243,6 +245,7 @@ impl Config {
             set(&mut config.ninja, llvm.ninja);
             set(&mut config.llvm_assertions, llvm.assertions);
             set(&mut config.llvm_optimize, llvm.optimize);
+            set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
             set(&mut config.llvm_version_check, llvm.version_check);
             set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
         }
diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example
index 306708f9e4b..1388dab303a 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -17,6 +17,9 @@
 # Indicates whether the LLVM build is a Release or Debug build
 #optimize = true
 
+# Indicates whether an LLVM Release build should include debug info
+#release-debuginfo = false
+
 # Indicates whether the LLVM assertions are enabled or not
 #assertions = false
 
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 1b4e86fb30f..358cfac7427 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -67,10 +67,17 @@ pub fn llvm(build: &Build, target: &str) {
     if build.config.ninja {
         cfg.generator("Ninja");
     }
+
+    let profile = match (build.config.llvm_optimize, build.config.llvm_release_debuginfo) {
+        (false, _) => "Debug",
+        (true, false) => "Release",
+        (true, true) => "RelWithDebInfo",
+    };
+
     cfg.target(target)
        .host(&build.config.build)
        .out_dir(&dst)
-       .profile(if build.config.llvm_optimize {"Release"} else {"Debug"})
+       .profile(profile)
        .define("LLVM_ENABLE_ASSERTIONS", assertions)
        .define("LLVM_TARGETS_TO_BUILD", "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend")
        .define("LLVM_INCLUDE_EXAMPLES", "OFF")