diff options
| author | fee1-dead <ent3rm4n@gmail.com> | 2022-03-06 22:35:30 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-06 22:35:30 +1100 |
| commit | 02e8839cbd6d5df2019cd22cd42aea48c3aecf2a (patch) | |
| tree | ad64c547118efc47ce0d08db98dd48be031550cc /src/bootstrap | |
| parent | d85e4b1e359be89ff6e55b71f54ed84c5a85d1f1 (diff) | |
| parent | 6a50572c51d81e0aba542f0b0e73c376c7cbb9c2 (diff) | |
| download | rust-02e8839cbd6d5df2019cd22cd42aea48c3aecf2a.tar.gz rust-02e8839cbd6d5df2019cd22cd42aea48c3aecf2a.zip | |
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.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/native.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index d27ad9644b5..f00c5ce5aa6 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -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"); |
