The ptxas assembler does not allow the -g flag along with
optimizations. Normally this is degraded to line info in the driver, but
when using LTO we did not have this step and the linker wrapper was not
correctly degrading the option. Note that this will not work if the user
does not pass -g again to the linker invocation. That will require
setting some flags in the binary to indicate that debugging was used
when building.
This fixes #57990