aboutsummaryrefslogtreecommitdiffstats
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
parent3ead31aa7b26ef9e65aa73bbd2282f9119793a29 (diff)
downloadydb-48c9d1b2fbc2dfd902cdcbde1623bc2c942e0913.tar.gz
-rw-r--r--build/conf/compilers/gnu_compiler.conf4
-rw-r--r--build/conf/linkers/ld.conf1
-rw-r--r--build/scripts/link_exe.py11
3 files changed, 8 insertions, 8 deletions
diff --git a/build/conf/compilers/gnu_compiler.conf b/build/conf/compilers/gnu_compiler.conf
index aedbfaeedc..4f22f300db 100644
--- a/build/conf/compilers/gnu_compiler.conf
+++ b/build/conf/compilers/gnu_compiler.conf
@@ -53,10 +53,10 @@ elsewhen ($PIE == "yes") {
LDFLAGS+=-fPIE -pie
}
+CLANG_VER=14
when ($CLANG16 == "yes") {
CFLAGS+=-Wno-array-parameter -Wno-deprecate-lax-vec-conv-all -Wno-unqualified-std-cast-call -Wno-unused-but-set-parameter -Wno-unused-command-line-argument -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-int-conversion -Wno-incompatible-function-pointer-types -Wno-implicit-int -Wno-address-of-packed-member
- # naughty, naughty
- LDFLAGS+=-L/CLANG16_YES_PLEASE
+ CLANG_VER=16
}
when ($MSAN_TRACK_ORIGIN == "yes") {
diff --git a/build/conf/linkers/ld.conf b/build/conf/linkers/ld.conf
index f875796001..8c191a251a 100644
--- a/build/conf/linkers/ld.conf
+++ b/build/conf/linkers/ld.conf
@@ -194,6 +194,7 @@ LINK_SCRIPT_EXE_FLAGS=
REAL_LINK_EXE_CMDLINE =\
$YMAKE_PYTHON ${input:"build/scripts/link_exe.py"} \
--source-root $ARCADIA_ROOT
+REAL_LINK_EXE_CMDLINE+=--clang-ver $CLANG_VER
REAL_LINK_EXE_CMDLINE+=$_LD_LINKER_OUTPUT
REAL_LINK_EXE_CMDLINE+=\
${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \
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):