aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2025-03-24 03:42:34 +0000
committerAlexander Smirnov <alex@ydb.tech>2025-03-24 03:42:34 +0000
commit3df8b53ce7c70b73ace8d17c34f466062e0b7ac1 (patch)
treeafab61cb1a33f19529b7c2a0731408a65832eb6b /build/scripts
parentd7e55a6b32b9591d28485ff45ed016c3e4e6ca0d (diff)
parent1726c59403606d2788b58987a0a52288c0889479 (diff)
downloadydb-main.tar.gz
Merge pull request #16105 from ydb-platform/merge-libs-250324-0050HEADmain
Diffstat (limited to 'build/scripts')
-rw-r--r--build/scripts/go_tool.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/build/scripts/go_tool.py b/build/scripts/go_tool.py
index f7c4a19f9e..7ede536023 100644
--- a/build/scripts/go_tool.py
+++ b/build/scripts/go_tool.py
@@ -32,6 +32,11 @@ COMPILE_OPTIMIZATION_FLAGS = ('-N',)
IGNORED_FLAGS = ['-fprofile-instr-generate', '-fcoverage-mapping']
+def get_sanitizer_libs(peers):
+ MSAN='{}/{}'.format(std_lib_prefix, 'msan').replace('//', '/')
+ ASAN='{}/{}'.format(std_lib_prefix, 'asan').replace('//', '/')
+ return filter(lambda it: it.startswith(MSAN) or it.startswith(ASAN), peers)
+
def get_trimpath_args(args):
return ['-trimpath', args.trimpath] if args.trimpath else []
@@ -527,11 +532,13 @@ def do_link_exe(args):
if args.extldflags is not None:
extldflags.extend(args.extldflags)
cgo_peers = []
- if args.cgo_peers is not None and len(args.cgo_peers) > 0:
+ san_peers = list(get_sanitizer_libs(args.peers))
+ if args.cgo_peers or san_peers:
is_group = args.targ_os == 'linux'
if is_group:
cgo_peers.append('-Wl,--start-group')
cgo_peers.extend(args.cgo_peers)
+ cgo_peers.extend(san_peers)
if is_group:
cgo_peers.append('-Wl,--end-group')
try:
@@ -862,7 +869,7 @@ if __name__ == '__main__':
parser.add_argument('++targ-arch', choices=['amd64', 'x86', 'arm64'], required=True)
parser.add_argument('++peers', nargs='*')
parser.add_argument('++non-local-peers', nargs='*')
- parser.add_argument('++cgo-peers', nargs='*')
+ parser.add_argument('++cgo-peers', nargs='*', default=[])
parser.add_argument('++asmhdr', nargs='?', default=None)
parser.add_argument('++test-import-path', nargs='?')
parser.add_argument('++test-miner', nargs='?')