RFC: Exclude -fplugin and -fplugin-arg from DW_AT_producer
Proposes excluding -fplugin and -fplugin-arg options from DW_AT_producer debug metadata to improve reproducibility.
This RFC proposes excluding -fplugin and -fplugin-arg options from the DW_AT_producer debug metadata. Currently, these options can embed absolute, host-specific plugin paths into object files, harming reproducibility. The author suggests using the existing NoDWARFRecord mechanism to prevent this, as has been done for other path-containing options. The tradeoff is between improved reproducibility and slightly reduced debugging information provenance.
In Details
This RFC addresses the recording of GCC command-line options in the DW_AT_producer DWARF attribute. Specifically, it targets the -fplugin and -fplugin-arg flags, which currently embed absolute paths to loaded plugins into the debug information. The proposal uses the NoDWARFRecord mechanism to exclude these options, aiming to enhance build reproducibility by removing host-specific path information from the generated object files.
- DW_AT_producer
- A DWARF debugging information attribute that records information about the program and compilation environment that produced the debug information, often including compiler version and command-line options.
- DWARF
- A debugging data format used by many compilers and debuggers to store information about compiled programs, enabling features like source-level debugging.
- Reproducibility
- The ability to consistently obtain the same output (e.g., compiled binary, debug information) from the same source input and build environment.
- NoDWARFRecord
- A GCC mechanism that flags compiler options to prevent them from being recorded in the DW_AT_producer DWARF attribute.