[lld] [RFC] [LLD] [COFF] Restructure /debug: option handling, allow controlling features separately (PR #74820)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 13:02:51 PST 2023


================
@@ -130,9 +130,9 @@ struct Configuration {
   bool forceMultipleRes = false;
   bool forceUnresolved = false;
   bool debug = false;
-  bool debugDwarf = false;
+  bool includeDwarfChunks = false;
----------------
mstorsjo wrote:

Yes, MSVC link.exe just includes any `.debug_whatever` sections as is regardless of `/debug`.

Indeed, for mingw mode, the default is to include any `.debug_*` sections, but it can be overridden if linking with `-S` or `-s` (`--strip-debug` or `--strip-all`). But I'm not really keen on changing this behaviour here on the lld-link level, this is already handled quite nicely by the mingw frontend passing in `/debug:dwarf` or `/debug:symtab` as needed.

I don't think we gain anything really from changing the default of `includeDwarfChunks` to true for mingw mode though. If it would be good for clarity, we could of course invert the meaning of the variable from `includeDwarfChunks` to `discardDwarfChunks`, but that would just be an internal variable rename and negation.

In the end, from the mingw frontend, we need to be able to flag whether to include or dicard dwarf debug info, separately from whether to make a PDB.


https://github.com/llvm/llvm-project/pull/74820


More information about the llvm-commits mailing list