<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57990>57990</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Debug flags not propagated correctly for OpenMP with offload-lto
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
markdewing
</td>
</tr>
</table>
<pre>
When targeting the nvidia backend, using -foffload-lto with -g will result in `ptxas fatal : Optimized debugging not supported`
The options to clang `-g -O2 -foffload-lto -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda` will produce the error. From the verbose output, the options passed to ptxas are ` -m64 -v -O2 --gpu-name sm_61 -g` (input and output files removed for clarity)
Without `-foffload-lto`, the debug option gets translated to `-lineinfo` for ptxas.
Passing a more restricted debug flag at the original command line, like `-gline-tables-only` or `-gline-directives-only` doesn't work - they still get translated into `-g` for ptxas.
I think the issue is at the clang-linker-wrapper stage - all the debug flags get converted to a single `--device-debug` option, which sends `-g` to ptxas.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U82OmzAQfhq4jBwBIWw4cNg2WqmHavdQqcfK4IG4MTayDWn69B2bpEGVKkWAM575fmamNeLWfD-jBs_tgF7qAfwZQS9SSA4t7y6oRVJ8htmFGOtN3yvDBVPewFX6M7CB3kqBRTcrD1JDUmWT_8Ud9NxzBQDJ_hXeJy9H-RsFCGznYQjVtPHg5mky1qOgrCQ7Jdnr-vxGLAzlGO2AoDrFKYHuEBx7L_4hQqcJ9Tj9_WCrHJfsT3ohMlXJVkmsmwWnMivnyRoxdxglo7XG7uDNmjGeF7StcURi9tPsgwV-Q2nizpEWwl6lcouBHbCxKoEtK0c2TDPTfERw448qJ6vClaQ4Sk0lgWtxrw69VOjIwtEsVLU3Ngi20t-Sot668p0cp5RoxNaBYN6dYbT3zhOCB-At105xv_INqUpqlLoPaREsathtgT5IX2gRh9GQNGqut7Lzj_ZBrzgF_eqJldRO6nRnxjGICuUDHSUvuPYs_EM9aUklM1rdAjDhPmNCWuy8XDZxYdDppHjxcDX2Aixg3cD50DjStZUl9V3Y8H9FXyhf6ktkLJ2bw_OhIE5XcOWCll0tnya0hMQHJFhOeE9jg3AX8TujaUburnIIdqlVLhO4yI5EhYwoNXYjWHI9y-4MjpbKPQk_pmgHW8IpNnlVlUVelHmWimYv6n3NUy-9wua0IRPWiCZ54kM0ozM2eKlu0Yh32oevH-uqbgYmna1qzt5PtCKvSfFGv4GuzO2OmkgHpZbHi1Htn1SQjtE3Rx-Hl7rO0nNzzDJxqNq-ErzN86ooay6qvBQiz7r9sRKp4i0q1ySHT0lRaLyu1tN3cjilsimyosjqospf8v0-2_EuR5Efj11f1jmv86TMcORS7QKPnbFDaptIicQ7CirpvHsGw8wOGjHCUX0-07bYZuT2IvBK_UkjehPZ_wEKRKk1">