diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-10-13 15:19:51 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-10-13 15:19:51 +0200 |
commit | 7287cf184e3aef6e55da717c7acc86cf02500e79 (patch) | |
tree | 97b3615bea7ded42fcfbb4356c63ea1af2e8a6de /gcc | |
parent | a673744dee7a80e6525fb0da87d053c8ccab6275 (diff) | |
download | gcc-7287cf184e3aef6e55da717c7acc86cf02500e79.zip gcc-7287cf184e3aef6e55da717c7acc86cf02500e79.tar.gz gcc-7287cf184e3aef6e55da717c7acc86cf02500e79.tar.bz2 |
lto-wrapper: Use nontemp filename with -save-temps
gcc/ChangeLog:
* lto-wrapper.c (find_crtoffloadtable): With -save-temps,
use non-temp file name utilizing the dump prefix.
(run_gcc): Update call.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto-wrapper.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 82cfa6b..4d3cd7a 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1026,7 +1026,7 @@ copy_file (const char *dest, const char *src) the copy to the linker. */ static void -find_crtoffloadtable (void) +find_crtoffloadtable (int save_temps, const char *dumppfx) { char **paths = NULL; const char *library_path = getenv ("LIBRARY_PATH"); @@ -1039,7 +1039,11 @@ find_crtoffloadtable (void) if (access_check (paths[i], R_OK) == 0) { /* The linker will delete the filename we give it, so make a copy. */ - char *crtoffloadtable = make_temp_file (".crtoffloadtable.o"); + char *crtoffloadtable; + if (!save_temps) + crtoffloadtable = make_temp_file (".crtoffloadtable.o"); + else + crtoffloadtable = concat (dumppfx, "crtoffloadtable.o"); copy_file (crtoffloadtable, paths[i]); printf ("%s\n", crtoffloadtable); XDELETEVEC (crtoffloadtable); @@ -1698,7 +1702,7 @@ cont1: if (offload_names) { - find_crtoffloadtable (); + find_crtoffloadtable (save_temps, dumppfx); for (i = 0; offload_names[i]; i++) printf ("%s\n", offload_names[i]); free_array_of_ptrs ((void **) offload_names, i); |