aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-01-31 17:22:33 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-01-31 17:22:33 +0300
commit52be5dbdd420165c68e7e90ba8f1d2f00da041f6 (patch)
tree5d47f5b2ff4e6a7c8e75d33931a1e683949b7229 /build/scripts
parentea57c8867ceca391357c3c5ffcc5ba6738b49adc (diff)
parent809f0cf2fdfddfbeacc2256ffdbaaf5808ce5ed4 (diff)
downloadydb-52be5dbdd420165c68e7e90ba8f1d2f00da041f6.tar.gz
Merge branch 'mergelibs12' into main
Diffstat (limited to 'build/scripts')
-rw-r--r--build/scripts/link_exe.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/build/scripts/link_exe.py b/build/scripts/link_exe.py
index 980ac05d7e..4650315b89 100644
--- a/build/scripts/link_exe.py
+++ b/build/scripts/link_exe.py
@@ -52,6 +52,11 @@ def prune_cuda_libraries(cmd, prune_arches, nvprune_exe, build_root):
_, ver = arch.split('_', 1)
return 'compute_{}'.format(ver)
+ libs_to_prune = set(CUDA_LIBRARIES)
+
+ # does not contain device code, nothing to prune
+ libs_to_prune.remove('-lcudart_static')
+
tmp_names_gen = name_generator('cuda_pruned_libs')
arch_args = []
@@ -62,10 +67,10 @@ def prune_cuda_libraries(cmd, prune_arches, nvprune_exe, build_root):
flags = []
cuda_deps = set()
for flag in reversed(cmd):
- if flag in CUDA_LIBRARIES:
+ if flag in libs_to_prune:
cuda_deps.add('lib' + flag[2:] + '.a')
flag += '_pruned'
- elif flag.startswith('-L') and any(f in cuda_deps for f in os.listdir(flag[2:])):
+ elif flag.startswith('-L') and os.path.exists(flag[2:]) and os.path.isdir(flag[2:]) and any(f in cuda_deps for f in os.listdir(flag[2:])):
from_dirpath = flag[2:]
from_deps = list(cuda_deps & set(os.listdir(from_dirpath)))