diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-10-20 12:14:03 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-10-20 12:14:03 +0200 |
commit | b3032d1b84b8ab683f2d7345b6a2d9f783fe946d (patch) | |
tree | 2345e5f70560519d7a5fa83cd65ef61e147ee797 /gcc/collect-utils.c | |
parent | 00b355522b7843f4d9d93172aa7521b223b77587 (diff) | |
download | gcc-b3032d1b84b8ab683f2d7345b6a2d9f783fe946d.zip gcc-b3032d1b84b8ab683f2d7345b6a2d9f783fe946d.tar.gz gcc-b3032d1b84b8ab683f2d7345b6a2d9f783fe946d.tar.bz2 |
collect-utils.c, lto-wrapper + mkoffload: Improve -save-temps filename
gcc/ChangeLog:
* collect-utils.c (collect_execute, fork_execute): Add at-file suffix
argument.
* collect-utils.h (collect_execute, fork_execute): Update prototype.
* collect2.c (maybe_run_lto_and_relink, do_link, main, do_dsymutil):
Update calls by passing NULL.
* config/i386/intelmic-mkoffload.c (compile_for_target,
generate_host_descr_file, prepare_target_image, main): Likewise.
* config/gcn/mkoffload.c (compile_native, main): Pass at-file suffix.
* config/nvptx/mkoffload.c (compile_native, main): Likewise.
* lto-wrapper.c (compile_offload_image): Likewise.
Diffstat (limited to 'gcc/collect-utils.c')
-rw-r--r-- | gcc/collect-utils.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/collect-utils.c b/gcc/collect-utils.c index d4fa2c3..095db8d 100644 --- a/gcc/collect-utils.c +++ b/gcc/collect-utils.c @@ -104,7 +104,8 @@ do_wait (const char *prog, struct pex_obj *pex) struct pex_obj * collect_execute (const char *prog, char **argv, const char *outname, - const char *errname, int flags, bool use_atfile) + const char *errname, int flags, bool use_atfile, + const char *atsuffix) { struct pex_obj *pex; const char *errmsg; @@ -126,7 +127,10 @@ collect_execute (const char *prog, char **argv, const char *outname, /* Note: we assume argv contains at least one element; this is checked above. */ - response_file = make_temp_file (""); + if (!save_temps || !atsuffix) + response_file = make_temp_file (""); + else + response_file = concat (dumppfx, atsuffix, NULL); f = fopen (response_file, "w"); @@ -202,12 +206,13 @@ collect_execute (const char *prog, char **argv, const char *outname, } void -fork_execute (const char *prog, char **argv, bool use_atfile) +fork_execute (const char *prog, char **argv, bool use_atfile, + const char *atsuffix) { struct pex_obj *pex; pex = collect_execute (prog, argv, NULL, NULL, - PEX_LAST | PEX_SEARCH, use_atfile); + PEX_LAST | PEX_SEARCH, use_atfile, atsuffix); do_wait (prog, pex); } |