From 7a91d4a25b2b063bf1e1f8cfd1b8d0fd89d84dd0 Mon Sep 17 00:00:00 2001 From: "A.J. Gardner" Date: Sat, 12 Nov 2016 19:13:22 -0600 Subject: [PATCH 1/3] Add llvm debuginfo configure option --- configure | 4 ++++ mk/llvm.mk | 2 ++ 2 files changed, 6 insertions(+) diff --git a/configure b/configure index 9c055e7217a..c6f818299ff 100755 --- a/configure +++ b/configure @@ -642,6 +642,7 @@ opt_nosave optimize-cxx 1 "build optimized C++ code" opt_nosave optimize-llvm 1 "build optimized LLVM" opt_nosave llvm-assertions 0 "build LLVM with assertions" opt_nosave debug-assertions 0 "build with debugging assertions" +opt_nosave llvm-debuginfo 0 "build LLVM with debugger metadata" opt_nosave debuginfo 0 "build with debugger metadata" opt_nosave debuginfo-lines 0 "build with line number debugger metadata" opt_nosave debug-jemalloc 0 "build jemalloc with --enable-debug --enable-fill" @@ -778,6 +779,7 @@ if [ -n "$CFG_DISABLE_OPTIMIZE_CXX" ]; then putvar CFG_DISABLE_OPTIMIZE_CXX; fi if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then putvar CFG_DISABLE_OPTIMIZE_LLVM; fi if [ -n "$CFG_ENABLE_LLVM_ASSERTIONS" ]; then putvar CFG_ENABLE_LLVM_ASSERTIONS; fi if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTIONS; fi +if [ -n "$CFG_ENABLE_LLVM_DEBUGINFO" ]; then putvar CFG_ENABLE_LLVM_DEBUGINFO; fi if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi if [ -n "$CFG_ENABLE_DEBUGINFO_LINES" ]; then putvar CFG_ENABLE_DEBUGINFO_LINES; fi if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi @@ -1772,6 +1774,8 @@ do if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug" + elif [ -n "$CFG_ENABLE_LLVM_DEBUGINFO" ]; then + CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=RelWithDebInfo" else CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release" fi diff --git a/mk/llvm.mk b/mk/llvm.mk index 5a91f5fcaa4..842f1bcee11 100644 --- a/mk/llvm.mk +++ b/mk/llvm.mk @@ -21,6 +21,8 @@ endif ifdef CFG_DISABLE_OPTIMIZE_LLVM LLVM_BUILD_CONFIG_MODE := Debug +else ifdef CFG_ENABLE_LLVM_DEBUGINFO +LLVM_BUILD_CONFIG_MODE := RelWithDebInfo else LLVM_BUILD_CONFIG_MODE := Release endif From aea1a5156177932c4ec8cf5a24a5c05e0a6b15aa Mon Sep 17 00:00:00 2001 From: "A.J. Gardner" Date: Sun, 13 Nov 2016 12:27:57 -0600 Subject: [PATCH 2/3] Let rustbuild parse llvm debuginfo option update_with_config_mk() needs to read the new llvm debuginfo config option from config.mk. Other than that, rustbuild already supports LLVM's RelWithDebInfo build type. --- src/bootstrap/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 50c703a7354..bea475fb07b 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -339,6 +339,7 @@ impl Config { ("COMPILER_DOCS", self.compiler_docs), ("DOCS", self.docs), ("LLVM_ASSERTIONS", self.llvm_assertions), + ("LLVM_DEBUGINFO", self.llvm_release_debuginfo), ("OPTIMIZE_LLVM", self.llvm_optimize), ("LLVM_VERSION_CHECK", self.llvm_version_check), ("LLVM_STATIC_STDCPP", self.llvm_static_stdcpp), From d3574b8dc756c5bd5dd2d7b8053c0de15b902691 Mon Sep 17 00:00:00 2001 From: "A.J. Gardner" Date: Sun, 13 Nov 2016 12:38:10 -0600 Subject: [PATCH 3/3] Make LLVM debuginfo option names consistent --- configure | 6 +++--- mk/llvm.mk | 2 +- src/bootstrap/config.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index c6f818299ff..d37ffce52af 100755 --- a/configure +++ b/configure @@ -642,7 +642,7 @@ opt_nosave optimize-cxx 1 "build optimized C++ code" opt_nosave optimize-llvm 1 "build optimized LLVM" opt_nosave llvm-assertions 0 "build LLVM with assertions" opt_nosave debug-assertions 0 "build with debugging assertions" -opt_nosave llvm-debuginfo 0 "build LLVM with debugger metadata" +opt_nosave llvm-release-debuginfo 0 "build LLVM with debugger metadata" opt_nosave debuginfo 0 "build with debugger metadata" opt_nosave debuginfo-lines 0 "build with line number debugger metadata" opt_nosave debug-jemalloc 0 "build jemalloc with --enable-debug --enable-fill" @@ -779,7 +779,7 @@ if [ -n "$CFG_DISABLE_OPTIMIZE_CXX" ]; then putvar CFG_DISABLE_OPTIMIZE_CXX; fi if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then putvar CFG_DISABLE_OPTIMIZE_LLVM; fi if [ -n "$CFG_ENABLE_LLVM_ASSERTIONS" ]; then putvar CFG_ENABLE_LLVM_ASSERTIONS; fi if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTIONS; fi -if [ -n "$CFG_ENABLE_LLVM_DEBUGINFO" ]; then putvar CFG_ENABLE_LLVM_DEBUGINFO; fi +if [ -n "$CFG_ENABLE_LLVM_RELEASE_DEBUGINFO" ]; then putvar CFG_ENABLE_LLVM_RELEASE_DEBUGINFO; fi if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi if [ -n "$CFG_ENABLE_DEBUGINFO_LINES" ]; then putvar CFG_ENABLE_DEBUGINFO_LINES; fi if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi @@ -1774,7 +1774,7 @@ do if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug" - elif [ -n "$CFG_ENABLE_LLVM_DEBUGINFO" ]; then + elif [ -n "$CFG_ENABLE_LLVM_RELEASE_DEBUGINFO" ]; then CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=RelWithDebInfo" else CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release" diff --git a/mk/llvm.mk b/mk/llvm.mk index 842f1bcee11..76367e6f3a6 100644 --- a/mk/llvm.mk +++ b/mk/llvm.mk @@ -21,7 +21,7 @@ endif ifdef CFG_DISABLE_OPTIMIZE_LLVM LLVM_BUILD_CONFIG_MODE := Debug -else ifdef CFG_ENABLE_LLVM_DEBUGINFO +else ifdef CFG_ENABLE_LLVM_RELEASE_DEBUGINFO LLVM_BUILD_CONFIG_MODE := RelWithDebInfo else LLVM_BUILD_CONFIG_MODE := Release diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index bea475fb07b..945d482c2aa 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -339,7 +339,7 @@ impl Config { ("COMPILER_DOCS", self.compiler_docs), ("DOCS", self.docs), ("LLVM_ASSERTIONS", self.llvm_assertions), - ("LLVM_DEBUGINFO", self.llvm_release_debuginfo), + ("LLVM_RELEASE_DEBUGINFO", self.llvm_release_debuginfo), ("OPTIMIZE_LLVM", self.llvm_optimize), ("LLVM_VERSION_CHECK", self.llvm_version_check), ("LLVM_STATIC_STDCPP", self.llvm_static_stdcpp),