Skip to content

Commit 6a50572

Browse files
Support RelWithDebInfo for lld.
1 parent b4bf56c commit 6a50572

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bootstrap/native.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,16 @@ impl Step for Lld {
653653
// there's probably a lot of reasons you can't do that other than this.
654654
let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper");
655655

656+
// Re-use the same flags as llvm to control the level of debug information
657+
// generated for lld.
658+
let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) {
659+
(false, _) => "Debug",
660+
(true, false) => "Release",
661+
(true, true) => "RelWithDebInfo",
662+
};
663+
656664
cfg.out_dir(&out_dir)
657-
.profile("Release")
665+
.profile(profile)
658666
.env("LLVM_CONFIG_REAL", &llvm_config)
659667
.define("LLVM_CONFIG_PATH", llvm_config_shim)
660668
.define("LLVM_INCLUDE_TESTS", "OFF");

0 commit comments

Comments
 (0)