On 09/11/2026 12:55, Tobias Burnus wrote:
As found out by Jeremy, compiling with -save-temps failed when using
a --dumpdir which is neither the current directory nor an absolute
pathname. By default, the dumpdir is the output directory, i.e.
   '-save-temps -o out/myprog'
will use 'out/' and trigger the issue, which looks like:

$ gcc -fopenmp foo.c -save-temps -o out/a.out --dumpdir our/
our/xamdgcn-amdhsa.c:21:8: fatal error: our/xamdgcn-amdhsa.mkoffload.hsaco: No 
such file or directory
    21 | #embed "our/xamdgcn-amdhsa.mkoffload.hsaco" if_empty 
(error_file_is_empty)

The problem is that 'our/xamdgcn-amdhsa.c' is already in the
dump directory - and not in a "our/" subdirectory of it.

Solution: use the basename for #embed, which is what the
attached patch does.

OK for mainline? How about backporting to GCC 16?
OK.

Andrew

Reply via email to