diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-20 12:58:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-20 12:58:32 +0100 |
| commit | 1346557ba1c5165eb48f2ea5d6b7a3bd2de139c4 (patch) | |
| tree | 61ffbb074b39ff659b13147eb8cd3dafa937b9ad | |
| parent | 0a0d07a1fc712241ea9215a621d3f4fa9162ee20 (diff) | |
| parent | 4c2f1c802c4d582891a8e079949889d2462bbfd2 (diff) | |
| download | rust-1346557ba1c5165eb48f2ea5d6b7a3bd2de139c4.tar.gz rust-1346557ba1c5165eb48f2ea5d6b7a3bd2de139c4.zip | |
Rollup merge of #66532 - cuviper:dwarf-aranges, r=michaelwoerister
Generate DWARF address ranges for faster lookups This adds a new option `-Zgenerate-arange-section`, enabled by default, corresponding to LLVM's `-generate-arange-section`. This creates a `.debug_aranges` section with DWARF address ranges, which some tools depend on to optimize address lookups (elfutils [22288], [25173]). This only has effect when debuginfo is enabled, and the additional data is small compared to the other debug sections. For example, libstd.so with full debuginfo is about 11MB, with just 61kB in aranges. [22288]: https://sourceware.org/bugzilla/show_bug.cgi?id=22288 [25173]: https://sourceware.org/bugzilla/show_bug.cgi?id=25173 Closes #45246. r? @michaelwoerister
| -rw-r--r-- | src/librustc/session/config.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/llvm_util.rs | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 4474b008c79..b9b6a5f2342 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1331,6 +1331,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "for every macro invocation, print its name and arguments"), debug_macros: bool = (false, parse_bool, [TRACKED], "emit line numbers debug info inside macros"), + generate_arange_section: bool = (true, parse_bool, [TRACKED], + "generate DWARF address ranges for faster lookups"), keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED], "don't clear the hygiene data after analysis"), keep_ast: bool = (false, parse_bool, [UNTRACKED], diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index 85e0b6d465a..290ca409261 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -62,6 +62,9 @@ unsafe fn configure_llvm(sess: &Session) { if sess.opts.debugging_opts.disable_instrumentation_preinliner { add("-disable-preinline"); } + if sess.opts.debugging_opts.generate_arange_section { + add("-generate-arange-section"); + } if get_major_version() >= 8 { match sess.opts.debugging_opts.merge_functions .unwrap_or(sess.target.target.options.merge_functions) { |
