On Wed, 6 Nov 2019, Alexandre Oliva wrote: > On Nov 4, 2019, Richard Biener <rguent...@suse.de> wrote: > > > I wonder why we shouldn't simply adjust aux_base_name to something > > else for -flto [in the driver]. > > About that, having tried to make sense of the current uses of > aux_base_name and of lto-wrapper, three main possibilities occur to me: > > a) adjust the driver code to accept -auxbase, and have lto-wrapper > explicitly pass -aux-base ${output_dir-.}/$(lbasename ${output_name}) or > somesuch for each -fltrans command; > > b) introduce -auxdir and get lto-wrapper to pass -auxdir ${output_dir-.} > for each -fltrans (and offload) command; or > > c) get -fltrans to implicitly adjust aux_base_name with the directory > passed to -dumpdir, if any, or . otherwise > > Any preferences?
A simple test shows we currently only pass -auxbase-strip /tmp/cc...o to the LTRANS lto1 invocation plus -dumpbase cc...o Even with -save-temps this doesn't "improve" unless you have an explicit output via -o So isn't one of the main issues that the naming of the auxiliar files is based on some "temporary" file? IMHO those should always behave like if we passed -save-temps but I'm not sure how to achieve that. For example -dumpdir and -dumpbase seem to work like this already so there must be code somewhere doing this and adjusting -auxbase[-strip] to work the same way would make sense to me. Doesn't really solve the case for "no output name given" (aka a.out default) though - I suppose for dumping and auxiliar file naming purpose we should simply assume -o a.out there? Thanks, Richard.