]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto-wrapper.cc: Add offload target name to 'offload_args' suffix
authorTobias Burnus <tburnus@baylibre.com>
Wed, 3 Apr 2024 13:47:12 +0000 (15:47 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Wed, 3 Apr 2024 13:47:12 +0000 (15:47 +0200)
lto-wrapper.cc's compile_offload_image calls mkoffload with
an @./a.offload_args argument ('a.' in case of, e.g., 'a.out'). However,
when generating code for both nvptx and gcn, they use the same name
with -save-temps. Hence, this commit adds a <target> + '.' before
'offload_args' in line with other offload-target-specific files.

gcc/ChangeLog:

* lto-wrapper.cc (compile_offload_image): Prefix 'offload_args'
suffix by the target name.

gcc/lto-wrapper.cc

index ca53e4b462eb0e4190604e051be56d1195d80b26..610594cdc2baff5b4df3cf7e7c1b5dbffa12d3ba 100644 (file)
@@ -993,7 +993,8 @@ compile_offload_image (const char *target, const char *compiler_path,
 
   obstack_ptr_grow (&argv_obstack, NULL);
   argv = XOBFINISH (&argv_obstack, char **);
-  fork_execute (argv[0], argv, true, "offload_args");
+  suffix = concat (target, ".offload_args", NULL);
+  fork_execute (argv[0], argv, true, suffix);
   obstack_free (&argv_obstack, NULL);
 
   free_array_of_ptrs ((void **) paths, n_paths);