Skip to content

Commit d577949

Browse files
committed
Merge pull request #14555 from ydb-platform/merge-libs-250214-0050
2 parents 01f281d + e45899d commit d577949

File tree

134 files changed

+4139
-2155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4139
-2155
lines changed

build/conf/java.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,6 @@ MANAGED_PEERS=
18501850
MANAGED_PEERS_CLOSURE=
18511851
MANAGEABLE_PEERS_ROOTS=contrib/java
18521852
HAS_MANAGEABLE_PEERS=no
1853-
PROPAGATES_MANAGEABLE_PEERS=no
18541853

18551854
# tag:java-specific
18561855
DEPENDENCY_MANAGEMENT_VALUE=

build/conf/linkers/ld.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ REAL_LINK_EXEC_DYN_LIB_CMDLINE =\
244244
$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"} \
245245
${hide;input:"build/scripts/link_exe.py"} \
246246
--target $TARGET
247+
REAL_LINK_EXEC_DYN_LIB_CMDLINE+=--start-plugins ${ext=.pyplugin:SRCS_GLOBAL} --end-plugins
247248
REAL_LINK_EXEC_DYN_LIB_CMDLINE+=$_LD_LINKER_OUTPUT
248249
REAL_LINK_EXEC_DYN_LIB_CMDLINE+=\
249250
$_ROOT_FLAGS \
@@ -271,6 +272,7 @@ REAL_LINK_DYN_LIB_CMDLINE =\
271272
$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"} \
272273
${hide;input:"build/scripts/link_exe.py"} \
273274
--target $TARGET
275+
REAL_LINK_DYN_LIB_CMDLINE+=--start-plugins ${ext=.pyplugin:SRCS_GLOBAL} --end-plugins
274276
REAL_LINK_DYN_LIB_CMDLINE+=$_LD_LINKER_OUTPUT
275277
REAL_LINK_DYN_LIB_CMDLINE+=\
276278
${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS} \

build/mapping.conf.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@
498498
"7914217459": "https://devtools-registry.s3.yandex.net/7914217459",
499499
"7948644946": "https://devtools-registry.s3.yandex.net/7948644946",
500500
"7994647367": "https://devtools-registry.s3.yandex.net/7994647367",
501+
"8029671029": "https://devtools-registry.s3.yandex.net/8029671029",
501502
"5486731632": "https://devtools-registry.s3.yandex.net/5486731632",
502503
"5514350352": "https://devtools-registry.s3.yandex.net/5514350352",
503504
"5514360398": "https://devtools-registry.s3.yandex.net/5514360398",
@@ -1729,6 +1730,7 @@
17291730
"7914217459": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
17301731
"7948644946": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
17311732
"7994647367": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
1733+
"8029671029": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
17321734
"5486731632": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
17331735
"5514350352": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
17341736
"5514360398": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
2-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018525488)
2+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029723475)
33
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
4-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018523316)
4+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029717949)
55
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
6-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018529985)
6+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029737034)
77
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
8-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018521599)
8+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029713125)
99
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
10-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018527620)
10+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029729848)
1111

1212
ENDIF()
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
2-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018808572)
2+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029664104)
33
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
4-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018807025)
4+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029660543)
55
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
6-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018811524)
6+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029671029)
77
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
8-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018805118)
8+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029657728)
99
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
10-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8018809911)
10+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:8029667517)
1111

1212
ENDIF()

build/scripts/link_dyn_lib.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import print_function
22
import sys
33
import os
4+
import json
45
import subprocess
56
import tempfile
67
import collections
@@ -129,8 +130,6 @@ def fix_windows_param(ex):
129130
return ['/DEF:{}'.format(def_file.name)]
130131

131132

132-
MUSL_LIBS = '-lc', '-lcrypt', '-ldl', '-lm', '-lpthread', '-lrt', '-lutil'
133-
134133
CUDA_LIBRARIES = {
135134
'-lcublas_static': '-lcublas',
136135
'-lcublasLt_static': '-lcublasLt',
@@ -179,14 +178,6 @@ def do_fix(p):
179178
return sum((do_fix(x) for x in c), [])
180179

181180

182-
def fix_cmd_for_musl(cmd):
183-
flags = []
184-
for flag in cmd:
185-
if flag not in MUSL_LIBS:
186-
flags.append(flag)
187-
return flags
188-
189-
190181
def fix_cmd_for_dynamic_cuda(cmd):
191182
flags = []
192183
for flag in cmd:
@@ -208,7 +199,7 @@ def fix_blas_resolving(cmd):
208199
return cmd
209200

210201

211-
def parse_args():
202+
def parse_args(args):
212203
parser = optparse.OptionParser()
213204
parser.disable_interspersed_args()
214205
parser.add_option('--arch')
@@ -218,7 +209,6 @@ def parse_args():
218209
parser.add_option('--build-root')
219210
parser.add_option('--fix-elf')
220211
parser.add_option('--linker-output')
221-
parser.add_option('--musl', action='store_true')
222212
parser.add_option('--dynamic-cuda', action='store_true')
223213
parser.add_option('--cuda-architectures',
224214
help='List of supported CUDA architectures, separated by ":" (e.g. "sm_52:compute_70:lto_90a"')
@@ -229,11 +219,26 @@ def parse_args():
229219
parser.add_option('--custom-step')
230220
parser.add_option('--python')
231221
thinlto_cache.add_options(parser)
232-
return parser.parse_args()
222+
return parser.parse_args(args)
233223

234224

235225
if __name__ == '__main__':
236-
opts, args = parse_args()
226+
args = sys.argv[1:]
227+
plugins = []
228+
229+
if '--start-plugins' in args:
230+
ib = args.index('--start-plugins')
231+
ie = args.index('--end-plugins')
232+
plugins = args[ib + 1:ie]
233+
args = args[:ib] + args[ie + 1:]
234+
235+
for p in plugins:
236+
res = subprocess.check_output([sys.executable, p] + args).decode().strip()
237+
238+
if res:
239+
args = json.loads(res)
240+
241+
opts, args = parse_args(args)
237242

238243
assert opts.arch
239244
assert opts.target
@@ -242,8 +247,6 @@ def parse_args():
242247
cmd = fix_cmd(opts.arch, cmd)
243248
cmd = fix_py2(cmd)
244249

245-
if opts.musl:
246-
cmd = fix_cmd_for_musl(cmd)
247250
if opts.dynamic_cuda:
248251
cmd = fix_cmd_for_dynamic_cuda(cmd)
249252
else:

build/scripts/link_exe.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,13 @@ def parse_args(args):
335335

336336
if __name__ == '__main__':
337337
args = sys.argv[1:]
338-
ib = args.index('--start-plugins')
339-
ie = args.index('--end-plugins')
340-
plugins = args[ib + 1:ie]
341-
args = args[:ib] + args[ie + 1:]
338+
plugins = []
339+
340+
if '--start-plugins' in args:
341+
ib = args.index('--start-plugins')
342+
ie = args.index('--end-plugins')
343+
plugins = args[ib + 1:ie]
344+
args = args[:ib] + args[ie + 1:]
342345

343346
for p in plugins:
344347
res = subprocess.check_output([sys.executable, p] + args).decode().strip()

build/ya.conf.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@
552552
"cxx_compiler": "$(CLANG)/bin/clang++",
553553
"llvm-symbolizer": "$(CLANG)/bin/llvm-symbolizer",
554554
"match_root": "CLANG",
555+
"nm": "$(CLANG)/bin/llvm-nm",
555556
"objcopy": "$(CLANG)/bin/llvm-objcopy",
556557
"profiles": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles",
557558
"simctl": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/SystemRoot/PrivateFrameworks/CoreSimulator.framework/Resources/bin/simctl",
@@ -1229,6 +1230,7 @@
12291230
"cxx_compiler": "$(CLANG)/bin/clang++",
12301231
"llvm-symbolizer": "$(CLANG)/bin/llvm-symbolizer",
12311232
"match_root": "CLANG",
1233+
"nm": "$(CLANG)/bin/llvm-nm",
12321234
"objcopy": "$(CLANG)/bin/llvm-objcopy",
12331235
"profiles": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles",
12341236
"simctl": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/SystemRoot/PrivateFrameworks/CoreSimulator.framework/Resources/bin/simctl",

build/ymake.core.conf

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,6 @@ module _BASE_UNIT: _BARE_UNIT {
769769

770770
when ($MUSL == "yes") {
771771
CFLAGS += -D_musl_
772-
LINK_DYN_LIB_FLAGS += --musl
773772
PEERDIR+=contrib/libs/musl/include
774773
}
775774

@@ -824,8 +823,9 @@ module _BASE_UNIT: _BARE_UNIT {
824823
DEFAULT(SWIG_LANG python)
825824
DEFAULT(GP_FLAGS -CtTLANSI-C -Dk* -c)
826825

827-
when ($NEED_BINUTILS_PEERDIR && $BINUTILS_USED && $NEED_PLATFORM_PEERDIRS == "yes") {
828-
PEERDIR+=build/platform/binutils
826+
when ($NEED_LLVM_TOOLS_PEERDIR && $NEED_PLATFORM_PEERDIRS == "yes") {
827+
PEERDIR+=build/platform/clang
828+
LLVM_TOOLS_ROOT=$CLANG18_RESOURCE_GLOBAL
829829
}
830830

831831
when ($TIDY_ENABLED == "yes") {
@@ -2536,20 +2536,25 @@ when ($BT_MINSIZEREL == "yes" || $LINKER_ICF == "yes") {
25362536
OBJCOPY_TOOL=$OBJCOPY_TOOL_VENDOR
25372537
OBJDUMP_TOOL=$OBJDUMP_TOOL_VENDOR
25382538
STRIP_TOOL=$STRIP_TOOL_VENDOR
2539-
NEED_BINUTILS_PEERDIR=
2540-
BINUTILS_USED=
2539+
NM_TOOL=$NM_TOOL_VENDOR
2540+
NEED_LLVM_TOOLS_PEERDIR=
2541+
LLVM_TOOLS_ROOT=
25412542

25422543
when (!$OBJCOPY_TOOL_VENDOR) {
2543-
OBJCOPY_TOOL=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/objcopy
2544-
NEED_BINUTILS_PEERDIR=yes
2544+
OBJCOPY_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-objcopy
2545+
NEED_LLVM_TOOLS_PEERDIR=yes
25452546
}
25462547
when (!$OBJDUMP_TOOL_VENDOR) {
2547-
OBJDUMP_TOOL=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/objdump
2548-
NEED_BINUTILS_PEERDIR=yes
2548+
OBJDUMP_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-objdump
2549+
NEED_LLVM_TOOLS_PEERDIR=yes
25492550
}
25502551
when (!$STRIP_TOOL_VENDOR) {
2551-
STRIP_TOOL=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/strip
2552-
NEED_BINUTILS_PEERDIR=yes
2552+
STRIP_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-strip
2553+
NEED_LLVM_TOOLS_PEERDIR=yes
2554+
}
2555+
when (!$NM_TOOL_VENDOR) {
2556+
NM_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-nm
2557+
NEED_LLVM_TOOLS_PEERDIR=yes
25532558
}
25542559

25552560
SPLIT_DWARF_VALUE=no
@@ -2586,7 +2591,6 @@ when ($SPLIT_DWARF_VALUE == "yes" && $NO_SPLIT_DWARF != "yes" && $NO_DEBUGINFO !
25862591
$OBJCOPY_TOOL --only-keep-debug $TARGET $SPLIT_DWARF_OUTPUT && \
25872592
$STRIP_TOOL --strip-debug $TARGET && \
25882593
$OBJCOPY_TOOL --remove-section=.gnu_debuglink --add-gnu-debuglink $SPLIT_DWARF_OUTPUT $TARGET
2589-
BINUTILS_USED=yes
25902594
}
25912595

25922596
### @usage: EXTRALIBS_STATIC(Libs...)
@@ -3135,10 +3139,19 @@ macro _SRC_f_old(SRC, SRCFLAGS...) {
31353139
.CMD=$YMAKE_PYTHON ${input:"build/scripts/f2c.py"} -t ${tool:"contrib/tools/f2c"} -c ${input:SRC} -o ${output:SRC.c} ${hide;output_include:"f2c.h"} ${hide;kv:"p FT"} ${hide;kv:"pc light-green"}
31363140
}
31373141

3142+
### @usage: AR_PLUGIN(plugin_name)
3143+
###
3144+
### Register script, which will process module's .a (archive) output
3145+
### Script will receive path to archive, which it should modify in place
31383146
macro AR_PLUGIN(name) {
31393147
SET(_AR_PLUGIN $name.pyplugin)
31403148
}
31413149

3150+
### @usage: LD_PLUGIN(plugin_name)
3151+
###
3152+
### Register script, which will process all inputs to any link_exe.py call with modules's library
3153+
### Script will receive all arguments to link_exe.py, and can output into stdout preprocessed list
3154+
### of all arguments, in JSON format
31423155
macro LD_PLUGIN(name) {
31433156
SRCS(GLOBAL $name.pyplugin)
31443157
}

build/ymake_conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ def __init__(self, build, detector):
10671067
self.objcopy = self.params.get('objcopy')
10681068
self.objdump = self.params.get('objdump')
10691069
self.isystem = self.params.get('isystem')
1070+
self.nm = self.params.get('nm')
10701071

10711072
self.dwarf_tool = self.target.find_in_dict(self.params.get('dwarf_tool'))
10721073

@@ -1665,6 +1666,7 @@ def __init__(self, tc, build):
16651666
self.strip = self.tc.strip
16661667
self.objcopy = self.tc.objcopy
16671668
self.objdump = self.tc.objdump
1669+
self.nm = self.tc.nm
16681670

16691671
self.musl = Setting('MUSL', convert=to_bool)
16701672

@@ -1728,6 +1730,7 @@ def print_linker(self):
17281730
emit('STRIP_TOOL_VENDOR', self.strip)
17291731
emit('OBJCOPY_TOOL_VENDOR', self.objcopy)
17301732
emit('OBJDUMP_TOOL_VENDOR', self.objdump)
1733+
emit('NM_TOOL_VENDOR', self.nm)
17311734

17321735
emit('_LD_FLAGS', self.ld_flags)
17331736
emit('LD_SDK_VERSION', self.ld_sdk)
@@ -2013,10 +2016,6 @@ def print_compiler(self):
20132016
# for msvc compatibility
20142017
# https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions
20152018
# '-fdelayed-template-parsing',
2016-
'-Wno-deprecated-this-capture',
2017-
'-Wno-c++11-narrowing-const-reference',
2018-
'-Wno-vla-cxx-extension', # https://github.com/llvm/llvm-project/issues/62836
2019-
'-Wno-invalid-offsetof',
20202019
]
20212020
if target.is_x86:
20222021
flags.append('-m32')
@@ -2037,12 +2036,16 @@ def print_compiler(self):
20372036
# Issue a warning if certain overload is hidden due to inheritance
20382037
'-Woverloaded-virtual',
20392038
'-Wno-ambiguous-reversed-operator',
2039+
'-Wno-c++11-narrowing-const-reference',
20402040
'-Wno-defaulted-function-deleted',
20412041
'-Wno-deprecated-anon-enum-enum-conversion',
20422042
'-Wno-deprecated-enum-enum-conversion',
20432043
'-Wno-deprecated-enum-float-conversion',
2044+
'-Wno-deprecated-this-capture',
20442045
'-Wno-deprecated-volatile',
2046+
'-Wno-invalid-offsetof',
20452047
'-Wno-undefined-var-template',
2048+
'-Wno-vla-cxx-extension', # https://github.com/llvm/llvm-project/issues/62836
20462049
]
20472050

20482051
defines.append('/D_WIN32_WINNT={0}'.format(WINDOWS_VERSION_MIN))

0 commit comments

Comments
 (0)