aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-03-08 15:28:51 +0100
committerEli Schwartz <eschwartz93@gmail.com>2025-03-09 18:06:14 -0400
commit42a8cfc32b71b0d0c8c75e1337482b4a86922efa (patch)
treec2f12bd3ce7addcecc2d13e4df64cda257699a8d /docs/markdown/snippets
parent35ebae55412feed9d91e78138e02f0cf42681d65 (diff)
downloadmeson-42a8cfc32b71b0d0c8c75e1337482b4a86922efa.zip
meson-42a8cfc32b71b0d0c8c75e1337482b4a86922efa.tar.gz
meson-42a8cfc32b71b0d0c8c75e1337482b4a86922efa.tar.bz2
compilers/cuda: fix checking for multiple linker args
When checking for multiple linker args we convert the supplied args to flags that the compiler understands. But besides these supplied args, we also try to convert linker flags that convert warnings into errors. This mechanism causes an error though because we don't know to convert these flags to linker flags: gcc: error: unrecognized command-line option '--warning-as-error'; did you mean '--warn-no-error'? ----------- ERROR: Linker nvcc does not support sanitizer arguments ['-Xcompiler=-fsanitize=address\\,undefined'] As you can see, the flag is passed to the underlying compiler, not to the underlying linker. The obvious fix would be to convert them to linker flags, which we can do by using `-Xlinker=` instead of `-Xcompiler=`. But that is incorrect, too: /nix/store/j7p46r8v9gcpbxx89pbqlh61zhd33gzv-binutils-2.43.1/bin/ld: unrecognized option '--warning-as-error' /nix/store/j7p46r8v9gcpbxx89pbqlh61zhd33gzv-binutils-2.43.1/bin/ld: use the --help option for usage information collect2: error: ld returned 1 exit status ----------- ERROR: Linker nvcc does not support sanitizer arguments ['-Xcompiler=-fsanitize=address\\,undefined'] Now we ended up passing the flag to the underlying linker, but the `--warning-as-error` flag isn't known by it. What we really ought to do is to pass on the flag to nvlink, which is the linker driver that controls the underlying linker. Do so by using `-Xnvlink=`, which fixes the bug. Signed-off-by: Patrick Steinhardt <ps@pks.im>
Diffstat (limited to 'docs/markdown/snippets')
0 files changed, 0 insertions, 0 deletions