You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmake/macros/rv_stage.cmake
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,28 @@ FUNCTION(rv_stage)
78
78
)
79
79
IF(arg_TYPE IN_LIST _rv_stage_binary_types)
80
80
RV_GENERATE_SYMBOLS(TARGET${arg_TARGET})
81
+
82
+
# Release builds compile with -g so dump_syms can extract Breakpad .sym files (see docs/crash-reporting.md section 7). On Linux the shipped artifact is the
83
+
# stage tree itself, so leaving the DWARF in the staged ELF would ship full debug info to customers. Strip it here -- AFTER RV_GENERATE_SYMBOLS has run
84
+
# dump_syms on the real ELF, and BEFORE the .bin rename below -- so the shipped binaries carry no DWARF while the symbols live only in the symbols_archive
85
+
# zip. --strip-debug keeps .symtab and, crucially, the GNU build-id that the .sym directory tree is keyed on, so offline symbolication still matches. This
86
+
# is gated on Release + Linux only (not on the Breakpad version, per contract C6): macOS Mach-O binaries do not embed DWARF (it stays in the dSYM, which
87
+
# rv_generate_symbols.cmake produces then deletes), so they are not bloated and need no strip.
88
+
#
89
+
# strip_debug_safe.sh (not a bare `strip`) guards against a GNU strip bug that corrupts binaries whose layout triggers the "'.dynstr' not in segment"
90
+
# warning: it strips to a temp copy and only replaces the original when strip is warning- and error-free, otherwise it leaves the binary unstripped. RV's
91
+
# own compiled targets strip cleanly; the guard protects any that do not.
92
+
IF(RV_TARGET_LINUX
93
+
ANDCMAKE_BUILD_TYPESTREQUAL"Release"
94
+
)
95
+
ADD_CUSTOM_COMMAND(
96
+
TARGET${arg_TARGET}
97
+
POST_BUILD
98
+
COMMENT"Stripping DWARF debug info from ${arg_TARGET} (symbols archived separately)"
0 commit comments