On Thu, 6 Mar 2025, Michal Jires wrote:
> Incremental LTO disabled cleanup of output_files since they have to
> persist in ltrans cache.
> This unintetionally also kept temporary early debug "*.debug.temp.o"
> files.
>
> Bootstrapped/regtested on x86_64-linux.
> Ok for trunk?
So are the early debug files then re-generated for each new
incremental LTO link? That's possibly an area for improvement then
(well, how we handle early debug needs some improvements).
OK.
Thanks,
Richard.
> lto-plugin/ChangeLog:
>
> * lto-plugin.c (cleanup_handler): Keep only files in ltrans
> cache.
> ---
> lto-plugin/lto-plugin.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
> index 3d272551fed..09d5441ecc7 100644
> --- a/lto-plugin/lto-plugin.c
> +++ b/lto-plugin/lto-plugin.c
> @@ -945,6 +945,17 @@ cleanup_handler (void)
> if (!flto_incremental)
> for (i = 0; i < num_output_files; i++)
> maybe_unlink (output_files[i]);
> + else
> + {
> + /* Keep files in ltrans cache. */
> + const char* suffix = ".ltrans.o";
> + for (i = 0; i < num_output_files; i++)
> + {
> + int offset = strlen (output_files[i]) - strlen (suffix);
> + if (offset < 0 || strcmp (output_files[i] + offset, suffix))
> + maybe_unlink (output_files[i]);
> + }
> + }
>
> free_2 ();
> return LDPS_OK;
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)