summaryrefslogtreecommitdiffstats
path: root/lto-plugin
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2022-03-11 13:02:00 +0100
committerTobias Burnus <tobias@codesourcery.com>2022-03-11 13:02:00 +0100
commitdb494fd68d12f3b49ad5f4747c234f3a94d10c72 (patch)
tree69b838aa7970119adec887cdfe9301d7a6fb76c5 /lto-plugin
parentlibphobos: Enable on Solaris/SPARC or with /bin/as [PR 103528] (diff)
downloadgcc-db494fd68d12f3b49ad5f4747c234f3a94d10c72.tar.gz
gcc-db494fd68d12f3b49ad5f4747c234f3a94d10c72.tar.bz2
gcc-db494fd68d12f3b49ad5f4747c234f3a94d10c72.tar.xz
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')
-rw-r--r--lto-plugin/lto-plugin.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 593fbc91383..33d49571d0e 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -799,8 +799,15 @@ all_symbols_read_handler (void)
799 char *arg; 799 char *arg;
800 char *offload_objects_file_name; 800 char *offload_objects_file_name;
801 struct plugin_offload_file *ofld; 801 struct plugin_offload_file *ofld;
802 const char *suffix = ".ofldlist";
802 803
803 offload_objects_file_name = make_temp_file (".ofldlist"); 804 if (save_temps && link_output_name)
805 {
806 suffix += skip_in_suffix;
807 offload_objects_file_name = concat (link_output_name, suffix, NULL);
808 }
809 else
810 offload_objects_file_name = make_temp_file (suffix);
804 check (offload_objects_file_name, LDPL_FATAL, 811 check (offload_objects_file_name, LDPL_FATAL,
805 "Failed to generate a temporary file name"); 812 "Failed to generate a temporary file name");
806 f = fopen (offload_objects_file_name, "w"); 813 f = fopen (offload_objects_file_name, "w");