mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
Rollup merge of #94621 - ridwanabdillahi:lld-rel-dbg, r=Mark-Simulacrum
rustbuild: support RelWithDebInfo for lld r? ``@alexcrichton`` LLVM has flags that control the level of debuginfo generated when building via rustbuild. Since LLD is built separately, it currently has no way of generating any debuginfo. This change re-uses the same flags as LLVM for LLD to ensure it has the same level of debuginfo generated as LLVM.
This commit is contained in:
commit
02e8839cbd
@ -650,8 +650,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");
|
||||
|
Loading…
Reference in New Issue
Block a user