]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcn/mkoffload: Cleanup temporary dbgobj file
authorTobias Burnus <tobias@codesourcery.com>
Tue, 23 Aug 2022 09:35:01 +0000 (11:35 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Tue, 23 Aug 2022 09:35:01 +0000 (11:35 +0200)
The file (suffix ".mkoffload.dbg.o") used to save the dbgobj data
data has to be passed to maybe_unlink for cleanup or -v -save-temps stderr
diagnostic. That was missed before.

This is a partial backport of commit r13-2125, "mkoffload: Cleanup
temporary omp_requires_file", only for GCN's mkoffload and its dbgobj
file as 'omp requires' is not supported on GCC 12 and, hence,
omp_requires_file does not exist on this branch.

gcc/ChangeLog:

* config/gcn/mkoffload.cc (main): Add dbgobj to files_to_cleanup.

(cherry picked from commit 713ec97e593bd4d9915a13bc4047f064fec0e24a)

gcc/config/gcn/mkoffload.cc

index 94ba7ffa5af4e794973f7c376c5c2d389f7a2e90..a8b1b6e05c215f2b2e52f14f67d239a2d8cbed33 100644 (file)
@@ -1082,6 +1082,7 @@ main (int argc, char **argv)
                    }
                  else
                    dbgobj = make_temp_file (".mkoffload.dbg.o");
+                 obstack_ptr_grow (&files_to_cleanup, dbgobj);
 
                  /* If the copy fails then just ignore it.  */
                  if (copy_early_debug_info (argv[ix], dbgobj))