rust/src
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
..
bootstrap rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
build_helper Fix even more URLs 2020-11-05 20:11:29 +01:00
ci ci: use the monorepo's lockfile when building cargo for pgo profiling 2021-01-25 13:33:24 +01:00
doc rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
etc Add jsondocck tool, and use it for rustdoc JSON 2021-01-19 14:24:25 -05:00
librustdoc Rollup merge of #81302 - LeSeulArtichaut:80777-trait-render, r=jyn514 2021-01-24 22:10:04 +01:00
llvm-project@f9a8d70b6e Update to LLVM 11.0.1 2021-01-07 11:32:10 -08:00
test rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
tools rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo 2021-01-28 08:51:11 -08:00
README.md
stage0.txt Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
version Bump version to 1.51 2020-12-25 10:42:53 -05:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.