aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/link_exe.py
diff options
context:
space:
mode:
authorpg <pg@yandex-team.com>2023-11-30 12:25:45 +0300
committerpg <pg@yandex-team.com>2023-11-30 13:37:00 +0300
commit48c9d1b2fbc2dfd902cdcbde1623bc2c942e0913 (patch)
tree0c05c966a61674149abcce8d24c158239a5939cc /build/scripts/link_exe.py
parent3ead31aa7b26ef9e65aa73bbd2282f9119793a29 (diff)
downloadydb-48c9d1b2fbc2dfd902cdcbde1623bc2c942e0913.tar.gz
Diffstat (limited to 'build/scripts/link_exe.py')
-rw-r--r--build/scripts/link_exe.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/build/scripts/link_exe.py b/build/scripts/link_exe.py
index 96fc83e7f6..e0b7c94809 100644
--- a/build/scripts/link_exe.py
+++ b/build/scripts/link_exe.py
@@ -48,7 +48,7 @@ def remove_excessive_flags(cmd):
return flags
-def fix_sanitize_flag(cmd):
+def fix_sanitize_flag(cmd, opts):
"""
Remove -fsanitize=address flag if sanitazers are linked explicitly for linux target.
"""
@@ -56,10 +56,8 @@ def fix_sanitize_flag(cmd):
if flag.startswith('--target') and 'linux' not in flag.lower():
# use toolchained sanitize libraries
return cmd
- if 'CLANG16_YES_PLEASE' in str(cmd):
- CLANG_RT = 'contrib/libs/clang16-rt/lib/'
- else:
- CLANG_RT = 'contrib/libs/clang14-rt/lib/'
+ assert opts.clang_ver
+ CLANG_RT = 'contrib/libs/clang' + opts.clang_ver + '-rt/lib/'
sanitize_flags = {
'-fsanitize=address': CLANG_RT + 'asan',
'-fsanitize=memory': CLANG_RT + 'msan',
@@ -149,6 +147,7 @@ def parse_args():
parser.add_option('--custom-step')
parser.add_option('--python')
parser.add_option('--source-root')
+ parser.add_option('--clang-ver')
parser.add_option('--dynamic-cuda', action='store_true')
parser.add_option('--arch')
parser.add_option('--linker-output')
@@ -166,7 +165,7 @@ if __name__ == '__main__':
if opts.musl:
cmd = fix_cmd_for_musl(cmd)
- cmd = fix_sanitize_flag(cmd)
+ cmd = fix_sanitize_flag(cmd, opts)
if 'ld.lld' in str(cmd):
if '-fPIE' in str(cmd) or '-fPIC' in str(cmd):