From 3896f0762715092a4f6dfc81b38ba69080192bcd Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Mon, 1 Apr 2024 12:44:49 -0700 Subject: [PATCH] Note impact of `-Cstrip` on backtraces It is not always clear to people what the impact of `-Cstrip` options are. They are a common question on sites like StackOverflow, and sometimes people even report bugs with "no backtrace" after deliberately mangling the symbol table. We cannot exhaustively document every permutation, but we should warn people about common effects. --- src/doc/rustc/src/codegen-options/index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index 4a4f1ae98e4..5667f0e02ce 100644 --- a/src/doc/rustc/src/codegen-options/index.md +++ b/src/doc/rustc/src/codegen-options/index.md @@ -553,9 +553,12 @@ Supported values for this option are: of MSVC). - `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. + 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 if the linker supports it. + stripped as well if the linker supports it. On platforms which depend on the + binary's symbol table for backtraces, this can affect them so negatively as to + make the trace completely incomprehensible. ## symbol-mangling-version