rust/compiler
Alex Crichton a124043fb0 rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo
This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361
2021-01-28 08:51:11 -08:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast
rustc_ast_lowering Rollup merge of #81249 - cjgillot:issue-79537, r=oli-obk 2021-01-23 20:16:07 +01:00
rustc_ast_passes
rustc_ast_pretty Remove unused dependency 2021-01-23 10:30:38 +01:00
rustc_attr Replace version_check dependency with own version parsing code 2021-01-24 01:56:54 +01:00
rustc_builtin_macros Rollup merge of #80855 - m-ou-se:assert-2021, r=petrochenkov 2021-01-24 22:09:53 +01:00
rustc_codegen_cranelift
rustc_codegen_llvm rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
rustc_codegen_ssa rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
rustc_data_structures Clean up dominators_given_rpo 2021-01-24 13:32:18 +01:00
rustc_driver
rustc_error_codes
rustc_errors
rustc_expand
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Auto merge of #80919 - cjgillot:defkey-span, r=oli-obk 2021-01-24 06:51:17 +00:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer
rustc_interface rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
rustc_lexer
rustc_lint Rollup merge of #81275 - jyn514:time-render, r=wesleywiser 2021-01-23 20:16:10 +01:00
rustc_lint_defs
rustc_llvm
rustc_macros
rustc_metadata Fix proc macro crate encoding. 2021-01-23 13:57:43 +01:00
rustc_middle Auto merge of #80919 - cjgillot:defkey-span, r=oli-obk 2021-01-24 06:51:17 +00:00
rustc_mir Rollup merge of #78578 - oli-obk:const_mut_refs, r=RalfJung 2021-01-24 22:09:48 +01:00
rustc_mir_build
rustc_parse parser: Collect tokens for values in key-value attributes 2021-01-24 17:11:56 +03:00
rustc_parse_format
rustc_passes Rollup merge of #81310 - tmiasko:in-pattern, r=petrochenkov 2021-01-24 22:10:06 +01:00
rustc_plugin_impl
rustc_privacy
rustc_query_system
rustc_resolve Rollup merge of #81252 - jyn514:resolve-timing, r=petrochenkov 2021-01-23 20:16:09 +01:00
rustc_save_analysis
rustc_serialize
rustc_session rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
rustc_span Add disambiugator to ExpnData 2021-01-23 15:41:17 -05:00
rustc_symbol_mangling
rustc_target rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
rustc_trait_selection
rustc_traits
rustc_ty_utils Infallible version of def_span. 2021-01-23 13:35:22 +01:00
rustc_type_ir
rustc_typeck Rollup merge of #81279 - bugadani:iter, r=davidtwco 2021-01-24 22:10:01 +01:00