From 6a50572c51d81e0aba542f0b0e73c376c7cbb9c2 Mon Sep 17 00:00:00 2001 From: ridwanabdillahi <91507758+ridwanabdillahi@users.noreply.github.com> Date: Fri, 4 Mar 2022 09:57:40 -0800 Subject: [PATCH] Support RelWithDebInfo for lld. --- src/bootstrap/native.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index a751a6e3ece..40ab5d45a4b 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -653,8 +653,16 @@ impl Step for Lld { // there's probably a lot of reasons you can't do that other than this. let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper"); + // Re-use the same flags as llvm to control the level of debug information + // generated for lld. + let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) { + (false, _) => "Debug", + (true, false) => "Release", + (true, true) => "RelWithDebInfo", + }; + cfg.out_dir(&out_dir) - .profile("Release") + .profile(profile) .env("LLVM_CONFIG_REAL", &llvm_config) .define("LLVM_CONFIG_PATH", llvm_config_shim) .define("LLVM_INCLUDE_TESTS", "OFF");