lto-plugin - support -save-temps, -v, --version

Programming / Compilers / GCC - iains [138bc75d-0d04-0410-961f-82ee72b054a4] - 15 May 2019 09:12 EDT

This patch makes the lto-plugin follow the same approach to save-temps as collect2.

-save-temps causes the temp file to be named meaningfully, and for the relevant input files to be saved in CWD.

-v, —version causes the save actions to be output to stderr.

one can get this to happen by just putting -save-temps, -v on the regular link line or (for compatibility with the way the
-debug flag works) by appending -plugin-opt=-save-temps, etc.

lto-plugin/

2019-05-15 Iain Sandoe

- lto-plugin.c (exec_lto_wrapper): Make the wrapper arguments filename more user-friendly. (file_exists, maybe_unlink): New. (cleanup_handler): Use maybe unlink to handle the case when temps should be saved. (process_option): Look for -v, —-version, -save-temps. (onload): Record the linker output file name. Check for -v, —-version, -save-temps in the GCC collect options environment.

788afe4e5c7 lto-plugin - support -save-temps, -v, --version.
lto-plugin/ChangeLog | 12 ++++++
lto-plugin/lto-plugin.c | 97 ++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 88 insertions(+), 21 deletions(-)

Upstream: gcc.gnu.org


  • Share