aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2024-05-08 00:55:05 +0200
committerDylan Baker <dylan@pnwbakers.com>2024-05-07 22:32:35 -0700
commit89a5bde9d98ecc96bb462872bb2d83ac762ffc08 (patch)
tree4a3e7ee5dc8009a884a1c62cffcf309580eb1669 /mesonbuild/backend
parentc55ca8272c536d439253d38600f3c9e445b1edf7 (diff)
downloadmeson-89a5bde9d98ecc96bb462872bb2d83ac762ffc08.zip
meson-89a5bde9d98ecc96bb462872bb2d83ac762ffc08.tar.gz
meson-89a5bde9d98ecc96bb462872bb2d83ac762ffc08.tar.bz2
cuda: pass static archives to nvcc without -Xlinker= prefix
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index a45de70..740f349 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1080,6 +1080,15 @@ class Backend:
continue
if compiler.get_language() == 'd':
arg = '-Wl,' + arg
+ elif compiler.get_linker_id() == 'nvlink' and arg.endswith('.a'):
+ # We need to pass static archives without -Xlinker= to nvcc,
+ # since they may contain relocatable device code. When passing
+ # the static archive to nvcc with -Xlinker=, we bypass the
+ # frontend which means we lose the opportunity to perform device
+ # linking. We only need to do this for static archives, since
+ # nvcc doesn't support device linking with dynamic libraries:
+ # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#libraries
+ pass
else:
arg = compiler.get_linker_lib_prefix() + arg
args.append(arg)