aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2021-07-18 23:14:39 +0200
committerDavid Seifert <soap@gentoo.org>2021-07-18 23:14:39 +0200
commit4f56080ce2e2d1eccc2a809b284a48328690be3d (patch)
tree765def67c77133601b93086e1a17fdbb6162b0d8
parent28d13f4bfe57ec7ae1afd178fab997582a9e286e (diff)
downloadmeson-4f56080ce2e2d1eccc2a809b284a48328690be3d.zip
meson-4f56080ce2e2d1eccc2a809b284a48328690be3d.tar.gz
meson-4f56080ce2e2d1eccc2a809b284a48328690be3d.tar.bz2
Cuda: Fix linking with shared versioned internal libs
-rw-r--r--mesonbuild/linkers/linkers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index 831a381..db85007 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -1397,8 +1397,6 @@ class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker):
return False
def get_lib_prefix(self) -> str:
- if not mesonlib.is_windows():
- return ''
# nvcc doesn't recognize Meson's default .a extension for static libraries on
# Windows and passes it to cl as an object file, resulting in 'warning D9024 :
# unrecognized source file type 'xxx.a', object file assumed'.
@@ -1406,6 +1404,12 @@ class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker):
# nvcc's --library= option doesn't help: it takes the library name without the
# extension and assumes that the extension on Windows is .lib; prefixing the
# library with -Xlinker= seems to work.
+ #
+ # On Linux, we have to use rely on -Xlinker= too, since nvcc/nvlink chokes on
+ # versioned shared libraries:
+ #
+ # nvcc fatal : Don't know what to do with 'subprojects/foo/libbar.so.0.1.2'
+ #
from ..compilers import CudaCompiler
return CudaCompiler.LINKER_PREFIX