Group :: Development/C
RPM: llvm12.0
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: clang-ALT-bug-40628-grecord-command-line.patch
Download
Download
--- a/tools/clang/lib/Driver/ToolChains/Clang.cpp 2021-06-28 16:23:38.000000000 +0000
+++ b/tools/clang/lib/Driver/ToolChains/Clang.cpp 2021-09-11 09:04:24.160000000 +0000
@@ -6264,10 +6264,10 @@
// section, for build analysis.
// Also record command line arguments into the debug info if
// -grecord-gcc-switches options is set on.
- // By default, -gno-record-gcc-switches is set on and no recording.
+ // By default, -grecord-gcc-switches is set on and the arguments are recorded.
auto GRecordSwitches =
Args.hasFlag(options::OPT_grecord_command_line,
- options::OPT_gno_record_command_line, false);
+ options::OPT_gno_record_command_line, true);
auto FRecordSwitches =
Args.hasFlag(options::OPT_frecord_command_line,
options::OPT_fno_record_command_line, false);
--- a/tools/clang/docs/ClangCommandLineReference.rst 2021-06-28 16:23:38.000000000 +0000
+++ b/tools/clang/docs/ClangCommandLineReference.rst 2021-09-11 09:04:24.160000000 +0000
@@ -3521,6 +3521,19 @@
.. option:: -grecord-command-line, -gno-record-command-line, -grecord-gcc-switches
+This switch causes the command-line options used to invoke the compiler driver
+to be appended to the DW_AT_producer attribute in DWARF debugging information.
+
+Unlike its GCC equivalent, it does not yet exclude compiler options that do not
+affect code generation.
+
+ALT note: '-grecord-command-line' is enabled by default in ALT, but disabled in
+upstream Clang.
+Upstream `does not really care <https://bugs.llvm.org/show_bug.cgi?id=32226>`_
+if it is enabled by default, but happened to lean the other way, unlike the GCC
+upstream. Since the option does not affect generated code (only the debug
+symbols), we believe it is not disruptive for us to use a different default.
+
.. option:: -gsplit-dwarf
.. program:: clang1