summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
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/compilers
parentc55ca8272c536d439253d38600f3c9e445b1edf7 (diff)
downloadmeson-89a5bde9d98ecc96bb462872bb2d83ac762ffc08.tar.gz
cuda: pass static archives to nvcc without -Xlinker= prefix
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/cuda.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 7f7ad7495..3761019b9 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -382,8 +382,11 @@ class CudaCompiler(Compiler):
# This is ambiguously either an MVSC-style /switch or an absolute path
# to a file. For some magical reason the following works acceptably in
# both cases.
+ # We only want to prefix arguments that are NOT static archives, since
+ # the latter could contain relocatable device code (-dc/-rdc=true).
+ prefix = '' if flag.endswith('.a') else f'-X{phase.value}='
wrap = '"' if ',' in flag else ''
- xflags.append(f'-X{phase.value}={wrap}{flag}{wrap}')
+ xflags.append(f'{prefix}{wrap}{flag}{wrap}')
continue
elif len(flag) >= 2 and flag[0] == '-' and flag[1] in 'IDULlmOxmte':
# This is a single-letter short option. These options (with the