<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60767>60767</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[OpenMP] Compiling for NVPTX with `save-temps` and `-foffload-lto` fails to find the cubin
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:driver
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
jhuber6
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jhuber6
</td>
</tr>
</table>
<pre>
The following compiler invocation causes the following error.
```bash
$ clang foo.c -fopenmp --offload-arch=sm_86 -save-temps -foffload-lto
...
nvlink fatal : Could not open input file 'foo.nvptx64-nvidia-cuda.sm_86.cubin'
```
This is caused by bogus logic in the NVPTX toolchain for setting whether or not the output should be called `.o` or `.cubin`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcks9u3CwUxZ8Gb65sMTDGmYUX82U0u6_NIqq6qwCDIWW4FuBJ8_aVGUtRKln-g4655_w4Mmc_R2NG0v9HGHtzqzJJEMZIf2nkWhymcV9sFE4f46szYDEEfPdxBo23xQeTwMc7alk8RtByzSZD-SI0KWHqCL0QeiaCPi4ls9uX2BF0kHEGi9hpaC0uJt4WaFu0NqCcWpm0I_ySb7-eBLRZ3k1bzG3Jm3aXhIKP7bpuHxXvwcffYGWRAQAIP8MzrmGCiAW2EeDjshawPhggbNimx_tS_ohjG-9-8rLV6yS7OrXTq_KRsOGfGPtnvb86n8HnB4QJ1AconNcMAWevwceK5duPl9efUBCDdtJHsJggm1I2UO_OFGcSYKoeNzmuZfOYXXWuDGgZgpmACNohEXTTbu8Pe4J2zTTy6cRPsjHjQQziKJ7YcGrcKPhx4EfVa3lQXAnN9XDQlIr-NCn5dLKNHxllnLJDf-B86E_dwXDL-dRLbvjJCkuO1NykD10I91uHaW58zqsZBR3E0ASpTMh7l-p5En6ekr-btFcqjduPrVrnTI40-Fzy51bFl1Cb-H0x8f8X0l_guRbM12KkHdy7L24L_NmBDQLIWJF8rYOgYKUPGQqC9XGqQCuoZk1hdKUsmfAzYVfCrrMvblWdxhth183V_miXhG9GF8KuNW0m7FoD_w0AAP__CWUKyw">