diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-03-11 13:02:00 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2022-03-11 13:02:00 +0100 |
commit | db494fd68d12f3b49ad5f4747c234f3a94d10c72 (patch) | |
tree | 69b838aa7970119adec887cdfe9301d7a6fb76c5 /lto-plugin/lto-plugin.c | |
parent | 1375e2b62332351a8f9c928421cd1ea8b53c5127 (diff) | |
download | gcc-db494fd68d12f3b49ad5f4747c234f3a94d10c72.zip gcc-db494fd68d12f3b49ad5f4747c234f3a94d10c72.tar.gz gcc-db494fd68d12f3b49ad5f4747c234f3a94d10c72.tar.bz2 |
lto-plugin: Honor link_output_name for -foffload-objects file name
lto-plugin/ChangeLog:
* lto-plugin.c (all_symbols_read_handler): With -save-temps, use
link_output_name for -foffload-objects's file name, if available.
Diffstat (limited to 'lto-plugin/lto-plugin.c')
-rw-r--r-- | lto-plugin/lto-plugin.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c index 593fbc9..33d4957 100644 --- a/lto-plugin/lto-plugin.c +++ b/lto-plugin/lto-plugin.c @@ -799,8 +799,15 @@ all_symbols_read_handler (void) char *arg; char *offload_objects_file_name; struct plugin_offload_file *ofld; + const char *suffix = ".ofldlist"; - offload_objects_file_name = make_temp_file (".ofldlist"); + if (save_temps && link_output_name) + { + suffix += skip_in_suffix; + offload_objects_file_name = concat (link_output_name, suffix, NULL); + } + else + offload_objects_file_name = make_temp_file (suffix); check (offload_objects_file_name, LDPL_FATAL, "Failed to generate a temporary file name"); f = fopen (offload_objects_file_name, "w"); |