diff options
| author | bors <bors@rust-lang.org> | 2024-04-22 12:05:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-22 12:05:39 +0000 |
| commit | 7f2fc33da6633f5a764ddc263c769b6b2873d167 (patch) | |
| tree | 728abf2769d6560a625952183307b22ae709961e /src/doc | |
| parent | 290d792411566c94273e5d1a980a1ab91f1d950b (diff) | |
| parent | e82f46ab7226b69b29d5265c94647eeb5ca1e278 (diff) | |
| download | rust-7f2fc33da6633f5a764ddc263c769b6b2873d167.tar.gz rust-7f2fc33da6633f5a764ddc263c769b6b2873d167.zip | |
Auto merge of #115120 - icedrocket:ignore-strip-on-msvc, r=michaelwoerister
Ignore `-C strip` on MSVC tl;dr - Define `-Cstrip` to only ever affect the binary; no other build artifacts. This is necessary to improve cross-platform behavior consistency: if someone wanted debug information to be contained only in separate files on all platforms, they would set `-Cstrip=symbols` and `-Csplit-debuginfo=packed`, but this would result in no PDB files on MSVC. Resolves #114215
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustc/src/codegen-options/index.md | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index 35bf2c27ff1..673ff12b5ce 100644 --- a/src/doc/rustc/src/codegen-options/index.md +++ b/src/doc/rustc/src/codegen-options/index.md @@ -568,22 +568,23 @@ data from binaries during linking. Supported values for this option are: -- `none` - debuginfo and symbols (if they exist) are copied to the produced - binary or separate files depending on the target (e.g. `.pdb` files in case - of MSVC). +- `none` - debuginfo and symbols are not modified. - `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table - section are stripped at link time and are not copied to the produced binary - or separate files. This should leave backtraces mostly-intact but may make - using a debugger like gdb or lldb ineffectual. -- `symbols` - same as `debuginfo`, but the rest of the symbol table section is stripped as well, - depending on platform support. On platforms which depend on this symbol table for backtraces, - profiling, and similar, this can affect them so negatively as to make the trace incomprehensible. - Programs which may be combined with others, such as CLI pipelines and developer tooling, - or even anything which wants crash-reporting, should usually avoid `-Cstrip=symbols`. - -Note that, at any level, removing debuginfo only necessarily impacts "friendly" introspection. -`-Cstrip` cannot be relied on as a meaningful security or obfuscation measure, as disassemblers -and decompilers can extract considerable information even in the absence of symbols. + section are stripped at link time and are not copied to the produced binary. + This should leave backtraces mostly-intact but may make using a debugger like + gdb or lldb ineffectual. Prior to 1.79, this unintentionally disabled the + generation of `*.pdb` files on MSVC, resulting in the absence of symbols. +- `symbols` - same as `debuginfo`, but the rest of the symbol table section is + stripped as well, depending on platform support. On platforms which depend on + this symbol table for backtraces, profiling, and similar, this can affect + them so negatively as to make the trace incomprehensible. Programs which may + be combined with others, such as CLI pipelines and developer tooling, or even + anything which wants crash-reporting, should usually avoid `-Cstrip=symbols`. + +Note that, at any level, removing debuginfo only necessarily impacts "friendly" +introspection. `-Cstrip` cannot be relied on as a meaningful security or +obfuscation measure, as disassemblers and decompilers can extract considerable +information even in the absence of symbols. ## symbol-mangling-version |
