diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2021-11-10 10:47:00 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2021-11-10 10:47:00 -0800 |
| commit | 7dc38369c00380f8ec23f8b3bf4cfc0ea5c94bcf (patch) | |
| tree | bea076b77cb31298faa9e37fe5c339acd14a53c9 /compiler/rustc_target | |
| parent | 9a442353f37a9959c2149927382bb8261d980e76 (diff) | |
| download | rust-7dc38369c00380f8ec23f8b3bf4cfc0ea5c94bcf.tar.gz rust-7dc38369c00380f8ec23f8b3bf4cfc0ea5c94bcf.zip | |
Disable `.debug_aranges` for all wasm targets
This follows from discussion on https://bugs.llvm.org/show_bug.cgi?id=52442 where it looks like this section doesn't make sense for wasm targets.
Diffstat (limited to 'compiler/rustc_target')
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/wasm_base.rs | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 69b90bf10fe..0771f998535 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1357,6 +1357,9 @@ pub struct TargetOptions { /// Minimum number of bits in #[repr(C)] enum. Defaults to 32. pub c_enum_min_bits: u64, + + /// Whether or not the DWARF `.debug_aranges` section should be generated. + pub generate_arange_section: bool, } impl Default for TargetOptions { @@ -1462,6 +1465,7 @@ impl Default for TargetOptions { supported_sanitizers: SanitizerSet::empty(), default_adjusted_cabi: None, c_enum_min_bits: 32, + generate_arange_section: true, } } } @@ -2047,6 +2051,7 @@ impl Target { key!(supported_sanitizers, SanitizerSet)?; key!(default_adjusted_cabi, Option<Abi>)?; key!(c_enum_min_bits, u64); + key!(generate_arange_section, bool); if base.is_builtin { // This can cause unfortunate ICEs later down the line. @@ -2286,6 +2291,7 @@ impl ToJson for Target { target_option_val!(split_debuginfo); target_option_val!(supported_sanitizers); target_option_val!(c_enum_min_bits); + target_option_val!(generate_arange_section); if let Some(abi) = self.default_adjusted_cabi { d.insert("default-adjusted-cabi".to_string(), Abi::name(abi).to_json()); diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs index 4c954a1e567..24e9c625169 100644 --- a/compiler/rustc_target/src/spec/wasm_base.rs +++ b/compiler/rustc_target/src/spec/wasm_base.rs @@ -128,6 +128,12 @@ pub fn options() -> TargetOptions { // gdb scripts don't work on wasm blobs emit_debug_gdb_scripts: false, + // There's more discussion of this at + // https://bugs.llvm.org/show_bug.cgi?id=52442 but the general result is + // that this isn't useful for wasm and has tricky issues with + // representation, so this is disabled. + generate_arange_section: false, + ..Default::default() } } |
