diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:40 +0300 |
commit | 5d50718e66d9c037dc587a0211110b7d25a66185 (patch) | |
tree | e98df59de24d2ef7c77baed9f41e4875a2fef972 /build | |
parent | a6a92afe03e02795227d2641b49819b687f088f8 (diff) | |
download | ydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'build')
27 files changed, 981 insertions, 981 deletions
diff --git a/build/conf/project_specific/maps/mapkit.conf b/build/conf/project_specific/maps/mapkit.conf index 148fdb08d2..d64b41f72a 100644 --- a/build/conf/project_specific/maps/mapkit.conf +++ b/build/conf/project_specific/maps/mapkit.conf @@ -244,7 +244,7 @@ when ($MAPSMOBI_BUILD_TARGET && $OS_ANDROID) { CFLAGS+=-fstrict-aliasing -mstackrealign -DTLS_STACK_PROTECTOR } elsewhen ($ARCH_X86_64) { - CFLAGS+=-fstrict-aliasing -mstackrealign -march=x86-64 -msse4.2 -mpopcnt -m64 -DTLS_STACK_PROTECTOR + CFLAGS+=-fstrict-aliasing -mstackrealign -march=x86-64 -msse4.2 -mpopcnt -m64 -DTLS_STACK_PROTECTOR } otherwise { PEERDIR+=__unsupported_architecture_for_android__ diff --git a/build/config/tests/clang_tidy/config.yaml b/build/config/tests/clang_tidy/config.yaml index 6e93834241..d55707592c 100644 --- a/build/config/tests/clang_tidy/config.yaml +++ b/build/config/tests/clang_tidy/config.yaml @@ -1,8 +1,8 @@ -Checks: > - -*, +Checks: > + -*, arcadia-typeid-name-restriction, - bugprone-use-after-move, - readability-identifier-naming, + bugprone-use-after-move, + readability-identifier-naming, CheckOptions: - key: readability-identifier-naming.ClassCase value: CamelCase diff --git a/build/platform.md b/build/platform.md index dcb223f30b..deb8acfb09 100644 --- a/build/platform.md +++ b/build/platform.md @@ -2,7 +2,7 @@ ### `default` * `android` * `i686`, `x86_64`, `armv7a`, `armv7a_neon`, `armv8a` - Clang 9.0.8, Android NDK r21b. API 16 for the 32-bit platforms, API 21 for 64-bit. + Clang 9.0.8, Android NDK r21b. API 16 for the 32-bit platforms, API 21 for 64-bit. * `darwin` * `x86_64` Clang 12.0.0, macOS SDK 10.13 diff --git a/build/platform/linux_sdk/ya.make b/build/platform/linux_sdk/ya.make index 64d7d7d8a8..add74eee9e 100644 --- a/build/platform/linux_sdk/ya.make +++ b/build/platform/linux_sdk/ya.make @@ -28,7 +28,7 @@ ELSEIF (ARCH_AARCH64) IF (OS_SDK == "ubuntu-16") DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:309054781) ELSE() - MESSAGE(FATAL_ERROR "There is no ${OS_SDK} SDK for AArch64/ARMv8 64 bit") + MESSAGE(FATAL_ERROR "There is no ${OS_SDK} SDK for AArch64/ARMv8 64 bit") ENDIF() ELSEIF (ARCH_PPC64LE) IF (OS_SDK == "ubuntu-14") @@ -41,12 +41,12 @@ ELSEIF (ARCH_PPC64LE) MESSAGE(FATAL_ERROR "There is no ${OS_SDK} SDK for PPC64LE") ENDIF() ELSEIF (ARCH_ARM7) - IF (ARM7_FLOAT_ABI == "hard" AND OS_SDK == "ubuntu-16") + IF (ARM7_FLOAT_ABI == "hard" AND OS_SDK == "ubuntu-16") DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:1323200692) - ELSEIF (ARM7_FLOAT_ABI == "softfp" AND OS_SDK == "ubuntu-18") - DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:2402287545) + ELSEIF (ARM7_FLOAT_ABI == "softfp" AND OS_SDK == "ubuntu-18") + DECLARE_EXTERNAL_RESOURCE(OS_SDK_ROOT sbr:2402287545) ELSE() - MESSAGE(FATAL_ERROR "There is no ${OS_SDK} SDK for ARMv7 32 bit (float ABI: ${ARM7_FLOAT_ABI})") + MESSAGE(FATAL_ERROR "There is no ${OS_SDK} SDK for ARMv7 32 bit (float ABI: ${ARM7_FLOAT_ABI})") ENDIF() ELSE() MESSAGE(FATAL_ERROR "Unexpected OS_SDK value: ${OS_SDK}") diff --git a/build/platform/lld/ya.make b/build/platform/lld/ya.make index 966f800c20..c046e89098 100644 --- a/build/platform/lld/ya.make +++ b/build/platform/lld/ya.make @@ -14,9 +14,9 @@ IF (USE_LTO OR USE_THINLTO) ENDIF() ENDIF() -IF (OS_ANDROID) +IF (OS_ANDROID) # Use LLD shipped with Android NDK. - LDFLAGS("-fuse-ld=lld") + LDFLAGS("-fuse-ld=lld") ELSEIF (USE_LLD8) IF (HOST_OS_LINUX) IF (HOST_ARCH_PPC64LE) @@ -41,21 +41,21 @@ ELSEIF (USE_LLD11) ENDIF() LDFLAGS("-fuse-ld=$LLD_ROOT_RESOURCE_GLOBAL/ld" "-Wl,--no-rosegment") -ELSE() - IF (HOST_OS_LINUX) - IF (HOST_ARCH_PPC64LE) +ELSE() + IF (HOST_OS_LINUX) + IF (HOST_ARCH_PPC64LE) DECLARE_EXTERNAL_RESOURCE(LLD_ROOT sbr:2283417120) - ELSE() + ELSE() DECLARE_EXTERNAL_RESOURCE(LLD_ROOT sbr:2283360772) - ENDIF() - ELSEIF (HOST_OS_DARWIN) + ENDIF() + ELSEIF (HOST_OS_DARWIN) IF (HOST_ARCH_ARM64) DECLARE_EXTERNAL_RESOURCE(LLD_ROOT sbr:2283439721) ELSE() DECLARE_EXTERNAL_RESOURCE(LLD_ROOT sbr:2283429958) ENDIF() ENDIF() - + LDFLAGS("-fuse-ld=$LLD_ROOT_RESOURCE_GLOBAL/ld" "-Wl,--no-rosegment") ENDIF() diff --git a/build/plugins/cpp_style.py b/build/plugins/cpp_style.py index 22fa977717..3ab78b7320 100644 --- a/build/plugins/cpp_style.py +++ b/build/plugins/cpp_style.py @@ -14,6 +14,6 @@ def on_style(unit, *args): continue yield f - yield '/cpp_style/files/' + f + yield '/cpp_style/files/' + f unit.onresource(list(it())) diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index d9e09cb9dd..f32a2d39a0 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -34,7 +34,7 @@ def uniq_suffix(path, unit): if '/' not in path: return '' return '.{}'.format(pathid(path)[:4]) - + def pb2_arg(suf, path, mod, unit): return '{path}__int__{suf}={mod}{modsuf}'.format( path=stripext(to_build_root(path, unit)), @@ -42,7 +42,7 @@ def pb2_arg(suf, path, mod, unit): mod=mod, modsuf=stripext(suf) ) - + def proto_arg(path, mod, unit): return '{}.proto={}'.format(stripext(to_build_root(path, unit)), mod) @@ -208,7 +208,7 @@ def onpy_srcs(unit, *args): unit_needs_main = unit.get('MODULE_TYPE') in ('PROGRAM', 'DLL') if unit_needs_main: py_program(unit, py3) - + py_namespace_value = unit.get('PY_NAMESPACE_VALUE') if py_namespace_value == ".": ns = "" diff --git a/build/plugins/rodata.py b/build/plugins/rodata.py index cff6481d23..3ecb0f9a83 100644 --- a/build/plugins/rodata.py +++ b/build/plugins/rodata.py @@ -81,7 +81,7 @@ class ROData(iw.CustomCommand): in_file = self.resolve_path(common.get(self.input, 0)) in_file_no_ext = common.stripext(in_file) file_name = os.path.basename(in_file_no_ext) - file_size = os.path.getsize(in_file) + file_size = os.path.getsize(in_file) tmp_file = self.resolve_path(common.get(self.output, 0) + '.asm') parser = argparse.ArgumentParser(prog='rodata.py', add_help=False) @@ -95,12 +95,12 @@ class ROData(iw.CustomCommand): f.write('SECTION .rodata ALIGN=16\n') f.write(self._prefix + file_name + ':\nincbin "' + in_file + '"\n') f.write('align 4, db 0\n') - f.write(self._prefix + file_name + 'Size:\ndd ' + str(file_size) + '\n') + f.write(self._prefix + file_name + 'Size:\ndd ' + str(file_size) + '\n') + + if self._fmt.startswith('elf'): + f.write('size ' + self._prefix + file_name + ' ' + str(file_size) + '\n') + f.write('size ' + self._prefix + file_name + 'Size 4\n') - if self._fmt.startswith('elf'): - f.write('size ' + self._prefix + file_name + ' ' + str(file_size) + '\n') - f.write('size ' + self._prefix + file_name + 'Size 4\n') - return self.do_run(binary, tmp_file) def do_run(self, binary, path): diff --git a/build/plugins/yql_python_udf.py b/build/plugins/yql_python_udf.py index 1454129724..c4f949d8a9 100644 --- a/build/plugins/yql_python_udf.py +++ b/build/plugins/yql_python_udf.py @@ -1,42 +1,42 @@ -from _common import sort_by_keywords - - -def get_or_default(kv, name, default): - if name in kv: - return kv[name][0] - return default - - -def onregister_yql_python_udf(unit, *args): +from _common import sort_by_keywords + + +def get_or_default(kv, name, default): + if name in kv: + return kv[name][0] + return default + + +def onregister_yql_python_udf(unit, *args): flat, kv = sort_by_keywords({'NAME': 1, 'RESOURCE_NAME': 1, 'ADD_LIBRA_MODULES': 1}, args) - assert len(flat) == 0 - name = get_or_default(kv, 'NAME', 'CustomPython') - resource_name = get_or_default(kv, 'RESOURCE_NAME', name) + assert len(flat) == 0 + name = get_or_default(kv, 'NAME', 'CustomPython') + resource_name = get_or_default(kv, 'RESOURCE_NAME', name) add_libra_modules = get_or_default(kv, 'ADD_LIBRA_MODULES', 'no') == 'yes' - - use_arcadia_python = unit.get('USE_ARCADIA_PYTHON') == 'yes' + + use_arcadia_python = unit.get('USE_ARCADIA_PYTHON') == 'yes' py3 = unit.get('PYTHON3') == 'yes' - + unit.onyql_abi_version(['2', '9', '0']) unit.onpeerdir(['yql/udfs/common/python/python_udf']) unit.onpeerdir(['ydb/library/yql/public/udf']) - + if add_libra_modules: unit.onpeerdir(['quality/user_sessions/libra_arc/noyql']) unit.onpeerdir(['yql/udfs/quality/libra/module']) - if use_arcadia_python: - flavor = 'Arcadia' - unit.onpeerdir([ - 'library/python/runtime', + if use_arcadia_python: + flavor = 'Arcadia' + unit.onpeerdir([ + 'library/python/runtime', 'yql/udfs/common/python/main' ] if not py3 else [ 'library/python/runtime_py3', 'yql/udfs/common/python/main_py3' - ]) - else: - flavor = 'System' - + ]) + else: + flavor = 'System' + output_includes = [ 'yql/udfs/common/python/python_udf/python_udf.h', 'ydb/library/yql/public/udf/udf_registrator.h', @@ -44,12 +44,12 @@ def onregister_yql_python_udf(unit, *args): if add_libra_modules: output_includes.append('yql/udfs/quality/libra/module/module.h') - path = name + '.yql_python_udf.cpp' + path = name + '.yql_python_udf.cpp' libra_flag = '1' if add_libra_modules else '0' unit.onpython([ - 'build/scripts/gen_yql_python_udf.py', + 'build/scripts/gen_yql_python_udf.py', flavor, name, resource_name, path, libra_flag, - 'OUT', path, + 'OUT', path, 'OUTPUT_INCLUDES', ] + output_includes ) diff --git a/build/rules/contrib_python.policy b/build/rules/contrib_python.policy index 0d0bd39ff2..60fd149753 100644 --- a/build/rules/contrib_python.policy +++ b/build/rules/contrib_python.policy @@ -549,7 +549,7 @@ ALLOW quality/functionality/turbo/forms/app/lib -> contrib/python/sqlalchemy/sql ALLOW quality/functionality/turbo/forms/job/lib -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quality/functionality/turbo/json_api/app/lib -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quality/functionality/turbo/json_api/job/lib -> contrib/python/sqlalchemy/sqlalchemy-1.2 -ALLOW quasar/db/orm -> contrib/python/sqlalchemy/sqlalchemy-1.2 +ALLOW quasar/db/orm -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quasar/manufacturing/jangles/app -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quasar/manufacturing/jangles/blueprints -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quasar/manufacturing/jangles/models -> contrib/python/sqlalchemy/sqlalchemy-1.2 diff --git a/build/rules/contrib_restricted.policy b/build/rules/contrib_restricted.policy index ffb67177da..a83ead1904 100644 --- a/build/rules/contrib_restricted.policy +++ b/build/rules/contrib_restricted.policy @@ -1,8 +1,8 @@ -# == Rules for contrib/restricted section == -# -# NOTE: rules should be ordered from specific to generic (first matching rule is used) -# See rule syntax docs: https://wiki.yandex-team.ru/devrules/overall/peerdirprohibition/ - +# == Rules for contrib/restricted section == +# +# NOTE: rules should be ordered from specific to generic (first matching rule is used) +# See rule syntax docs: https://wiki.yandex-team.ru/devrules/overall/peerdirprohibition/ + # scale_ipp filter for ffmpeg use Intel IPP hence it is nonfree ALLOW strm/cv/ffmpeg_adcv/toshik_filters -> contrib/restricted/ffmpeg-3-scale-ipp @@ -44,28 +44,28 @@ ALLOW mds -> contrib/restricted/uriparser # https://st.yandex-team.ru/CONTRIB-2020 ALLOW weather -> contrib/restricted/range-v3 -# ALSA library is LGPL +# ALSA library is LGPL ALLOW yandex_io -> contrib/restricted/alsa-lib -ALLOW smart_devices -> contrib/restricted/alsa-lib - +ALLOW smart_devices -> contrib/restricted/alsa-lib + # Avahi is LGPL ALLOW yandex_io -> contrib/restricted/avahi -# GLib is LGPL -ALLOW maps/libs/img -> contrib/restricted/glib -ALLOW maps/renderer/libs/svgrenderer -> contrib/restricted/glib +# GLib is LGPL +ALLOW maps/libs/img -> contrib/restricted/glib +ALLOW maps/renderer/libs/svgrenderer -> contrib/restricted/glib ALLOW market/cataloger -> contrib/restricted/glib ALLOW market/idx/feeds/feedparser -> contrib/restricted/glib ALLOW metrika/core/libs/statdaemons -> contrib/restricted/glib ALLOW metrika/core/libs/strconvert -> contrib/restricted/glib ALLOW yandex_io -> contrib/restricted/glib - + # GStreamer is LGPL ALLOW yandex_io -> contrib/restricted/gstreamer ALLOW yandex_io -> contrib/restricted/gst-plugins-base ALLOW yandex_io -> contrib/restricted/gst-plugins-good ALLOW yandex_io -> contrib/restricted/gst-plugins-bad -ALLOW yandex_io -> contrib/restricted/patched/gst-libav +ALLOW yandex_io -> contrib/restricted/patched/gst-libav # mpg123 is LGPL ALLOW extsearch/audio/kernel/recoglib -> contrib/restricted/mpg123 @@ -77,7 +77,7 @@ ALLOW speechkit -> contrib/restricted/openal-soft # rubberband is a GPL audio stretching library ALLOW dict/mt/video -> contrib/restricted/rubberband -# Allowed subset of abseil is exported via library/ +# Allowed subset of abseil is exported via library/ ALLOW library/cpp/containers/absl_flat_hash -> contrib/restricted/abseil-cpp/absl/container ALLOW library/cpp/containers/absl_tstring_flat_hash -> contrib/restricted/abseil-cpp-tstring/y_absl/container @@ -106,14 +106,14 @@ ALLOW maps/infra/ecstatic -> contrib/restricted/libtorrent # # strm/common/go/pkg/murmur3 is a CGO binding to murmurhash, thus dependency is allowed ALLOW strm/common/go/pkg/murmur3 -> contrib/restricted/murmurhash -ALLOW clickhouse -> contrib/restricted/murmurhash +ALLOW clickhouse -> contrib/restricted/murmurhash # exiv2 is GPL-licensed. Only small subset of our libraries can use it. ALLOW extsearch/images/chunks/exiftags -> contrib/restricted/exiv2 ALLOW maps/wikimap/mapspro/services/mrc/libs/common -> contrib/restricted/exiv2 ALLOW yweb/disk/ocraas -> contrib/restricted/exiv2 -# Only allow boost in yandex projects listed below +# Only allow boost in yandex projects listed below ALLOW adfox -> contrib/restricted/boost ALLOW ads -> contrib/restricted/boost ALLOW advq -> contrib/restricted/boost @@ -156,7 +156,7 @@ ALLOW market/access/server/env -> contrib/restricted/boost ALLOW sdg/library/cpp/ros_msg_parser -> contrib/restricted/boost ALLOW search/meta/scatter/ant -> contrib/restricted/boost ALLOW search/meta/scatter/ut -> contrib/restricted/boost - + # use GTEST target in ya.make instead of PEERDIRing contrib/restricted/googletest # and include <library/cpp/testing/gtest.h> instead of <gtest/gtest.h> (<gmock/gmock.h>) ALLOW contrib -> contrib/restricted/googletest @@ -182,9 +182,9 @@ ALLOW .* -> contrib/restricted/librseq/headeronly # we use nfs-ganesha for Network File Store gateway ALLOW cloud/filestore/gateway/nfs -> contrib/restricted/nfs_ganesha -ALLOW yandex_io -> contrib/restricted/patched/hostap_client - -# Default policies: +ALLOW yandex_io -> contrib/restricted/patched/hostap_client + +# Default policies: # # Do not restrict contrib # All peerdirs to contrib/restricted from outside are prohibited diff --git a/build/scripts/find_time_trace.py b/build/scripts/find_time_trace.py index 3eb0854403..954d203caa 100644 --- a/build/scripts/find_time_trace.py +++ b/build/scripts/find_time_trace.py @@ -1,17 +1,17 @@ -import os -import sys - -# /scripts/find_time_trace.py <object_file> <destination> -# clang generates `-ftime-trace` output file path based on main output file path - - -def main(): - assert len(sys.argv) == 3 - obj_path = sys.argv[1] - trace_path = sys.argv[2] - orig_trace_path = obj_path.rpartition('.o')[0] + '.json' - os.rename(orig_trace_path, trace_path) - - -if __name__ == '__main__': - main() +import os +import sys + +# /scripts/find_time_trace.py <object_file> <destination> +# clang generates `-ftime-trace` output file path based on main output file path + + +def main(): + assert len(sys.argv) == 3 + obj_path = sys.argv[1] + trace_path = sys.argv[2] + orig_trace_path = obj_path.rpartition('.o')[0] + '.json' + os.rename(orig_trace_path, trace_path) + + +if __name__ == '__main__': + main() diff --git a/build/scripts/gen_yql_python_udf.py b/build/scripts/gen_yql_python_udf.py index 5613f58366..13b5898117 100644 --- a/build/scripts/gen_yql_python_udf.py +++ b/build/scripts/gen_yql_python_udf.py @@ -1,18 +1,18 @@ -import sys - -TEMPLATE=""" +import sys + +TEMPLATE=""" #include <yql/udfs/common/python/python_udf/python_udf.h> - + #include <ydb/library/yql/public/udf/udf_registrator.h> - + #if @WITH_LIBRA@ #include <yql/udfs/quality/libra/module/module.h> #endif -using namespace NKikimr::NUdf; - -#ifdef BUILD_UDF - +using namespace NKikimr::NUdf; + +#ifdef BUILD_UDF + #if @WITH_LIBRA@ LIBRA_MODULE(TLibraModule, "Libra@MODULE_NAME@"); #endif @@ -23,7 +23,7 @@ extern "C" UDF_API void Register(IRegistrator& registrator, ui32 flags) { RegisterHelper<TLibraModule>(registrator); #endif } - + extern "C" UDF_API ui32 AbiVersion() { return CurrentAbiVersion(); } @@ -32,24 +32,24 @@ extern "C" UDF_API void SetBackTraceCallback(TBackTraceCallback callback) { SetBackTraceCallbackImpl(callback); } -#endif -""" - - -def main(): +#endif +""" + + +def main(): assert len(sys.argv) == 6 flavor, module_name, package_name, path, libra_flag = sys.argv[1:] - with open(path, 'w') as f: - f.write( - TEMPLATE - .strip() - .replace('@MODULE_NAME@', module_name) - .replace('@PACKAGE_NAME@', package_name) - .replace('@FLAVOR@', flavor) + with open(path, 'w') as f: + f.write( + TEMPLATE + .strip() + .replace('@MODULE_NAME@', module_name) + .replace('@PACKAGE_NAME@', package_name) + .replace('@FLAVOR@', flavor) .replace('@WITH_LIBRA@', libra_flag) - ) - f.write('\n') - - -if __name__ == "__main__": - main() + ) + f.write('\n') + + +if __name__ == "__main__": + main() diff --git a/build/scripts/link_dyn_lib.py b/build/scripts/link_dyn_lib.py index ddd3d6d658..23487f5c1e 100644 --- a/build/scripts/link_dyn_lib.py +++ b/build/scripts/link_dyn_lib.py @@ -4,19 +4,19 @@ import subprocess import tempfile import collections import optparse -import pipes +import pipes from process_whole_archive_option import ProcessWholeArchiveOption -def shlex_join(cmd): - # equivalent to shlex.join() in python 3 - return ' '.join( - pipes.quote(part) - for part in cmd - ) - - +def shlex_join(cmd): + # equivalent to shlex.join() in python 3 + return ' '.join( + pipes.quote(part) + for part in cmd + ) + + def parse_export_file(p): with open(p, 'r') as f: for l in f: @@ -165,7 +165,7 @@ def parse_args(): parser.add_option('--target') parser.add_option('--soname') parser.add_option('--fix-elf') - parser.add_option('--linker-output') + parser.add_option('--linker-output') parser.add_option('--musl', action='store_true') parser.add_option('--whole-archive-peers', action='append') parser.add_option('--whole-archive-libs', action='append') @@ -180,18 +180,18 @@ if __name__ == '__main__': cmd = fix_cmd(opts.arch, opts.musl, args) cmd = ProcessWholeArchiveOption(opts.arch, opts.whole_archive_peers, opts.whole_archive_libs).construct_cmd(cmd) - - if opts.linker_output: - stdout = open(opts.linker_output, 'w') - else: - stdout = sys.stdout - - proc = subprocess.Popen(cmd, shell=False, stderr=sys.stderr, stdout=stdout) + + if opts.linker_output: + stdout = open(opts.linker_output, 'w') + else: + stdout = sys.stdout + + proc = subprocess.Popen(cmd, shell=False, stderr=sys.stderr, stdout=stdout) proc.communicate() if proc.returncode: - print >>sys.stderr, 'linker has failed with retcode:', proc.returncode - print >>sys.stderr, 'linker command:', shlex_join(cmd) + print >>sys.stderr, 'linker has failed with retcode:', proc.returncode + print >>sys.stderr, 'linker command:', shlex_join(cmd) sys.exit(proc.returncode) if opts.fix_elf: @@ -200,8 +200,8 @@ if __name__ == '__main__': proc.communicate() if proc.returncode: - print >>sys.stderr, 'fix_elf has failed with retcode:', proc.returncode - print >>sys.stderr, 'fix_elf command:', shlex_join(cmd) + print >>sys.stderr, 'fix_elf has failed with retcode:', proc.returncode + print >>sys.stderr, 'fix_elf command:', shlex_join(cmd) sys.exit(proc.returncode) if opts.soname and opts.soname != opts.target: diff --git a/build/scripts/link_exe.py b/build/scripts/link_exe.py index ff0f63337e..f469e3b442 100644 --- a/build/scripts/link_exe.py +++ b/build/scripts/link_exe.py @@ -51,7 +51,7 @@ def parse_args(): parser.add_option('--python') parser.add_option('--source-root') parser.add_option('--arch') - parser.add_option('--linker-output') + parser.add_option('--linker-output') parser.add_option('--whole-archive-peers', action='append') parser.add_option('--whole-archive-libs', action='append') return parser.parse_args() @@ -59,24 +59,24 @@ def parse_args(): if __name__ == '__main__': opts, args = parse_args() - + cmd = fix_cmd(opts.musl, args) cmd = ProcessWholeArchiveOption(opts.arch, opts.whole_archive_peers, opts.whole_archive_libs).construct_cmd(cmd) - + if opts.custom_step: assert opts.python subprocess.check_call([opts.python] + [opts.custom_step] + args) - - supp, cmd = get_leaks_suppressions(cmd) - if supp: + + supp, cmd = get_leaks_suppressions(cmd) + if supp: src_file = "default_suppressions.cpp" gen_default_suppressions(supp, src_file, opts.source_root) - cmd += [src_file] - - if opts.linker_output: - stdout = open(opts.linker_output, 'w') - else: - stdout = sys.stdout - - rc = subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=stdout) + cmd += [src_file] + + if opts.linker_output: + stdout = open(opts.linker_output, 'w') + else: + stdout = sys.stdout + + rc = subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=stdout) sys.exit(rc) diff --git a/build/scripts/py_compile.py b/build/scripts/py_compile.py index 5e80045062..936dbe8816 100755 --- a/build/scripts/py_compile.py +++ b/build/scripts/py_compile.py @@ -1,24 +1,24 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from __future__ import print_function, absolute_import, division - -import marshal -import sys - - -def main(): +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +import marshal +import sys + + +def main(): srcpathx, in_fname, out_fname = sys.argv[1:] srcpath = srcpathx[:-1] with open(in_fname, 'r') as in_file: - source = in_file.read() + source = in_file.read() code = compile(source, srcpath, 'exec', dont_inherit=True) with open(out_fname, 'wb') as out_file: - marshal.dump(code, out_file) - - -if __name__ == "__main__": - main() + marshal.dump(code, out_file) + + +if __name__ == "__main__": + main() diff --git a/build/sysincl/android.yml b/build/sysincl/android.yml index bc3bd261ce..97cfbf38d2 100644 --- a/build/sysincl/android.yml +++ b/build/sysincl/android.yml @@ -14,18 +14,18 @@ - GLES2/gl2.h - GLES2/gl2ext.h - GLES3/gl31.h - - SLES/OpenSLES.h - - SLES/OpenSLES_Android.h - - SLES/OpenSLES_AndroidConfiguration.h - - SLES/OpenSLES_AndroidMetadata.h - - SLES/OpenSLES_Platform.h + - SLES/OpenSLES.h + - SLES/OpenSLES_Android.h + - SLES/OpenSLES_AndroidConfiguration.h + - SLES/OpenSLES_AndroidMetadata.h + - SLES/OpenSLES_Platform.h - linux/ashmem.h - -- source_filter: "^contrib/libs/breakpad/src" - includes: - - elf.h: contrib/libs/breakpad/src/common/android/include/elf.h - - link.h: contrib/libs/breakpad/src/common/android/include/link.h - - sys/procfs.h: contrib/libs/breakpad/src/common/android/include/sys/procfs.h - - sys/signal.h: contrib/libs/breakpad/src/common/android/include/sys/signal.h - - sys/user.h: contrib/libs/breakpad/src/common/android/include/sys/user.h - - ucontext.h: contrib/libs/breakpad/src/common/android/include/ucontext.h + +- source_filter: "^contrib/libs/breakpad/src" + includes: + - elf.h: contrib/libs/breakpad/src/common/android/include/elf.h + - link.h: contrib/libs/breakpad/src/common/android/include/link.h + - sys/procfs.h: contrib/libs/breakpad/src/common/android/include/sys/procfs.h + - sys/signal.h: contrib/libs/breakpad/src/common/android/include/sys/signal.h + - sys/user.h: contrib/libs/breakpad/src/common/android/include/sys/user.h + - ucontext.h: contrib/libs/breakpad/src/common/android/include/ucontext.h diff --git a/build/sysincl/darwin.yml b/build/sysincl/darwin.yml index d72f425586..582c7e1202 100644 --- a/build/sysincl/darwin.yml +++ b/build/sysincl/darwin.yml @@ -72,7 +72,7 @@ - mach/mach_types.h - mach/mach_vm.h - mach/machine.h - - mach/machine/vm_param.h + - mach/machine/vm_param.h - mach/processor_info.h - mach/semaphore.h - mach/shared_memory_server.h diff --git a/build/sysincl/linux-musl.yml b/build/sysincl/linux-musl.yml index 334c45c168..2c7a11bf06 100644 --- a/build/sysincl/linux-musl.yml +++ b/build/sysincl/linux-musl.yml @@ -13,6 +13,6 @@ - sys/sysctl.h: contrib/libs/musl/extra/sys/sysctl.h - xlocale.h: contrib/libs/musl/extra/xlocale.h -- source_filter: "^contrib/restricted/boost" +- source_filter: "^contrib/restricted/boost" includes: - ../include/fenv.h: contrib/libs/musl/include/fenv.h diff --git a/build/sysincl/linux-ubuntu-12.yml b/build/sysincl/linux-ubuntu-12.yml index 6c1be94d21..b310250e6b 100644 --- a/build/sysincl/linux-ubuntu-12.yml +++ b/build/sysincl/linux-ubuntu-12.yml @@ -1,3 +1,3 @@ -- source_filter: "^contrib/libs/systemd" - includes: - - uchar.h: contrib/libs/libc_compat/include/uchar/uchar.h +- source_filter: "^contrib/libs/systemd" + includes: + - uchar.h: contrib/libs/libc_compat/include/uchar/uchar.h diff --git a/build/sysincl/misc.yml b/build/sysincl/misc.yml index 3291b4df29..e9e6095888 100644 --- a/build/sysincl/misc.yml +++ b/build/sysincl/misc.yml @@ -21,8 +21,8 @@ # Btw: seems that this ADDINCL should be made global and removed from projects # that use this header - includes: - - iconv.h: contrib/libs/libiconv/include/iconv.h - + - iconv.h: contrib/libs/libiconv/include/iconv.h + - includes: - cudnn.h: contrib/libs/nvidia/cudnn/cudnn.h @@ -229,11 +229,11 @@ - cuda.h: contrib/libs/tf/tensorflow/core/platform/cuda.h # unused legacy include in boost -- source_filter: "^contrib/restricted/boost" +- source_filter: "^contrib/restricted/boost" includes: - - atomic.h + - atomic.h - fstream.h - - ../include/fenv.h + - ../include/fenv.h - source_filter: "^contrib/restricted/boost/boost/stacktrace/detail" includes: @@ -255,10 +255,10 @@ - sasl/sasl.h - sasl/saslutil.h -- source_filter: "^contrib/libs/apr" - includes: - - atomic.h - +- source_filter: "^contrib/libs/apr" + includes: + - atomic.h + - source_filter: "^contrib/libs/(apr|httpd|llvm)" includes: - uuid.h @@ -393,17 +393,17 @@ includes: - mpi.h -- source_filter: "^contrib/libs/libf2c" - includes: - - local.h - -- source_filter: "^contrib/libs/libpq" - includes: - - local.h - -- source_filter: "^contrib/libs/breakpad" - includes: - - stab.h +- source_filter: "^contrib/libs/libf2c" + includes: + - local.h + +- source_filter: "^contrib/libs/libpq" + includes: + - local.h + +- source_filter: "^contrib/libs/breakpad" + includes: + - stab.h - source_filter: "^contrib/tools/fluent-bit" includes: diff --git a/build/sysincl/stl-to-libcxx.yml b/build/sysincl/stl-to-libcxx.yml index 97a019e1fa..7d9600f345 100644 --- a/build/sysincl/stl-to-libcxx.yml +++ b/build/sysincl/stl-to-libcxx.yml @@ -45,7 +45,7 @@ - cxxabi.h: contrib/libs/cxxsupp/libcxxabi/include/cxxabi.h - includes: - - __config: contrib/libs/cxxsupp/libcxx/include/__config + - __config: contrib/libs/cxxsupp/libcxx/include/__config - __undef_macros: contrib/libs/cxxsupp/libcxx/include/__undef_macros - algorithm: contrib/libs/cxxsupp/libcxx/include/algorithm - any: contrib/libs/cxxsupp/libcxx/include/any diff --git a/build/sysincl/stl-to-nothing.yml b/build/sysincl/stl-to-nothing.yml index 769711be74..c7e27d1411 100644 --- a/build/sysincl/stl-to-nothing.yml +++ b/build/sysincl/stl-to-nothing.yml @@ -28,7 +28,7 @@ - wctype.h - includes: - - __config + - __config - __undef_macros - algorithm - any diff --git a/build/sysincl/windows.yml b/build/sysincl/windows.yml index 046a7a4412..26ae7b5bfa 100644 --- a/build/sysincl/windows.yml +++ b/build/sysincl/windows.yml @@ -14,7 +14,7 @@ - bcrypt.h - bits.h - capi.h - - cet.h + - cet.h - cfg.h - comdef.h - commctrl.h @@ -145,7 +145,7 @@ - new.h - npapi.h - ntdddisk.h - - ntddk.h + - ntddk.h - ntddndis.h - ntdef.h - ntsecapi.h @@ -190,7 +190,7 @@ - realtimeapiset.h - reason.h - richedit.h - - roapi.h + - roapi.h - robuffer.h - rpc.h - rpcdce.h @@ -287,7 +287,7 @@ - winsdkver.h - winsock.h - winsock2.h - - winstring.h + - winstring.h - winsvc.h - winternl.h - winuser.h @@ -313,4 +313,4 @@ - wtypes.h - xa.h - xaudio2.h - - xmllite.h + - xmllite.h diff --git a/build/ya.conf.json b/build/ya.conf.json index c4d18d0835..5f7cc875d6 100644 --- a/build/ya.conf.json +++ b/build/ya.conf.json @@ -15,9 +15,9 @@ "clang-tidy": { "description": "Run Clang-Tidy source code linter" }, - "clang-apply-replacements": { - "description": "Run clang-apply-replacements companion for clang-tidy" - }, + "clang-apply-replacements": { + "description": "Run clang-apply-replacements companion for clang-tidy" + }, "cling": { "description": "Run cling" }, @@ -196,7 +196,7 @@ "description": "Run gcov" }, "bloat": { - "description": "Run bloat tool", + "description": "Run bloat tool", "visible": false }, "ipython": { @@ -1906,16 +1906,16 @@ }, "target": { "os": "LINUX", - "arch": "armv7a_cortex_a9" - }, - "default": true - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "LINUX", + "arch": "armv7a_cortex_a9" + }, + "default": true + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "LINUX", "arch": "armv7ahf_cortex_a35" }, "default": true @@ -2346,311 +2346,311 @@ } } }, - "android-ndk-r23": { - "name": "clang12", - "tools": { - "cc": { - "bottle": "android-ndk-r23", - "executable": "cc" - }, - "c++": { - "bottle": "android-ndk-r23", - "executable": "c++" - }, - "gcov": { - "bottle": "android-ndk-r23", - "executable": "llvm-cov" - }, - "strip": { - "bottle": "android-ndk-r23", - "executable": "strip" - }, - "objcopy": { - "bottle": "android-ndk-r23", - "executable": "objcopy" - }, - "nm": { - "bottle": "android-ndk-r23", - "executable": "nm" - }, - "llvm-cov": { - "bottle": "android-ndk-r23", - "executable": "llvm-cov" - }, - "llvm-profdata": { - "bottle": "android-ndk-r23", - "executable": "llvm-profdata" - }, - "llvm-symbolizer": { - "bottle": "android-ndk-r23", - "executable": "llvm-symbolizer" - } - }, - "platforms": [ - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "i686" - }, - "default": true - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "x86_64" - }, - "default": true - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a" - }, - "default": true - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a_neon" - }, - "default": true - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "armv8a" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "i686" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "x86_64" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a_neon" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "armv8a" - }, - "default": true - } - ], - "params": { - "type": "clang", - "match_root": "NDK", - "ar": "$(NDK)/llvm-toolchain/bin/llvm-ar", - "c_compiler": "$(NDK)/llvm-toolchain/bin/clang", - "cxx_compiler": "$(NDK)/llvm-toolchain/bin/clang++", - "objcopy": "$(NDK)/llvm-toolchain/bin/llvm-objcopy", - "strip": "$(NDK)/llvm-toolchain/bin/llvm-strip", - "werror_mode": "all", - "gcc_version": "12.0", - "android_ndk_version": 23 - } - }, - "android-ndk-r24": { - "name": "clang13", - "tools": { - "cc": { - "bottle": "android-ndk-r24", - "executable": "cc" - }, - "c++": { - "bottle": "android-ndk-r24", - "executable": "c++" - }, - "gcov": { - "bottle": "android-ndk-r24", - "executable": "llvm-cov" - }, - "strip": { - "bottle": "android-ndk-r24", - "executable": "strip" - }, - "objcopy": { - "bottle": "android-ndk-r24", - "executable": "objcopy" - }, - "nm": { - "bottle": "android-ndk-r24", - "executable": "nm" - }, - "llvm-cov": { - "bottle": "android-ndk-r24", - "executable": "llvm-cov" - }, - "llvm-profdata": { - "bottle": "android-ndk-r24", - "executable": "llvm-profdata" - }, - "llvm-symbolizer": { - "bottle": "android-ndk-r24", - "executable": "llvm-symbolizer" - } - }, - "platforms": [ - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "i686" - } - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "x86_64" - } - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a" - } - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a_neon" - } - }, - { - "host": { - "os": "LINUX" - }, - "target": { - "os": "ANDROID", - "arch": "armv8a" - } - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "i686" - } - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "x86_64" - } - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a" - } - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "armv7a_neon" - } - }, - { - "host": { - "os": "DARWIN" - }, - "target": { - "os": "ANDROID", - "arch": "armv8a" - } - } - ], - "params": { - "type": "clang", - "match_root": "NDK", - "ar": "$(NDK)/llvm-toolchain/bin/llvm-ar", - "c_compiler": "$(NDK)/llvm-toolchain/bin/clang", - "cxx_compiler": "$(NDK)/llvm-toolchain/bin/clang++", - "objcopy": "$(NDK)/llvm-toolchain/bin/llvm-objcopy", - "strip": "$(NDK)/llvm-toolchain/bin/llvm-strip", - "werror_mode": "all", - "gcc_version": "13.0", - "android_ndk_version": 24 - } - }, + "android-ndk-r23": { + "name": "clang12", + "tools": { + "cc": { + "bottle": "android-ndk-r23", + "executable": "cc" + }, + "c++": { + "bottle": "android-ndk-r23", + "executable": "c++" + }, + "gcov": { + "bottle": "android-ndk-r23", + "executable": "llvm-cov" + }, + "strip": { + "bottle": "android-ndk-r23", + "executable": "strip" + }, + "objcopy": { + "bottle": "android-ndk-r23", + "executable": "objcopy" + }, + "nm": { + "bottle": "android-ndk-r23", + "executable": "nm" + }, + "llvm-cov": { + "bottle": "android-ndk-r23", + "executable": "llvm-cov" + }, + "llvm-profdata": { + "bottle": "android-ndk-r23", + "executable": "llvm-profdata" + }, + "llvm-symbolizer": { + "bottle": "android-ndk-r23", + "executable": "llvm-symbolizer" + } + }, + "platforms": [ + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "i686" + }, + "default": true + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "x86_64" + }, + "default": true + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a" + }, + "default": true + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a_neon" + }, + "default": true + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "armv8a" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "i686" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "x86_64" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a_neon" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "armv8a" + }, + "default": true + } + ], + "params": { + "type": "clang", + "match_root": "NDK", + "ar": "$(NDK)/llvm-toolchain/bin/llvm-ar", + "c_compiler": "$(NDK)/llvm-toolchain/bin/clang", + "cxx_compiler": "$(NDK)/llvm-toolchain/bin/clang++", + "objcopy": "$(NDK)/llvm-toolchain/bin/llvm-objcopy", + "strip": "$(NDK)/llvm-toolchain/bin/llvm-strip", + "werror_mode": "all", + "gcc_version": "12.0", + "android_ndk_version": 23 + } + }, + "android-ndk-r24": { + "name": "clang13", + "tools": { + "cc": { + "bottle": "android-ndk-r24", + "executable": "cc" + }, + "c++": { + "bottle": "android-ndk-r24", + "executable": "c++" + }, + "gcov": { + "bottle": "android-ndk-r24", + "executable": "llvm-cov" + }, + "strip": { + "bottle": "android-ndk-r24", + "executable": "strip" + }, + "objcopy": { + "bottle": "android-ndk-r24", + "executable": "objcopy" + }, + "nm": { + "bottle": "android-ndk-r24", + "executable": "nm" + }, + "llvm-cov": { + "bottle": "android-ndk-r24", + "executable": "llvm-cov" + }, + "llvm-profdata": { + "bottle": "android-ndk-r24", + "executable": "llvm-profdata" + }, + "llvm-symbolizer": { + "bottle": "android-ndk-r24", + "executable": "llvm-symbolizer" + } + }, + "platforms": [ + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "i686" + } + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "x86_64" + } + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a" + } + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a_neon" + } + }, + { + "host": { + "os": "LINUX" + }, + "target": { + "os": "ANDROID", + "arch": "armv8a" + } + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "i686" + } + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "x86_64" + } + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a" + } + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "armv7a_neon" + } + }, + { + "host": { + "os": "DARWIN" + }, + "target": { + "os": "ANDROID", + "arch": "armv8a" + } + } + ], + "params": { + "type": "clang", + "match_root": "NDK", + "ar": "$(NDK)/llvm-toolchain/bin/llvm-ar", + "c_compiler": "$(NDK)/llvm-toolchain/bin/clang", + "cxx_compiler": "$(NDK)/llvm-toolchain/bin/clang++", + "objcopy": "$(NDK)/llvm-toolchain/bin/llvm-objcopy", + "strip": "$(NDK)/llvm-toolchain/bin/llvm-strip", + "werror_mode": "all", + "gcc_version": "13.0", + "android_ndk_version": 24 + } + }, "bloat": { "tools": { "bloat": { "bottle": "bloat", - "executable": "bloat" + "executable": "bloat" } }, "platforms": [ @@ -2837,14 +2837,14 @@ } ] }, - "ipython": { - "tools": { + "ipython": { + "tools": { "ipython": { "bottle": "ptipython", "executable": "ptipython" } - }, - "platforms": [ + }, + "platforms": [ { "host": { "os": "LINUX" @@ -2863,16 +2863,16 @@ }, "default": true } - ] - }, - "ptpython": { - "tools": { + ] + }, + "ptpython": { + "tools": { "ptpython": { "bottle": "ptpython", "executable": "ptpython" } - }, - "platforms": [ + }, + "platforms": [ { "host": { "os": "LINUX" @@ -2891,8 +2891,8 @@ }, "default": true } - ] - }, + ] + }, "wine": { "tools": { "wine": { @@ -5947,13 +5947,13 @@ "bloat": { "formula": { "sandbox_id": [ - 801218211 + 801218211 ], "match": "Bloat" }, "executable": { - "bloat": [ - "bloat" + "bloat": [ + "bloat" ] } }, @@ -6257,51 +6257,107 @@ ] } }, - "android-ndk-r23": { - "formula": { - "sandbox_id": [ - 1125103574, - 1125105409 - ], - "match": "NDK" - }, - "executable": { - "c++": [ - "llvm-toolchain", - "bin", - "clang++" - ], - "cc": [ - "llvm-toolchain", - "bin", - "clang" - ], - "strip": [ - "llvm-toolchain", - "bin", - "llvm-strip" - ], - "c++filt": [ - "llvm-toolchain", - "bin", - "i686-linux-android-c++filt" - ], - "llvm-cov": [ - "llvm-toolchain", - "bin", - "llvm-cov" - ], - "llvm-profdata": [ - "llvm-toolchain", - "bin", - "llvm-profdata" - ], - "llvm-symbolizer": [ - "llvm-toolchain", - "bin", - "llvm-symbolizer" - ], - "nm": [ + "android-ndk-r23": { + "formula": { + "sandbox_id": [ + 1125103574, + 1125105409 + ], + "match": "NDK" + }, + "executable": { + "c++": [ + "llvm-toolchain", + "bin", + "clang++" + ], + "cc": [ + "llvm-toolchain", + "bin", + "clang" + ], + "strip": [ + "llvm-toolchain", + "bin", + "llvm-strip" + ], + "c++filt": [ + "llvm-toolchain", + "bin", + "i686-linux-android-c++filt" + ], + "llvm-cov": [ + "llvm-toolchain", + "bin", + "llvm-cov" + ], + "llvm-profdata": [ + "llvm-toolchain", + "bin", + "llvm-profdata" + ], + "llvm-symbolizer": [ + "llvm-toolchain", + "bin", + "llvm-symbolizer" + ], + "nm": [ + "llvm-toolchain", + "bin", + "llvm-nm" + ], + "objcopy": [ + "llvm-toolchain", + "bin", + "llvm-objcopy" + ] + } + }, + "android-ndk-r24": { + "formula": { + "sandbox_id": [ + 1125138634, + 1125141078 + ], + "match": "NDK" + }, + "executable": { + "c++": [ + "llvm-toolchain", + "bin", + "clang++" + ], + "cc": [ + "llvm-toolchain", + "bin", + "clang" + ], + "strip": [ + "llvm-toolchain", + "bin", + "llvm-strip" + ], + "c++filt": [ + "llvm-toolchain", + "bin", + "i686-linux-android-c++filt" + ], + "llvm-cov": [ + "llvm-toolchain", + "bin", + "llvm-cov" + ], + "llvm-profdata": [ + "llvm-toolchain", + "bin", + "llvm-profdata" + ], + "llvm-symbolizer": [ + "llvm-toolchain", + "bin", + "llvm-symbolizer" + ], + "nm": [ "llvm-toolchain", "bin", "llvm-nm" @@ -6312,62 +6368,6 @@ "llvm-objcopy" ] } - }, - "android-ndk-r24": { - "formula": { - "sandbox_id": [ - 1125138634, - 1125141078 - ], - "match": "NDK" - }, - "executable": { - "c++": [ - "llvm-toolchain", - "bin", - "clang++" - ], - "cc": [ - "llvm-toolchain", - "bin", - "clang" - ], - "strip": [ - "llvm-toolchain", - "bin", - "llvm-strip" - ], - "c++filt": [ - "llvm-toolchain", - "bin", - "i686-linux-android-c++filt" - ], - "llvm-cov": [ - "llvm-toolchain", - "bin", - "llvm-cov" - ], - "llvm-profdata": [ - "llvm-toolchain", - "bin", - "llvm-profdata" - ], - "llvm-symbolizer": [ - "llvm-toolchain", - "bin", - "llvm-symbolizer" - ], - "nm": [ - "llvm-toolchain", - "bin", - "llvm-nm" - ], - "objcopy": [ - "llvm-toolchain", - "bin", - "llvm-objcopy" - ] - } }, "cuda": { "formula": { @@ -7165,7 +7165,7 @@ "sandbox_id": 121751471, "match": "YouCompleteMe" } - }, + }, "rtags": { "formula": { "sandbox_id": 84460170, @@ -7217,26 +7217,26 @@ } }, "ptpython": { - "formula": { - "sandbox_id": 50746186, - "match": "PTPython" - }, - "executable": { + "formula": { + "sandbox_id": 50746186, + "match": "PTPython" + }, + "executable": { "ptpython": [ "ptpython" ] - } - }, + } + }, "ptipython": { - "formula": { - "sandbox_id": 50746160, - "match": "PTIPython" - }, - "executable": { + "formula": { + "sandbox_id": 50746160, + "match": "PTIPython" + }, + "executable": { "ptipython": [ "ptipython" ] - } + } }, "python3": { "formula": { diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 62f7fa896a..081833998b 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -11,7 +11,7 @@ FAKEID=3141592653 SANDBOX_FAKEID=${FAKEID}.7600000 CPP_FAKEID=9107927 GO_FAKEID=9056219 -ANDROID_FAKEID=8821472 +ANDROID_FAKEID=8821472 CLANG_TIDY_FAKEID=8625699 CURDIR=. @@ -868,8 +868,8 @@ macro _CPP_PROTO_EVLOG_CMD(File) { # process .proto as .ev .CMD=$CPP_PROTO_CMDLINE $CPP_EV_OPTS $CPP_PROTO_OUTS ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} .PEERDIR=library/cpp/eventlog contrib/libs/protobuf -} - +} + # tag:proto macro _CPP_CFGPROTO_CMD(File) { # keep extension in output just as in EV: this is hard-codeded behaviour of protoc for non-.proto extensions @@ -1158,10 +1158,10 @@ module _BASE_UNIT: _BARE_UNIT { otherwise { MACRO_ALIAS(EVLOG_CMD _CPP_EVLOG_CMD) MACRO_ALIAS(FBS_CMD _CPP_FLATC_CMD) - when ($BUILD_PROTO_AS_EVLOG == "yes") { + when ($BUILD_PROTO_AS_EVLOG == "yes") { MACRO_ALIAS(PROTO_CMD _CPP_PROTO_EVLOG_CMD) - } - otherwise { + } + otherwise { MACRO_ALIAS(PROTO_CMD _CPP_PROTO_CMD) } when ($USE_VANILLA_PROTOC == "yes") { @@ -1209,8 +1209,8 @@ module _BASE_UNIT: _BARE_UNIT { LDFLAGS+=-static-libubsan } "thread" ? { - PIE=yes - LDFLAGS+=-static-libtsan + PIE=yes + LDFLAGS+=-static-libtsan } } } @@ -1218,8 +1218,8 @@ module _BASE_UNIT: _BARE_UNIT { when ($HARDENING == "yes") { when ($CLANG) { CFLAGS+=-fstack-protector-all -D_hardening_enabled_ - LDFLAGS+=-z relro -z now -z noexecstack - PIE=yes + LDFLAGS+=-z relro -z now -z noexecstack + PIE=yes } } @@ -1380,29 +1380,29 @@ macro USE_LINKER_LLD() { } COMMON_LINK_SETTINGS= -LINK_ADDITIONAL_SECTIONS= -LINK_ADDITIONAL_SECTIONS_COMMAND= +LINK_ADDITIONAL_SECTIONS= +LINK_ADDITIONAL_SECTIONS_COMMAND= when ($COMMON_LINK_SETTINGS == "yes") { when ($_LINKER_ID == "lld" || $_LINKER_ID == "gold") { LDFLAGS += -Wl,--gdb-index } - when ($EMBED_LINKER_CREF == "yes") { + when ($EMBED_LINKER_CREF == "yes") { LDFLAGS+=-Wl,--cref ${tmp;stdout;pre=$MODULE_PREFIX;suf=.ldcref:REALPRJNAME} -Wl,--no-demangle LINK_ADDITIONAL_SECTIONS+=--add-section=.ya.linker_cref=${tmp;pre=$MODULE_PREFIX;suf=.ldcref:REALPRJNAME} } - elsewhen ($DUMP_LINKER_CREF == "yes") { + elsewhen ($DUMP_LINKER_CREF == "yes") { LDFLAGS+=-Wl,--cref ${output;stdout;pre=$MODULE_PREFIX;suf=.ldcref:REALPRJNAME} -Wl,--no-demangle - } + } - when ($EMBED_LINKER_MAP == "yes") { + when ($EMBED_LINKER_MAP == "yes") { LDFLAGS+=-Wl,-Map=${tmp;pre=$MODULE_PREFIX;suf=.map.$_LINKER_ID:REALPRJNAME} LINK_ADDITIONAL_SECTIONS+=--add-section=.ya.linker_map.${_LINKER_ID}=${tmp;pre=$MODULE_PREFIX;suf=.map.$_LINKER_ID:REALPRJNAME} } - elsewhen ($DUMP_LINKER_MAP == "yes") { + elsewhen ($DUMP_LINKER_MAP == "yes") { LDFLAGS+=-Wl,-Map=${output;rootrel;pre=$MODULE_PREFIX;suf=.map.$_LINKER_ID:REALPRJNAME} - } + } when ($USE_MKL == "yes") { NOPLATFORM=yes @@ -1507,11 +1507,11 @@ when ($COMMON_LINK_SETTINGS == "yes") { } } -when ($EMBED_LINKER_MAP == "yes" || $EMBED_LINKER_CREF == "yes") { - LINK_ADDITIONAL_SECTIONS_COMMAND+= \ - $OBJCOPY_TOOL $LINK_ADDITIONAL_SECTIONS $TARGET -} - +when ($EMBED_LINKER_MAP == "yes" || $EMBED_LINKER_CREF == "yes") { + LINK_ADDITIONAL_SECTIONS_COMMAND+= \ + $OBJCOPY_TOOL $LINK_ADDITIONAL_SECTIONS $TARGET +} + _SO_EXT_FILTER=${ext=.so:PEERS} ${hide;late_out;nopath;ext=.so;pre=$BINDIR/:PEERS} when ($OS_WINDOWS == "yes") { _SO_EXT_FILTER=${ext=.dll:PEERS} ${hide;late_out;nopath;ext=.dll;pre=$BINDIR/:PEERS} @@ -1623,7 +1623,7 @@ module _BASE_PROGRAM: _LINK_UNIT { MODULE_SUFFIX=.tidyjson } - when ($MSVC != "yes" && $NOPLATFORM != "yes" && $WITH_VALGRIND != "yes" && $USE_ASMLIB != "no" && $MIC_ARCH != "yes" && $PIC != "yes" && $PIE != "yes") { + when ($MSVC != "yes" && $NOPLATFORM != "yes" && $WITH_VALGRIND != "yes" && $USE_ASMLIB != "no" && $MIC_ARCH != "yes" && $PIC != "yes" && $PIE != "yes") { PEERDIR+=contrib/libs/asmlib } @@ -1798,30 +1798,30 @@ module PYCR_PROGRAM: PY3_PROGRAM_BIN { ### @usage: EXPORTS_SCRIPT(exports_file) ### -### Specify exports script within PROGRAM, DLL and DLL-derived modules. +### Specify exports script within PROGRAM, DLL and DLL-derived modules. ### This accepts 2 kind of files: .exports with <lang symbol> pairs and JSON-line .symlist files. -### The other option use EXPORTS parameter of the DLL module itself. +### The other option use EXPORTS parameter of the DLL module itself. ### ### @see: [DLL](#module_DLL) macro EXPORTS_SCRIPT(Arg) { SET(EXPORTS_FILE $Arg) } -### @usage: NO_EXPORT_DYNAMIC_SYMBOLS() -### -### Disable exporting all non-hidden symbols as dynamic when linking a PROGRAM. -macro NO_EXPORT_DYNAMIC_SYMBOLS() { - ENABLE(NO_EXPORT_DYNAMIC_SYMBOLS) -} - -### @usage: EXPORT_ALL_DYNAMIC_SYMBOLS() -### -### Export all non-hidden symbols as dynamic when linking a PROGRAM. -macro EXPORT_ALL_DYNAMIC_SYMBOLS() { - # Dummy: default behaviour - ENABLE(EXPORT_ALL_DYNAMIC_SYMBOLS) -} - +### @usage: NO_EXPORT_DYNAMIC_SYMBOLS() +### +### Disable exporting all non-hidden symbols as dynamic when linking a PROGRAM. +macro NO_EXPORT_DYNAMIC_SYMBOLS() { + ENABLE(NO_EXPORT_DYNAMIC_SYMBOLS) +} + +### @usage: EXPORT_ALL_DYNAMIC_SYMBOLS() +### +### Export all non-hidden symbols as dynamic when linking a PROGRAM. +macro EXPORT_ALL_DYNAMIC_SYMBOLS() { + # Dummy: default behaviour + ENABLE(EXPORT_ALL_DYNAMIC_SYMBOLS) +} + ### @usage: CUSTOM_LINK_STEP_SCRIPT(name) ### ### Specifies name of a script for custom link step. The scripts @@ -1874,8 +1874,8 @@ module YT_UNITTEST: _BASE_UNITTEST { ### Generic unit test module. module UNITTEST_WITH_CUSTOM_ENTRY_POINT: _BASE_UNITTEST { ADD_YTEST($MODULE_PREFIX$REALPRJNAME unittest.py) -} - +} + # tag:cpp-specific tag:test ### @usage: GTEST([name]) ### @@ -5342,14 +5342,14 @@ when ($STRIP == "yes" && $NO_STRIP != "yes") { GO_LINK_FLAGS_VALUE+=-s } -when ($NO_LINKER_DCE != "yes") { - DCE_FLAG=$LD_DCE_FLAG -} +when ($NO_LINKER_DCE != "yes") { + DCE_FLAG=$LD_DCE_FLAG +} + +when ($BT_MINSIZEREL == "yes" || $LINKER_ICF == "yes") { + ICF_FLAG=$LD_ICF_FLAG +} -when ($BT_MINSIZEREL == "yes" || $LINKER_ICF == "yes") { - ICF_FLAG=$LD_ICF_FLAG -} - OBJCOPY_TOOL=$OBJCOPY_TOOL_VENDOR STRIP_TOOL=$STRIP_TOOL_VENDOR NEED_BINUTILS_PEERDIR= @@ -5713,11 +5713,11 @@ macro ADDINCLSELF(FOR="") { COMPILE_OUT_SUFFIX= _COMPILE_OUTPUTS=${output;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}:SRC} -_COMPILE_TIME_TRACE_OUTPUTS=${output;noauto;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}.time_trace.json:SRC} +_COMPILE_TIME_TRACE_OUTPUTS=${output;noauto;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}.time_trace.json:SRC} macro SET_COMPILE_OUTPUTS_MODIFIERS(NOREL?";norel":"") { SET(_COMPILE_OUTPUTS \${output;suf=\${OBJECT_SUF}$NOREL:SRC}) - SET(_COMPILE_TIME_TRACE_OUTPUTS \${output;noauto;suf=\${OBJECT_SUF}.time_trace.json$NOREL:SRC}) + SET(_COMPILE_TIME_TRACE_OUTPUTS \${output;noauto;suf=\${OBJECT_SUF}.time_trace.json$NOREL:SRC}) } _EMPTY_CMD= @@ -6384,7 +6384,7 @@ macro _PY3_REGISTER(Func) { macro _PY_COMPILE_BYTECODE(SrcX, Src, Dst) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/py_compile.py"} $SrcX ${input:Src} ${output;noauto:Dst.yapyc} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p PY"} ${kv;hide:"pc yellow"} } - + # tag:python-processing tag:internal ### @usage: _PY3_COMPILE_BYTECODE(SrcX Src) # internal ### @@ -6450,9 +6450,9 @@ VCS_INFO_DISABLE_CACHE__NO_UID__= YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__= CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__= CL_MACRO_INFO_DISABLE_CACHE__NO_UID__= -YASM_DEBUG_INFO= -CL_DEBUG_INFO= -CL_MACRO_INFO= +YASM_DEBUG_INFO= +CL_DEBUG_INFO= +CL_MACRO_INFO= when ($FORCE_VCS_INFO_UPDATE == "yes") { VCS_INFO_DISABLE_CACHE__NO_UID__=${hide;kv:"disable_cache"} } diff --git a/build/ymake_conf.py b/build/ymake_conf.py index 2278c670ea..30219eb85e 100755 --- a/build/ymake_conf.py +++ b/build/ymake_conf.py @@ -54,22 +54,22 @@ class Platform(object): self.is_x86_64 = self.arch in ('x86_64', 'amd64') self.is_intel = self.is_x86 or self.is_x86_64 - self.is_armv7 = self.arch in ('armv7', 'armv7a', 'armv7a_neon', 'arm', 'armv7a_cortex_a9', 'armv7ahf_cortex_a35', 'armv7ahf_cortex_a53') + self.is_armv7 = self.arch in ('armv7', 'armv7a', 'armv7a_neon', 'arm', 'armv7a_cortex_a9', 'armv7ahf_cortex_a35', 'armv7ahf_cortex_a53') self.is_armv8 = self.arch in ('armv8', 'armv8a', 'arm64', 'aarch64', 'armv8a_cortex_a35', 'armv8a_cortex_a53') self.is_armv8m = self.arch in ('armv8m_cortex_m33',) self.is_arm64 = self.arch in ('arm64',) self.is_arm = self.is_armv7 or self.is_armv8 or self.is_armv8m - self.is_armv7_neon = self.arch in ('armv7a_neon', 'armv7a_cortex_a9', 'armv7ahf_cortex_a35', 'armv7ahf_cortex_a53') - self.is_armv7hf = self.arch in ('armv7ahf_cortex_a35', 'armv7ahf_cortex_a53') - - self.armv7_float_abi = None - if self.is_armv7: - if self.is_armv7hf: - self.armv7_float_abi = 'hard' - else: - self.armv7_float_abi = 'softfp' - - self.is_cortex_a9 = self.arch in ('armv7a_cortex_a9',) + self.is_armv7_neon = self.arch in ('armv7a_neon', 'armv7a_cortex_a9', 'armv7ahf_cortex_a35', 'armv7ahf_cortex_a53') + self.is_armv7hf = self.arch in ('armv7ahf_cortex_a35', 'armv7ahf_cortex_a53') + + self.armv7_float_abi = None + if self.is_armv7: + if self.is_armv7hf: + self.armv7_float_abi = 'hard' + else: + self.armv7_float_abi = 'softfp' + + self.is_cortex_a9 = self.arch in ('armv7a_cortex_a9',) self.is_cortex_a35 = self.arch in ('armv7ahf_cortex_a35', 'armv8a_cortex_a35') self.is_cortex_a53 = self.arch in ('armv7ahf_cortex_a53', 'armv8a_cortex_a53') self.is_cortex_m33 = self.arch in ('armv8m_cortex_m33',) @@ -103,13 +103,13 @@ class Platform(object): self.is_windows_x86_64 = self.is_windows and self.is_x86_64 self.is_android = self.os == 'android' - if self.is_android: - # This is default Android API level unless `ANDROID_API` is specified + if self.is_android: + # This is default Android API level unless `ANDROID_API` is specified # 18 is the smallest level with OpenGL support - # 21 is the smallest level for 64-bit platforms + # 21 is the smallest level for 64-bit platforms default_android_api = 21 if self.is_64_bit else 18 - self.android_api = int(preset('ANDROID_API', default_android_api)) - + self.android_api = int(preset('ANDROID_API', default_android_api)) + self.is_cygwin = self.os == 'cygwin' self.is_yocto = self.os == 'yocto' @@ -130,11 +130,11 @@ class Platform(object): # 'OS_LINUX' variable yield 'OS_{}'.format(self.os.upper()) - # yocto is linux - if 'yocto' in self.os: - yield 'LINUX' - yield 'OS_LINUX' - + # yocto is linux + if 'yocto' in self.os: + yield 'LINUX' + yield 'OS_LINUX' + if self.is_macos: yield 'DARWIN' yield 'OS_DARWIN' @@ -542,10 +542,10 @@ class Build(object): return self.build_type == 'fastdebug' @property - def is_size_optimized(self): - return self.build_type == 'minsizerel' - - @property + def is_size_optimized(self): + return self.build_type == 'minsizerel' + + @property def is_coverage(self): return self.build_type == 'coverage' @@ -784,12 +784,12 @@ when (($USEMPROF == "yes") || ($USE_MPROF == "yes")) { for variable in self.platform.os_variables: emit(variable, 'yes') - if self.platform.is_armv7: - emit('ARM7_FLOAT_ABI', self.platform.armv7_float_abi) - - if self.platform.is_android: + if self.platform.is_armv7: + emit('ARM7_FLOAT_ABI', self.platform.armv7_float_abi) + + if self.platform.is_android: emit('ANDROID_API', str(self.platform.android_api)) - + if self.platform.is_posix: self.print_nix_target_const() if self.platform.is_linux: @@ -962,11 +962,11 @@ class ToolchainOptions(object): # default C++ standard is set here, some older toolchains might need to redefine it in ya.conf.json self.cxx_std = self.params.get('cxx_std', 'c++20') - + self._env = tc_json.get('env', {}) - self.android_ndk_version = self.params.get('android_ndk_version', None) - + self.android_ndk_version = self.params.get('android_ndk_version', None) + logger.debug('c_compiler=%s', self.c_compiler) logger.debug('cxx_compiler=%s', self.cxx_compiler) @@ -1039,12 +1039,12 @@ class GnuToolchainOptions(ToolchainOptions): if self.target.is_armv8: return 'ubuntu-16' - if self.target.is_armv7 and self.target.armv7_float_abi == 'hard': + if self.target.is_armv7 and self.target.armv7_float_abi == 'hard': return 'ubuntu-16' - if self.target.is_armv7 and self.target.armv7_float_abi == 'softfp': - return 'ubuntu-18' - + if self.target.is_armv7 and self.target.armv7_float_abi == 'softfp': + return 'ubuntu-18' + if self.target.is_powerpc: return 'ubuntu-14' @@ -1091,7 +1091,7 @@ class GnuToolchain(Toolchain): sdk_native_version = 10.11 if not preset('EXPERIMENTAL_MACOS_M1_SUPPORT') else '11.1' if target.is_macos: return '$MACOS_SDK_RESOURCE_GLOBAL/MacOSX{}.sdk'.format(sdk_native_version) - elif target.is_yocto: + elif target.is_yocto: return '$YOCTO_SDK_RESOURCE_GLOBAL' return '$OS_SDK_ROOT_RESOURCE_GLOBAL' @@ -1160,8 +1160,8 @@ class GnuToolchain(Toolchain): target_triple = select(default=None, selectors=[ (target.is_linux and target.is_x86_64, 'x86_64-linux-gnu'), (target.is_linux and target.is_armv8, 'aarch64-linux-gnu'), - (target.is_linux and target.is_armv7 and target.armv7_float_abi == 'hard', 'arm-linux-gnueabihf'), - (target.is_linux and target.is_armv7 and target.armv7_float_abi == 'softfp', 'arm-linux-gnueabi'), + (target.is_linux and target.is_armv7 and target.armv7_float_abi == 'hard', 'arm-linux-gnueabihf'), + (target.is_linux and target.is_armv7 and target.armv7_float_abi == 'softfp', 'arm-linux-gnueabi'), (target.is_linux and target.is_powerpc, 'powerpc64le-linux-gnu'), (target.is_iossim and target.is_arm64, 'arm64-apple-ios{}-simulator'.format(ios_version_min)), (target.is_apple and target.is_x86, 'i386-apple-darwin14'), @@ -1169,18 +1169,18 @@ class GnuToolchain(Toolchain): (target.is_apple and target.is_macos_arm64, 'arm64-apple-macos11'), (target.is_apple and target.is_armv7, 'armv7-apple-darwin14'), (target.is_apple and target.is_armv8, 'arm64-apple-darwin14'), - (target.is_yocto and target.is_armv7, 'arm-poky-linux-gnueabi'), - (target.is_android and target.is_x86, 'i686-linux-android'), - (target.is_android and target.is_x86_64, 'x86_64-linux-android'), - (target.is_android and target.is_armv7, 'armv7a-linux-androideabi'), - (target.is_android and target.is_armv8, 'aarch64-linux-android'), + (target.is_yocto and target.is_armv7, 'arm-poky-linux-gnueabi'), + (target.is_android and target.is_x86, 'i686-linux-android'), + (target.is_android and target.is_x86_64, 'x86_64-linux-android'), + (target.is_android and target.is_armv7, 'armv7a-linux-androideabi'), + (target.is_android and target.is_armv8, 'aarch64-linux-android'), ]) - if target.is_android: - # Android NDK allows specification of API level in target triple, e.g.: - # armv7a-linux-androideabi16, aarch64-linux-android21 - target_triple += str(target.android_api) - + if target.is_android: + # Android NDK allows specification of API level in target triple, e.g.: + # armv7a-linux-androideabi16, aarch64-linux-android21 + target_triple += str(target.android_api) + if target_triple: self.c_flags_platform.append('--target={}'.format(target_triple)) @@ -1188,12 +1188,12 @@ class GnuToolchain(Toolchain): for root in list(self.tc.isystem): self.c_flags_platform.extend(['-isystem', root]) - if target.is_android: - self.c_flags_platform.extend(['-isystem', '{}/sources/cxx-stl/llvm-libc++abi/include'.format(self.tc.name_marker)]) - - if target.is_cortex_a9: - self.c_flags_platform.append('-mcpu=cortex-a9') - + if target.is_android: + self.c_flags_platform.extend(['-isystem', '{}/sources/cxx-stl/llvm-libc++abi/include'.format(self.tc.name_marker)]) + + if target.is_cortex_a9: + self.c_flags_platform.append('-mcpu=cortex-a9') + if target.is_cortex_a35: self.c_flags_platform.append('-mcpu=cortex-a35') @@ -1207,15 +1207,15 @@ class GnuToolchain(Toolchain): self.c_flags_platform.append('-mfpu=neon') if (target.is_armv7 or target.is_armv8m) and build.is_size_optimized: - # Enable ARM Thumb2 variable-length instruction encoding - # to reduce code size - self.c_flags_platform.append('-mthumb') - + # Enable ARM Thumb2 variable-length instruction encoding + # to reduce code size + self.c_flags_platform.append('-mthumb') + if target.is_arm or target.is_powerpc: - # On linux, ARM and PPC default to unsigned char - # However, Arcadia requires char to be signed - self.c_flags_platform.append('-fsigned-char') - + # On linux, ARM and PPC default to unsigned char + # However, Arcadia requires char to be signed + self.c_flags_platform.append('-fsigned-char') + if self.tc.is_clang or self.tc.is_gcc and self.tc.version_at_least(8, 2): target_flags = select(default=[], selectors=[ (target.is_linux and target.is_power8le, ['-mcpu=power8', '-mtune=power8', '-maltivec']), @@ -1361,33 +1361,33 @@ class GnuCompiler(Compiler): # Issue a warning if certain overload is hidden due to inheritance '-Woverloaded-virtual', ] - + # Disable some warnings which will fail compilation at the time self.c_warnings += [ '-Wno-parentheses' ] - self.c_defines = ['-DFAKEID=$CPP_FAKEID'] - if self.target.is_android: - self.c_defines.append('-DANDROID_FAKEID=$ANDROID_FAKEID') - - self.c_defines.extend([ - '-DARCADIA_ROOT=${ARCADIA_ROOT}', - '-DARCADIA_BUILD_ROOT=${ARCADIA_BUILD_ROOT}', - ]) - - self.c_defines.extend([ + self.c_defines = ['-DFAKEID=$CPP_FAKEID'] + if self.target.is_android: + self.c_defines.append('-DANDROID_FAKEID=$ANDROID_FAKEID') + + self.c_defines.extend([ + '-DARCADIA_ROOT=${ARCADIA_ROOT}', + '-DARCADIA_BUILD_ROOT=${ARCADIA_BUILD_ROOT}', + ]) + + self.c_defines.extend([ '-D_THREAD_SAFE', '-D_PTHREADS', '-D_REENTRANT', '-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES', '-D_LARGEFILE_SOURCE', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS', - ]) + ]) if not self.target.is_android: # There is no usable _FILE_OFFSET_BITS=64 support in Androids until API 21. And it's incomplete until at least API 24. # https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md - # Arcadia have API 16 for 32-bit Androids. + # Arcadia have API 16 for 32-bit Androids. self.c_defines.append('-D_FILE_OFFSET_BITS=64') - if self.target.is_linux or self.target.is_android or self.target.is_cygwin: + if self.target.is_linux or self.target.is_android or self.target.is_cygwin: self.c_defines.append('-D_GNU_SOURCE') if self.tc.is_clang and self.target.is_linux and self.target.is_x86_64: @@ -1400,7 +1400,7 @@ class GnuCompiler(Compiler): self.extra_compile_opts = [] - self.c_flags = ['$CL_DEBUG_INFO', '$CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__'] + self.c_flags = ['$CL_DEBUG_INFO', '$CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__'] self.c_flags += self.tc.arch_opt + ['-pipe'] self.sfdl_flags = ['-E', '-C', '-x', 'c++'] @@ -1448,11 +1448,11 @@ class GnuCompiler(Compiler): self.c_foptions.append('-fno-delete-null-pointer-checks') self.c_foptions.append('-fabi-version=8') - # Split all functions and data into separate sections for DCE and ICF linker passes - # NOTE: iOS build uses -fembed-bitcode which conflicts with -ffunction-sections (only relevant for ELF targets) - if not self.target.is_ios: - self.c_foptions.extend(['-ffunction-sections', '-fdata-sections']) - + # Split all functions and data into separate sections for DCE and ICF linker passes + # NOTE: iOS build uses -fembed-bitcode which conflicts with -ffunction-sections (only relevant for ELF targets) + if not self.target.is_ios: + self.c_foptions.extend(['-ffunction-sections', '-fdata-sections']) + def configure_build_type(self): if self.build.is_valgrind: self.c_defines.append('-DWITH_VALGRIND=1') @@ -1465,18 +1465,18 @@ class GnuCompiler(Compiler): if self.build.is_release: self.c_flags.append('$OPTIMIZE') - if self.build.is_size_optimized: - # -Oz is clang's more size-aggressive version of -Os - # For ARM specifically, clang -Oz is on par with gcc -Os: - # https://github.com/android/ndk/issues/133#issuecomment-365763507 - if self.tc.is_clang: - self.optimize = '-Oz' - else: - self.optimize = '-Os' - - # Generate sections with address significance tables for ICF linker pass - if self.tc.is_clang: - self.c_foptions.extend(['-faddrsig']) + if self.build.is_size_optimized: + # -Oz is clang's more size-aggressive version of -Os + # For ARM specifically, clang -Oz is on par with gcc -Os: + # https://github.com/android/ndk/issues/133#issuecomment-365763507 + if self.tc.is_clang: + self.optimize = '-Oz' + else: + self.optimize = '-Os' + + # Generate sections with address significance tables for ICF linker pass + if self.tc.is_clang: + self.c_foptions.extend(['-faddrsig']) else: self.optimize = '-O3' @@ -1505,19 +1505,19 @@ class GnuCompiler(Compiler): append('C_WARNING_OPTS', self.c_warnings) append('CXX_WARNING_OPTS', self.cxx_warnings) - # PIE is only valid for executables, while PIC implies a shared library - # `-pie` with a shared library is either ignored or fails to link + # PIE is only valid for executables, while PIC implies a shared library + # `-pie` with a shared library is either ignored or fails to link emit_big(''' - when ($PIC == "yes") { - CFLAGS+=-fPIC - LDFLAGS+=-fPIC + when ($PIC == "yes") { + CFLAGS+=-fPIC + LDFLAGS+=-fPIC } - elsewhen ($PIE == "yes") { - CFLAGS+=-fPIE - LDFLAGS+=-fPIE -pie + elsewhen ($PIE == "yes") { + CFLAGS+=-fPIE + LDFLAGS+=-fPIE -pie }''') - append('CFLAGS', self.c_flags, '$DEBUG_INFO_FLAGS', self.c_foptions, '$C_WARNING_OPTS', '$GCC_PREPROCESSOR_OPTS', '$USER_CFLAGS', '$USER_CFLAGS_GLOBAL') + append('CFLAGS', self.c_flags, '$DEBUG_INFO_FLAGS', self.c_foptions, '$C_WARNING_OPTS', '$GCC_PREPROCESSOR_OPTS', '$USER_CFLAGS', '$USER_CFLAGS_GLOBAL') append('CXXFLAGS', '$CFLAGS', '-std=' + self.tc.cxx_std, '$CXX_WARNING_OPTS', '$USER_CXXFLAGS', '$USER_CXXFLAGS_GLOBAL') append('CONLYFLAGS', '$USER_CONLYFLAGS', '$USER_CONLYFLAGS_GLOBAL') emit('CXX_COMPILER_UNQUOTED', self.tc.cxx_compiler) @@ -1548,26 +1548,26 @@ class GnuCompiler(Compiler): }''') c_builtins = [ - "-Wno-builtin-macro-redefined", - '-D__DATE__=\\""Sep 31 2019\\""', - '-D__TIME__=\\"00:00:00\\"', + "-Wno-builtin-macro-redefined", + '-D__DATE__=\\""Sep 31 2019\\""', + '-D__TIME__=\\"00:00:00\\"', ] - compiler_supports_macro_prefix_map = ( - self.tc.is_clang and self.tc.version_at_least(10) or - self.tc.is_gcc and self.tc.version_at_least(8) - ) - if compiler_supports_macro_prefix_map: - c_builtins += [ - # XXX does not support non-normalized paths - "-fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/=", - "-fmacro-prefix-map=${ARCADIA_ROOT}/=", - "-fmacro-prefix-map=$(TOOL_ROOT)/=", - ] - else: - c_builtins += [ - # XXX this macro substitution breaks __FILE__ in included sources - '-D__FILE__=\\""${input;qe;rootrel:SRC}\\""', - ] + compiler_supports_macro_prefix_map = ( + self.tc.is_clang and self.tc.version_at_least(10) or + self.tc.is_gcc and self.tc.version_at_least(8) + ) + if compiler_supports_macro_prefix_map: + c_builtins += [ + # XXX does not support non-normalized paths + "-fmacro-prefix-map=${ARCADIA_BUILD_ROOT}/=", + "-fmacro-prefix-map=${ARCADIA_ROOT}/=", + "-fmacro-prefix-map=$(TOOL_ROOT)/=", + ] + else: + c_builtins += [ + # XXX this macro substitution breaks __FILE__ in included sources + '-D__FILE__=\\""${input;qe;rootrel:SRC}\\""', + ] c_debug_map = [ # XXX does not support non-normalized paths "-fdebug-prefix-map=${ARCADIA_BUILD_ROOT}=/-B", @@ -1591,17 +1591,17 @@ class GnuCompiler(Compiler): "--replace=$(TOOL_ROOT)=/-T" ] emit_big(''' - when ($FORCE_CONSISTENT_DEBUG == "yes") {{ + when ($FORCE_CONSISTENT_DEBUG == "yes") {{ + when ($CLANG == "yes") {{ + CL_DEBUG_INFO={c_debug_cl} + }} + otherwise {{ + CL_DEBUG_INFO={c_debug} + }} + YASM_DEBUG_INFO={yasm_debug} + }} + elsewhen ($CONSISTENT_DEBUG == "yes") {{ when ($CLANG == "yes") {{ - CL_DEBUG_INFO={c_debug_cl} - }} - otherwise {{ - CL_DEBUG_INFO={c_debug} - }} - YASM_DEBUG_INFO={yasm_debug} - }} - elsewhen ($CONSISTENT_DEBUG == "yes") {{ - when ($CLANG == "yes") {{ CL_DEBUG_INFO_DISABLE_CACHE__NO_UID__={c_debug_cl} }} otherwise {{ @@ -1619,10 +1619,10 @@ class GnuCompiler(Compiler): YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__={yasm_debug_light} }} - when ($FORCE_CONSISTENT_BUILD == "yes") {{ - CL_MACRO_INFO={macro} - }} - elsewhen ($CONSISTENT_BUILD == "yes") {{ + when ($FORCE_CONSISTENT_BUILD == "yes") {{ + CL_MACRO_INFO={macro} + }} + elsewhen ($CONSISTENT_BUILD == "yes") {{ CL_MACRO_INFO_DISABLE_CACHE__NO_UID__={macro} }} '''.format(c_debug=' '.join(c_debug_map), @@ -1652,16 +1652,16 @@ class GnuCompiler(Compiler): elif is_positive('DUMP_COMPILER_DEPS_FAST'): emit('DUMP_DEPS', '-E', '-M', '-MF', '${output;noauto;suf=${OBJ_SUF}.o.d:SRC}') - compiler_time_trace_requested = is_positive('TIME_TRACE') or is_positive('COMPILER_TIME_TRACE') - compiler_supports_time_trace = self.tc.is_clang and self.tc.version_at_least(9) - if compiler_time_trace_requested and compiler_supports_time_trace: - compiler_time_trace_granularity = preset('TIME_TRACE_GRANULARITY', '500') - emit('COMPILER_TIME_TRACE_FLAGS', '-ftime-trace -ftime-trace-granularity=' + compiler_time_trace_granularity) - emit('COMPILER_TIME_TRACE_POSTPROCESS', '${YMAKE_PYTHON}', '${input:"build/scripts/find_time_trace.py"}', '$_COMPILE_OUTPUTS', '$_COMPILE_TIME_TRACE_OUTPUTS') - else: - emit('COMPILER_TIME_TRACE_FLAGS') - emit('COMPILER_TIME_TRACE_POSTPROCESS') - + compiler_time_trace_requested = is_positive('TIME_TRACE') or is_positive('COMPILER_TIME_TRACE') + compiler_supports_time_trace = self.tc.is_clang and self.tc.version_at_least(9) + if compiler_time_trace_requested and compiler_supports_time_trace: + compiler_time_trace_granularity = preset('TIME_TRACE_GRANULARITY', '500') + emit('COMPILER_TIME_TRACE_FLAGS', '-ftime-trace -ftime-trace-granularity=' + compiler_time_trace_granularity) + emit('COMPILER_TIME_TRACE_POSTPROCESS', '${YMAKE_PYTHON}', '${input:"build/scripts/find_time_trace.py"}', '$_COMPILE_OUTPUTS', '$_COMPILE_TIME_TRACE_OUTPUTS') + else: + emit('COMPILER_TIME_TRACE_FLAGS') + emit('COMPILER_TIME_TRACE_POSTPROCESS') + append('EXTRA_OUTPUT') style = ['${requirements;hide:CC_REQUIREMENTS} ${hide;kv:"p CC"} ${hide;kv:"pc green"}'] @@ -1674,14 +1674,14 @@ class GnuCompiler(Compiler): '$CXXFLAGS', '$CL_MACRO_INFO', '$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__', - '$COMPILER_TIME_TRACE_FLAGS', + '$COMPILER_TIME_TRACE_FLAGS', '$EXTRA_OUTPUT', '$SRCFLAGS', '$_LANG_CFLAGS_VALUE', '${input:SRC}', '$TOOLCHAIN_ENV', '$YNDEXER_OUTPUT', - '&& $COMPILER_TIME_TRACE_POSTPROCESS', + '&& $COMPILER_TIME_TRACE_POSTPROCESS', ] + style c_args = [ @@ -1694,13 +1694,13 @@ class GnuCompiler(Compiler): '$CL_MACRO_INFO', '$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__', '$CONLYFLAGS', - '$COMPILER_TIME_TRACE_FLAGS', + '$COMPILER_TIME_TRACE_FLAGS', '$EXTRA_OUTPUT', '$SRCFLAGS', '${input:SRC}', '$TOOLCHAIN_ENV', '$YNDEXER_OUTPUT', - '&& $COMPILER_TIME_TRACE_POSTPROCESS', + '&& $COMPILER_TIME_TRACE_POSTPROCESS', ] + style ignore_c_args_no_deps = [ @@ -1709,11 +1709,11 @@ class GnuCompiler(Compiler): '$CLANG_TIDY_ARGS', '$YNDEXER_ARGS', '$YNDEXER_OUTPUT', - '$COMPILER_TIME_TRACE_FLAGS', + '$COMPILER_TIME_TRACE_FLAGS', '$EXTRA_OUTPUT', '$CL_MACRO_INFO', - '$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__', - '&& $COMPILER_TIME_TRACE_POSTPROCESS', + '$CL_MACRO_INFO_DISABLE_CACHE__NO_UID__', + '&& $COMPILER_TIME_TRACE_POSTPROCESS', ] c_args_nodeps = [c if c != '$GCC_COMPILE_FLAGS' else '$EXTRA_C_FLAGS -c -o ${OUTFILE} ${SRC} ${pre=-I:INC}' for c in c_args if c not in ignore_c_args_no_deps] @@ -1754,34 +1754,34 @@ class Linker(object): """ self.tc = tc self.build = build - self.type = self._get_default_linker_type() - - def _get_default_linker_type(self): - if not self.tc.is_from_arcadia: - # External (e.g. system) toolchain: disable linker selection logic - return None - - if self.build.target.is_android: - # Android toolchain is NDK, LLD works on all supported platforms - return Linker.LLD - - elif self.build.target.is_linux: + self.type = self._get_default_linker_type() + + def _get_default_linker_type(self): + if not self.tc.is_from_arcadia: + # External (e.g. system) toolchain: disable linker selection logic + return None + + if self.build.target.is_android: + # Android toolchain is NDK, LLD works on all supported platforms + return Linker.LLD + + elif self.build.target.is_linux: # DEVTOOLS-6782: LLD8 fails to link LTO builds with in-memory ELF objects larger than 4 GiB blacklist_lld = is_positive('CLANG7') and is_positive('USE_LTO') and not is_positive('MUSL') if self.tc.is_clang and not blacklist_lld: return Linker.LLD else: - # GCC et al. + # GCC et al. if self.tc.is_gcc and is_positive('MUSL'): # See MUSL_BFD comment below return Linker.BFD - return Linker.GOLD + return Linker.GOLD + + # There is no linker choice on Darwin (ld64) or Windows (link.exe) + return None - # There is no linker choice on Darwin (ld64) or Windows (link.exe) - return None - def print_linker(self): self._print_linker_selector() @@ -1838,35 +1838,35 @@ class LD(Linker): self.ld_flags = [] - # Save linker's stdout to an additional .txt output file - # e.g. LLD writes `--print-gc-sections` or `--print-icf-sections` to stdout - self.save_linker_output = False - - # Enable section-level DCE (dead code elimination): - # remove whole unused code and data sections - # (needs `-ffunction-sections` and `-fdata-sections` to be useful) - # - # NOTE: CGO linker doesn't seem to support DCE, but shares common LDFLAGS - if target.is_macos: - self.ld_dce_flag = '-Wl,-dead_strip' - elif target.is_linux or target.is_android: - self.ld_dce_flag = '-Wl,--gc-sections' - if preset('LINKER_DCE_PRINT_SECTIONS'): - self.save_linker_output = True - self.ld_dce_flag += ' -Wl,--print-gc-sections' - else: - self.ld_dce_flag = '' - - if self.type == Linker.LLD: - # Enable ICF (identical code folding pass) in safe mode - # https://research.google/pubs/pub36912/ - self.ld_icf_flag = '-Wl,-icf=safe' - if preset('LINKER_ICF_PRINT_SECTIONS'): - self.save_linker_output = True - self.ld_icf_flag += ' -Wl,--print-icf-sections' - else: - self.ld_icf_flag = '' - + # Save linker's stdout to an additional .txt output file + # e.g. LLD writes `--print-gc-sections` or `--print-icf-sections` to stdout + self.save_linker_output = False + + # Enable section-level DCE (dead code elimination): + # remove whole unused code and data sections + # (needs `-ffunction-sections` and `-fdata-sections` to be useful) + # + # NOTE: CGO linker doesn't seem to support DCE, but shares common LDFLAGS + if target.is_macos: + self.ld_dce_flag = '-Wl,-dead_strip' + elif target.is_linux or target.is_android: + self.ld_dce_flag = '-Wl,--gc-sections' + if preset('LINKER_DCE_PRINT_SECTIONS'): + self.save_linker_output = True + self.ld_dce_flag += ' -Wl,--print-gc-sections' + else: + self.ld_dce_flag = '' + + if self.type == Linker.LLD: + # Enable ICF (identical code folding pass) in safe mode + # https://research.google/pubs/pub36912/ + self.ld_icf_flag = '-Wl,-icf=safe' + if preset('LINKER_ICF_PRINT_SECTIONS'): + self.save_linker_output = True + self.ld_icf_flag += ' -Wl,--print-icf-sections' + else: + self.ld_icf_flag = '' + if self.musl.value: self.ld_flags.extend(['-Wl,--no-as-needed']) if self.tc.is_gcc: @@ -1880,19 +1880,19 @@ class LD(Linker): self.ld_flags.extend(('-Wl,-Bstatic', '-latomic', '-Wl,-Bdynamic')) elif target.is_android: self.ld_flags.extend(['-ldl', '-Wl,--no-as-needed']) - if self.type == Linker.LLD and target.android_api < 29: - # https://github.com/android/ndk/issues/1196 - self.ld_flags.append('-Wl,--no-rosegment') + if self.type == Linker.LLD and target.android_api < 29: + # https://github.com/android/ndk/issues/1196 + self.ld_flags.append('-Wl,--no-rosegment') elif target.is_macos: self.ld_flags.append('-Wl,-no_deduplicate') if not self.tc.is_clang: self.ld_flags.append('-Wl,-no_compact_unwind') self.thread_library = select([ - (target.is_linux or target.is_macos, '-lpthread'), + (target.is_linux or target.is_macos, '-lpthread'), ]) - self.ld_export_dynamic_flag = None + self.ld_export_dynamic_flag = None self.start_group = None self.end_group = None self.whole_archive = None @@ -1904,7 +1904,7 @@ class LD(Linker): self.libresolv = '-lresolv' if target.is_linux or target.is_macos or target.is_android else None if target.is_linux or target.is_android: - self.ld_export_dynamic_flag = '-rdynamic' + self.ld_export_dynamic_flag = '-rdynamic' self.use_stdlib = '-nodefaultlibs' if target.is_linux or target.is_android or target.is_cygwin or target.is_none: @@ -1947,22 +1947,22 @@ class LD(Linker): if target.is_armv7 and self.type != Linker.LLD: self.sys_lib.append('-Wl,--fix-cortex-a8') - # NDK r23 onwards has stopped using libgcc: - # - https://github.com/android/ndk/wiki/Changelog-r23#changes - # - https://github.com/android/ndk/issues/1230 - # LLVM's libunwind is now used instead of libgcc for all architectures rather than just 32-bit Arm. - # - https://github.com/android/ndk/issues/1231 - # LLVM's libclang_rt.builtins is now used instead of libgcc. - if self.tc.android_ndk_version >= 23: - # Use toolchain defaults to link with libunwind/clang_rt.builtins - self.use_stdlib = '-nostdlib++' - else: - # Preserve old behaviour: specify runtime libs manually - self.use_stdlib = '-nodefaultlibs' - if target.is_armv7: - self.sys_lib.append('-lunwind') - self.sys_lib.append('-lgcc') - + # NDK r23 onwards has stopped using libgcc: + # - https://github.com/android/ndk/wiki/Changelog-r23#changes + # - https://github.com/android/ndk/issues/1230 + # LLVM's libunwind is now used instead of libgcc for all architectures rather than just 32-bit Arm. + # - https://github.com/android/ndk/issues/1231 + # LLVM's libclang_rt.builtins is now used instead of libgcc. + if self.tc.android_ndk_version >= 23: + # Use toolchain defaults to link with libunwind/clang_rt.builtins + self.use_stdlib = '-nostdlib++' + else: + # Preserve old behaviour: specify runtime libs manually + self.use_stdlib = '-nodefaultlibs' + if target.is_armv7: + self.sys_lib.append('-lunwind') + self.sys_lib.append('-lgcc') + if self.tc.is_clang and not self.tc.version_at_least(4, 0) and target.is_linux_x86_64: self.sys_lib.append('-L/usr/lib/x86_64-linux-gnu') @@ -1981,12 +1981,12 @@ class LD(Linker): emit('LD_STRIP_FLAG', self.ld_stripflag) emit('STRIP_FLAG') - emit('LD_DCE_FLAG', self.ld_dce_flag) - emit('DCE_FLAG') - - emit('LD_ICF_FLAG', self.ld_icf_flag) - emit('ICF_FLAG') - + emit('LD_DCE_FLAG', self.ld_dce_flag) + emit('DCE_FLAG') + + emit('LD_ICF_FLAG', self.ld_icf_flag) + emit('ICF_FLAG') + emit('C_LIBRARY_PATH') emit('C_SYSTEM_LIBRARIES_INTERCEPT') if self.musl.value: @@ -2011,35 +2011,35 @@ class LD(Linker): emit('DWARF_TOOL', dwarf_tool) emit('OBJADDE') - emit('LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG', self.ld_export_dynamic_flag) + emit('LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG', self.ld_export_dynamic_flag) emit_big(''' - NO_EXPORT_DYNAMIC_SYMBOLS= - EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG + NO_EXPORT_DYNAMIC_SYMBOLS= + EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG when ($EXPORTS_FILE) { - EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG -Wl,--version-script=${input:EXPORTS_FILE} - } - when ($NO_EXPORT_DYNAMIC_SYMBOLS == "yes") { - EXPORTS_VALUE= + EXPORTS_VALUE=$LD_EXPORT_ALL_DYNAMIC_SYMBOLS_FLAG -Wl,--version-script=${input:EXPORTS_FILE} + } + when ($NO_EXPORT_DYNAMIC_SYMBOLS == "yes") { + EXPORTS_VALUE= }''') emit('LINKER_SCRIPT_VALUE', '${ext=.ld;pre=-T:SRCS_GLOBAL}') - linker_time_trace_requested = is_positive('TIME_TRACE') or is_positive('LINKER_TIME_TRACE') - linker_supports_time_trace = self.type == Linker.LLD # XXX: Should really check the linker version if we had one - if linker_time_trace_requested and linker_supports_time_trace: - linker_time_trace_granularity = preset('TIME_TRACE_GRANULARITY', '500') - emit('LINKER_TIME_TRACE_FLAG', ' '.join([ - '-Wl,--time-trace', - '-Wl,--time-trace-granularity=' + linker_time_trace_granularity, - '-Wl,--time-trace-file=${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.time_trace.json:REALPRJNAME}', - ])) - else: - emit('LINKER_TIME_TRACE_FLAG') - + linker_time_trace_requested = is_positive('TIME_TRACE') or is_positive('LINKER_TIME_TRACE') + linker_supports_time_trace = self.type == Linker.LLD # XXX: Should really check the linker version if we had one + if linker_time_trace_requested and linker_supports_time_trace: + linker_time_trace_granularity = preset('TIME_TRACE_GRANULARITY', '500') + emit('LINKER_TIME_TRACE_FLAG', ' '.join([ + '-Wl,--time-trace', + '-Wl,--time-trace-granularity=' + linker_time_trace_granularity, + '-Wl,--time-trace-file=${output;rootrel;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.time_trace.json:REALPRJNAME}', + ])) + else: + emit('LINKER_TIME_TRACE_FLAG') + exe_flags = [ '$C_FLAGS_PLATFORM', '$BEFORE_PEERS', self.start_group, '${rootrel:PEERS}', self.end_group, '$AFTER_PEERS', '$EXPORTS_VALUE $LINKER_SCRIPT_VALUE $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB', - '$C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES $STRIP_FLAG $DCE_FLAG $ICF_FLAG $LINKER_TIME_TRACE_FLAG'] + '$C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES $STRIP_FLAG $DCE_FLAG $ICF_FLAG $LINKER_TIME_TRACE_FLAG'] arch_flag = '--arch={arch}'.format(arch=self.target.os_compat) soname_flag = '-Wl,{option},${{_SONAME}}'.format(option=self.soname_option) @@ -2076,7 +2076,7 @@ class LD(Linker): emit('REAL_LINK_EXE_CMDLINE', '$YMAKE_PYTHON ${input:"build/scripts/link_exe.py"}', '--source-root $ARCADIA_ROOT', - '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.linker.txt:REALPRJNAME}' if self.save_linker_output else '', + '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.linker.txt:REALPRJNAME}' if self.save_linker_output else '', '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', arch_flag, @@ -2094,7 +2094,7 @@ class LD(Linker): emit('REAL_LINK_EXEC_DYN_LIB_CMDLINE', '$YMAKE_PYTHON ${input:"build/scripts/link_dyn_lib.py"}', '--target $TARGET', - '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.linker.txt:REALPRJNAME}' if self.save_linker_output else '', + '--linker-output ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.linker.txt:REALPRJNAME}' if self.save_linker_output else '', '${pre=--whole-archive-peers :WHOLE_ARCHIVE_PEERS}', '${pre=--whole-archive-libs :_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL}', arch_flag, @@ -2141,7 +2141,7 @@ class LD(Linker): emit('LINK_DYN_LIB', "$REAL_LINK_EXE") else: emit('LINK_DYN_LIB', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND') - emit('LINK_EXEC_DYN_LIB', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_EXEC_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND') + emit('LINK_EXEC_DYN_LIB', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_LINK_EXEC_DYN_LIB && $DWARF_COMMAND && $LINK_ADDITIONAL_SECTIONS_COMMAND') emit('SWIG_DLL_JAR_CMD', '$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $REAL_SWIG_DLL_JAR_CMD && $DWARF_COMMAND') tail_link_lib = '$AUTO_INPUT ${requirements;hide:LIB_REQUIREMENTS} ${kv;hide:"p AR"} $TOOLCHAIN_ENV ${kv;hide:"pc light-red"} ${kv;hide:"show_out"}' @@ -2754,12 +2754,12 @@ class MSVCLinker(MSVC, Linker): emit('LINK_WRAPPER') emit('LINK_WRAPPER_DYNLIB', '${YMAKE_PYTHON}', '${input:"build/scripts/link_dyn_lib.py"}', '--arch', 'WINDOWS', '--target', '$TARGET') - emit_big(''' - EXPORTS_VALUE= - when ($EXPORTS_FILE) { - LINK_IMPLIB_VALUE=$LINK_IMPLIB - EXPORTS_VALUE=/DEF:${input:EXPORTS_FILE} - }''') + emit_big(''' + EXPORTS_VALUE= + when ($EXPORTS_FILE) { + LINK_IMPLIB_VALUE=$LINK_IMPLIB + EXPORTS_VALUE=/DEF:${input:EXPORTS_FILE} + }''') emit("GENERATE_MF_CMD", '$YMAKE_PYTHON ${input:"build/scripts/generate_mf.py"}', '--build-root $ARCADIA_BUILD_ROOT --module-name $REALPRJNAME -o ${output;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.mf:REALPRJNAME}', |