On 5/14/19 6:45 PM, Iain Sandoe wrote: > Currently the lto plugin has a somewhat obscure incantation to get it to save > its temp files, and at least one is not named in any sensible way for > development examination. > > This patch makes it follow the same approach 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. > > (the latter change might be a bit OTT, I was in two minds about deleting that > part, but …) > > tested on x86_64-linux-gnu. > > OK for trunk? > Iain > > lto-plugin/ > > * 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 GCC collect > options environment. >
Hi. I see: libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/home/marxin/Programming/gcc/lto-plugin -I/home/marxin/Programming/gcc/lto-plugin/../include -DHAVE_CONFIG_H -Wall -g -O2 -c /home/marxin/Programming/gcc/lto-plugin/lto-plugin.c -fPIC -DPIC -o .libs/lto-plugin.o /home/marxin/Programming/gcc/lto-plugin/lto-plugin.c: In function ‘cleanup_handler’: /home/marxin/Programming/gcc/lto-plugin/lto-plugin.c:809:7: warning: unused variable ‘t’ [-Wunused-variable] int t; ^ Please take a look. Martin