diff --git a/build/ark.gni b/build/ark.gni deleted file mode 100644 index a4eb1d1a9291a8279860e01afcd4cbb1ee4c3c51..0000000000000000000000000000000000000000 --- a/build/ark.gni +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/ark_var.gni") - -import("$build_root/config/sanitizers/sanitizers.gni") - -import("$build_root/toolchain/toolchain.gni") - -# import cxx base templates -import("$build_root/templates/cxx/cxx.gni") - -# import prebuilt templates -import("$build_root/templates/cxx/prebuilt.gni") diff --git a/build/ark_var.gni b/build/ark_var.gni deleted file mode 100644 index 001e4dc587af8619ea1568d54045b2013a1f0afe..0000000000000000000000000000000000000000 --- a/build/ark_var.gni +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -declare_args() { - # build version - build_public_version = true - - # system package dir - system_base_dir = "system" - - device_name = "" -} diff --git a/build/compile_script/.gn b/build/compile_script/.gn deleted file mode 100755 index fa5e690c316ac1ffb30d3c946231f08cd7f126d5..0000000000000000000000000000000000000000 --- a/build/compile_script/.gn +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The location of the build configuration file. -buildconfig = "//arkcompiler/toolchain/build/config/BUILDCONFIG.gn" - -# The source root location. -root = "//arkcompiler/toolchain/build/core/gn" - -# The executable used to execute scripts in action and exec_script. -script_executable = "/usr/bin/env" diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py deleted file mode 100755 index c3fba73276e37a7aafa0ef242488f934205e5ecd..0000000000000000000000000000000000000000 --- a/build/compile_script/ark.py +++ /dev/null @@ -1,1135 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from __future__ import print_function -from datetime import datetime -from fnmatch import fnmatch -import errno -import json -import os -import platform -import subprocess -import sys -from typing import List, Any, Tuple, Union, Optional - -CURRENT_FILENAME = os.path.basename(__file__) - - -def str_of_time_now() -> str: - return datetime.now().strftime("%Y-%m-%d-%H-%M-%S-%f")[:-3] - - -def _call(cmd: str): - print("# %s" % cmd) - return subprocess.call(cmd, shell=True) - - -def _write(filename: str, content: str, mode: str): - with open(filename, mode) as f: - f.write(content) - - -def call_with_output(cmd: str, file: str): - print("# %s" % cmd) - host = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - while True: - try: - build_data = host.stdout.readline().decode('utf-8') - sys.stdout.flush() - print(build_data) - _write(file, build_data, "a") - except OSError as error: - if error == errno.ENOENT: - print("no such file") - elif error == errno.EPERM: - print("permission denied") - break - if not build_data: - break - host.wait() - return host.returncode - - -def enable_ccache(): - try: - ccache_path = subprocess.check_output(['which', 'ccache']).strip().decode() - except subprocess.CalledProcessError: - print("Error: ccache not found.") - return - os.environ['CCACHE_EXEC'] = ccache_path - os.environ['USE_CCACHE'] = "1" - - -def backup(file: str, mode: str): - if os.path.exists(file): - with open(file, 'r+') as src_file: - src_content = src_file.read() - src_file.seek(0) - src_file.truncate() - - with open(file[:-4] + "_last.log", mode) as dst_file: - dst_file.write(src_content) - - -class ArkPy: - # constants determined by designer of this class - NAME_OF_OUT_DIR_OF_FIRST_LEVEL = "out" - DELIMITER_BETWEEN_OS_CPU_MODE_FOR_COMMAND = "." - DELIMITER_FOR_SECOND_OUT_DIR_NAME = "." - GN_TARGET_LOG_FILE_NAME = "build.log" - UNITTEST_LOG_FILE_NAME = "unittest.log" - RUNTIME_CORE_UNITTEST_LOG_FILE_NAME = "runtime_core_unittest.log" - TEST262_LOG_FILE_NAME = "test262.log" - REGRESS_TEST_LOG_FILE_NAME = "regresstest.log" - PREBUILTS_DOWNLOAD_CONFIG_FILE_PATH = \ - "./arkcompiler/toolchain/build/prebuilts_download/prebuilts_download_config.json" - INDENTATION_STRING_PER_LEVEL = " " # for help message - # In ARG_DICT, "flags" and "description" are must-keys for the leaf-dicts in it. - # (Future designer need know.) - ARG_DICT = { - "os_cpu": { - "linux_x64": { - "flags": ["linux_x64", "x64"], - "description": - "Build for arkcompiler target of target-operating-system linux and " - "target-central-processing-unit x64.", - "gn_args": ["target_os=\"linux\"", "target_cpu=\"x64\""], - "prefix_of_name_of_out_dir_of_second_level": "x64", - }, - "linux_x86": { - "flags": ["linux_x86", "x86"], - "description": - "Build for arkcompiler target of target-operating-system linux and " - "target-central-processing-unit x86.", - "gn_args": ["target_os=\"linux\"", "target_cpu=\"x86\""], - "prefix_of_name_of_out_dir_of_second_level": "x86", - }, - "ohos_arm": { - "flags": ["ohos_arm", "arm"], - "description": - "Build for arkcompiler target of target-operating-system ohos and " - "target-central-processing-unit arm.", - "gn_args": ["target_os=\"ohos\"", "target_cpu=\"arm\""], - "prefix_of_name_of_out_dir_of_second_level": "arm", - }, - "ohos_arm64": { - "flags": ["ohos_arm64", "arm64"], - "description": - "Build for arkcompiler target of target-operating-system ohos and " - "target-central-processing-unit arm64.", - "gn_args": ["target_os=\"ohos\"", "target_cpu=\"arm64\""], - "prefix_of_name_of_out_dir_of_second_level": "arm64", - }, - "android_arm64": { - "flags": ["android_arm64"], - "description": - "Build for arkcompiler target of target-operating-system android and " - "target-central-processing-unit arm64.", - "gn_args": ["target_os=\"android\"", "target_cpu=\"arm64\""], - "prefix_of_name_of_out_dir_of_second_level": "android_arm64", - }, - "mingw_x86_64": { - "flags": ["mingw_x86_64"], - "description": - "Build for arkcompiler target of target-operating-system MinGW(Minimalist GNU on Windows) and " - "target-central-processing-unit x86_64.", - "gn_args": ["target_os=\"mingw\"", "target_cpu=\"x86_64\""], - "prefix_of_name_of_out_dir_of_second_level": "mingw_x86_64", - }, - "ohos_mipsel": { - "flags": ["ohos_mipsel", "mipsel"], - "description": - "Build for arkcompiler target of target-operating-system ohos and " - "target-central-processing-unit mipsel(32-bit little-endian mips).", - "gn_args": ["target_os=\"ohos\"", "target_cpu=\"mipsel\""], - "prefix_of_name_of_out_dir_of_second_level": "mipsel", - }, - "mac_arm64": { - "flags": ["mac_arm64", "arm64"], - "description": - "Build for arkcompiler target of target-operating-system linux and " - "target-central-processing-unit arm64.", - "gn_args": ["target_os=\"mac\"", "target_cpu=\"arm64\""], - "prefix_of_name_of_out_dir_of_second_level": "mac_arm64", - }, - "mac_x86": { - "flags": ["mac_x86", "x86"], - "description": - "Build for arkcompiler target of target-operating-system mac and " - "target-central-processing-unit x86.", - "gn_args": ["target_os=\"mac\"", "target_cpu=\"x86\""], - "prefix_of_name_of_out_dir_of_second_level": "mac_x86", - }, - }, - "mode": { - "release": { - "flags": ["release", "r"], - "description": "Build for arkcompiler target(executables and libraries) for distribution.", - "gn_args": ["is_debug=false"], - "suffix_of_name_of_out_dir_of_second_level": "release", - }, - "debug": { - "flags": ["debug", "d"], - "description": "Build for arkcompiler target(executables and libraries) for debugging.", - "gn_args": ["is_debug=true"], - "suffix_of_name_of_out_dir_of_second_level": "debug", - }, - "fastverify": { - "flags": ["fastverify", "fv"], - "description": "Build for arkcompiler target(executables and libraries) for fastverify.", - "gn_args": ["is_debug=true is_fastverify=true"], - "suffix_of_name_of_out_dir_of_second_level": "fastverify", - }, - }, - "target": { - "test262": { - "flags": ["test262", "test-262", "test_262", "262test", "262-test", "262_test", "262"], - "description": "Compile arkcompiler target and run test262 with arkcompiler target.", - "gn_targets_depend_on": ["default"], - "arm64_gn_targets_depend_on": ["ark_js_packages"], - }, - "unittest": { - "flags": ["unittest", "ut"], - "description": - "Compile and run unittest of arkcompiler target. " - "Add --keep-going=N to keep running unittest when errors occured less than N. " - "Add --gn-args=\"run_with_qemu=true\" timeout=\"1200\"\ - \"disable_force_gc=true\" to command when running unittest of non-host type with qemu.", - "gn_targets_depend_on": ["unittest_packages"], - }, - "runtime_core_unittest": { - "flags": ["runtime_core_unittest"], - "description": - "Compile and run runtime_core_unittest of arkcompiler target. " - "Add --keep-going=N to keep running runtime_core_unittest when errors occured less than N. ", - "gn_targets_depend_on": ["runtime_core_unittest_packages"], - }, - "workload": { - "flags": ["workload", "work-load", "work_load"], - "description": "Compile arkcompiler target and run workload with arkcompiler target.", - "gn_targets_depend_on": ["default"], - }, - "regresstest": { - "flags": ["regresstest", "regress_test", "regress", "testregress", "test_regress"], - "description": "Compile arkcompiler target and run regresstest with arkcompiler target.", - "gn_targets_depend_on": ["default"], - }, - "gn_target": { - "flags": [""], # any other flags - "description": - "Build for arkcompiler target assigned by user. Targets include group(ets_runtime), " - "ohos_executable(ark_js_vm), ohos_shared_library(libark_jsruntime), " - "ohos_static_library(static_icuuc), ohos_source_set(libark_jsruntime_set), " - "ohos_unittest(EcmaVm_001_Test), action(EcmaVm_001_TestAction) and other target of user-defined " - "template type in \"*.gn*\" file.", - "gn_targets_depend_on": [], # not need, depend on deps of itself in "*.gn*" file - }, - }, - "option": { - "clean": { - "flags": ["--clean", "-clean"], - "description": - "Clean the root-out-dir(x64.release-->out/x64.release) execept for file args.gn. " - "Then exit.", - }, - "clean-continue": { - "flags": ["--clean-continue", "-clean-continue"], - "description": - "Clean the root-out-dir(x64.release-->out/x64.release) execept for file args.gn. " - "Then continue to build.", - }, - "gn-args": { - "flags": ["--gn-args=*", "-gn-args=*"], - "description": - "Pass args(*) to gn command. Example: python3 ark.py x64.release " - "--gn-args=\"bool_declared_in_src_gn=true string_declared_in_src_gn=\\\"abcd\\\" " - "list_declared_in_src_gn=[ \\\"element0\\\", \\\"element1\\\" ] print(list_declared_in_src_gn) " - "exec_script(\\\"script_in_src\\\", [ \\\"arg_to_script\\\" ])\" .", - }, - "keepdepfile": { - "flags": ["--keepdepfile", "-keepdepfile"], - "description": - "Keep depfile(\"*.o.d\") generated by commands(CXX, CC ...) called by ninja during compilation.", - }, - "verbose": { - "flags": ["--verbose", "-verbose"], - "description": "Print full commands(CXX, CC, LINK ...) called by ninja during compilation.", - }, - "keep-going": { - "flags": ["--keep-going=*", "-keep-going=*"], - "description": "Keep running unittest etc. until errors occured less than N times" - " (use 0 to ignore all errors).", - }, - }, - "help": { - "flags": ["help", "--help", "--h", "-help", "-h"], - "description": "Show the usage of ark.py.", - }, - } - - # variables which would change with the change of host_os or host_cpu - gn_binary_path = "" - ninja_binary_path = "" - - # variables which would change with the change of ark.py command - has_cleaned = False - enable_verbose = False - enable_keepdepfile = False - ignore_errors = 1 - - def __main__(self, arg_list: list): - enable_ccache() - # delete duplicate arg in arg_list - arg_list = list(dict.fromkeys(arg_list)) - # match [help] flag - if len(arg_list) == 0 or ( - True in [self.is_dict_flags_match_arg(self.ARG_DICT.get("help"), arg) for arg in arg_list]): - print(self.get_help_msg_of_all()) - return - # match [[os_cpu].[mode]] flag - [match_success, key_to_dict_in_os_cpu, key_to_dict_in_mode] = self.dict_in_os_cpu_mode_match_arg(arg_list[0]) - if match_success: - self.start_for_matched_os_cpu_mode(key_to_dict_in_os_cpu, key_to_dict_in_mode, arg_list[1:]) - else: - print("\033[92mThe command is not supported! Help message shows below.\033[0m\n{}".format( - self.get_help_msg_of_all())) - return - - @staticmethod - def is_dict_flags_match_arg(dict_to_match: dict, arg_to_match: str) -> bool: - for flag in dict_to_match["flags"]: - if fnmatch(arg_to_match, flag): - return True - return False - - @staticmethod - def libs_dir(is_arm, is_aot, is_pgo, out_dir, x64_out_dir) -> str: - if is_arm and is_aot and is_pgo: - return (f"--libs-dir ../../{out_dir}/arkcompiler/ets_runtime:" - f"../../{out_dir}/thirdparty/icu:" - f"../../{out_dir}/third_party/icu:" - f"../../thirdparty/zlib:" - f"../../prebuilts/clang/ohos/linux-x86_64/llvm/lib") - if is_arm and is_aot and not is_pgo: - return ("--libs-dir ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" - f":../../{x64_out_dir}/thirdparty/icu/") - if not is_arm and is_aot: - return (f"--libs-dir ../../{out_dir}/arkcompiler/ets_runtime" - f":../../{out_dir}/thirdparty/icu:" - f"../../{out_dir}/third_party/icu:" - f"../../thirdparty/zlib:" - f"../../prebuilts/clang/ohos/linux-x86_64/llvm/lib") - # not is_arm and not is_aot - return " --libs-dir ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" - - @staticmethod - def get_cmd(test_suite, test_script_name, test_script_path, gn_args, out_path, x64_out_path, aot_mode, run_pgo, - enable_litecg, args_to_cmd, timeout, ignore_list: Optional[str] = None): - cmd = [ - f"cd {test_script_path}", - f"&& python3 {test_script_name} {args_to_cmd}", - f"--timeout {timeout}", - f"--ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm", - "--ark-frontend=es2panda" - ] - is_arm = any('target_cpu="arm64"' in arg for arg in gn_args) - if is_arm: - cmd.append("--ark-arch aarch64") - cmd.append(f"--ark-arch-root=../../{out_path}/common/common/libc/") - cmd.append(f"--ark-frontend-binary=../../{x64_out_path}/arkcompiler/ets_frontend/es2abc") - cmd.append(f"--merge-abc-binary=../../{x64_out_path}/arkcompiler/ets_frontend/merge_abc") - if aot_mode: - cmd.append(f"--ark-aot-tool=../../{out_path}/arkcompiler/ets_runtime/ark_aot_compiler") - if test_suite == "regresstest": - cmd.append(f"--stub-path=../../{out_path}/gen/arkcompiler/ets_runtime/stub.an") - else: - cmd.append(f"--ark-frontend-binary=../../{out_path}/arkcompiler/ets_frontend/es2abc") - cmd.append(f"--merge-abc-binary=../../{out_path}/arkcompiler/ets_frontend/merge_abc") - if aot_mode: - cmd.append(f"--ark-aot-tool=../../{out_path}/arkcompiler/ets_runtime/ark_aot_compiler") - if test_suite == "regresstest": - cmd.append(f"--stub-path=../../{out_path}/gen/arkcompiler/ets_runtime/stub.an") - - cmd.append(ArkPy.libs_dir( - is_arm=is_arm, - is_aot=aot_mode, - is_pgo=run_pgo, - out_dir=out_path, - x64_out_dir=x64_out_path - )) - - if aot_mode: - cmd.append("--ark-aot") - mode = ["AOT"] - if run_pgo: - cmd.append("--run-pgo") - mode.append("PGO") - if enable_litecg: - cmd.append("--enable-litecg") - mode.append("LiteCG") - mode_str = " ".join(mode) - print(f"Running {test_suite} in {mode_str} Mode\n") - - if test_suite == "regresstest" and ignore_list: - cmd.append(f"--ignore-list {ignore_list}") - - if test_suite == "regresstest": - cmd.append(f"--out-dir ../../{out_path}") - - return " ".join(cmd) - - @staticmethod - def get_test262_aot_cmd(gn_args, out_path, x64_out_path, run_pgo, enable_litecg, args_to_test262_cmd, - timeout): - print("running test262 in AotMode\n") - if any('target_cpu="arm64"' in arg for arg in gn_args): - if run_pgo: - test262_cmd = f"cd arkcompiler/ets_frontend && python3 test262/run_test262.py {args_to_test262_cmd}" \ - f" --timeout {timeout}" \ - f" --libs-dir ../../{out_path}/arkcompiler/ets_runtime:../../{out_path}/thirdparty/icu:" \ - f"../../{out_path}/thirdparty/zlib:../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" \ - " --ark-arch aarch64" \ - f" --ark-arch-root=../../{out_path}/common/common/libc/" \ - f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ - f" --ark-aot-tool=../../{out_path}/arkcompiler/ets_runtime/ark_aot_compiler" \ - f" --ark-frontend-binary=../../{x64_out_path}/arkcompiler/ets_frontend/es2abc" \ - f" --merge-abc-binary=../../{x64_out_path}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-aot" \ - " --ark-frontend=es2panda" \ - " --run-pgo" - else: - test262_cmd = "cd arkcompiler/ets_frontend && python3 test262/run_test262.py {0} --timeout {3}" \ - " --libs-dir ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib:../../{2}/thirdparty/icu/" \ - " --ark-arch aarch64" \ - " --ark-arch-root=../../{1}/common/common/libc/" \ - " --ark-aot" \ - " --ark-aot-tool=../../{2}/arkcompiler/ets_runtime/ark_aot_compiler" \ - " --ark-tool=../../{1}/arkcompiler/ets_runtime/ark_js_vm" \ - " --ark-frontend-binary=../../{2}/arkcompiler/ets_frontend/es2abc" \ - " --merge-abc-binary=../../{2}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-frontend=es2panda".format(args_to_test262_cmd, out_path, x64_out_path, timeout) - else: - run_pgo_arg = " --run-pgo" if run_pgo else "" - test262_cmd = f"cd arkcompiler/ets_frontend && python3 test262/run_test262.py {args_to_test262_cmd}" \ - f" --timeout {timeout}" \ - f" --libs-dir ../../{out_path}/arkcompiler/ets_runtime:../../{out_path}/thirdparty/icu" \ - f":../../{out_path}/thirdparty/zlib:../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" \ - f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ - f" --ark-aot-tool=../../{out_path}/arkcompiler/ets_runtime/ark_aot_compiler" \ - f" --ark-frontend-binary=../../{out_path}/arkcompiler/ets_frontend/es2abc" \ - f" --merge-abc-binary=../../{out_path}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-aot" \ - " --ark-frontend=es2panda" \ - f" {run_pgo_arg}" - if enable_litecg: - test262_cmd = test262_cmd + " --enable-litecg" - return test262_cmd - - @staticmethod - def get_jit_cmd(test_suite, test_script_name, test_script_path, gn_args, out_path, x64_out_path, args_to_cmd, - timeout): - print(f"running {test_suite} in JIT mode\n") - if any('target_cpu="arm64"' in arg for arg in gn_args): - cmd = f"cd {test_script_path} && python3 {test_script_name} {args_to_cmd} --timeout {timeout}" \ - f" --libs-dir ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib:../../{out_path}/thirdparty/icu/" \ - f":../../{out_path}/thirdparty/bounds_checking_function" \ - f":../../{out_path}/arkcompiler/ets_runtime:" \ - " --ark-arch aarch64" \ - " --run-jit" \ - f" --ark-arch-root=../../{out_path}/common/common/libc/" \ - f" --ark-aot-tool=../../{x64_out_path}/arkcompiler/ets_runtime/ark_aot_compiler" \ - f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ - f" --ark-frontend-binary=../../{x64_out_path}/arkcompiler/ets_frontend/es2abc" \ - f" --merge-abc-binary=../../{x64_out_path}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-frontend=es2panda" - else: - cmd = f"cd arkcompiler/ets_frontend && python3 {test_script_name} {args_to_cmd} --timeout {timeout}" \ - f" --libs-dir ../../{out_path}/arkcompiler/ets_runtime:../../{out_path}/thirdparty/icu" \ - f":../../{out_path}/thirdparty/zlib:../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" \ - " --run-jit" \ - f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ - f" --ark-frontend-binary=../../{out_path}/arkcompiler/ets_frontend/es2abc" \ - f" --merge-abc-binary=../../{out_path}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-frontend=es2panda" - return cmd - - @staticmethod - def get_baseline_jit_cmd(test_suite, test_script_name, test_script_path, gn_args, out_path, x64_out_path, - args_to_test262_cmd, timeout): - print(f"running {test_suite} in baseline JIT mode\n") - if any('target_cpu="arm64"' in arg for arg in gn_args): - cmd = f"cd {test_script_path} && python3 {test_script_name} {args_to_test262_cmd} --timeout {timeout}" \ - f" --libs-dir ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" \ - f":../../{out_path}/thirdparty/icu" \ - f":../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" \ - f":../../{out_path}/thirdparty/bounds_checking_function" \ - f":../../{out_path}/arkcompiler/ets_runtime" \ - f":../../{out_path}/common/common/libc/lib" \ - " --ark-arch aarch64" \ - " --run-baseline-jit" \ - f" --ark-arch-root=../../{out_path}/common/common/libc/" \ - f" --ark-aot-tool=../../{x64_out_path}/arkcompiler/ets_runtime/ark_aot_compiler" \ - f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ - f" --ark-frontend-binary=../../{x64_out_path}/arkcompiler/ets_frontend/es2abc" \ - f" --merge-abc-binary=../../{x64_out_path}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-frontend=es2panda" - else: - cmd = f"cd {test_script_path} && python3 {test_script_name} {args_to_test262_cmd} --timeout {timeout}" \ - f" --libs-dir ../../{out_path}/lib.unstripped/arkcompiler/ets_runtime" \ - f":../../{out_path}/thirdparty/icu" \ - ":../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" \ - f":../../{out_path}/thirdparty/bounds_checking_function/" \ - " --run-baseline-jit" \ - f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ - f" --ark-frontend-binary=../../{out_path}/arkcompiler/ets_frontend/es2abc" \ - f" --merge-abc-binary=../../{out_path}/arkcompiler/ets_frontend/merge_abc" \ - " --ark-frontend=es2panda" - return cmd - - @staticmethod - def build_args_to_test262_cmd(arg_list): - args_to_test262_cmd = [] - - disable_force_gc_name = "--disable-force-gc" - disable_force_gc_value, arg_list = ArkPy.parse_bool_option( - arg_list, option_name=disable_force_gc_name, default_value=False - ) - if disable_force_gc_value: - args_to_test262_cmd.extend([disable_force_gc_name]) - - threads_name = "--threads" - threads_value, arg_list = ArkPy.parse_option(arg_list, option_name=threads_name, default_value=None) - if threads_value: - args_to_test262_cmd.extend([threads_name, threads_value]) - - test_list_name = "--test-list" - test_list_value, arg_list = ArkPy.parse_option(arg_list, option_name=test_list_name, default_value=None) - if test_list_value is not None: - args_to_test262_cmd.extend([test_list_name, test_list_value]) - - enable_rm = [arg for arg in arg_list if "enable-rm" in arg] - if enable_rm: - args_to_test262_cmd.append("--enable-rm") - arg_list.remove(enable_rm[0]) - - skip_list_name = "--skip-list" - skip_list_value, arg_list = ArkPy.parse_option(arg_list, option_name=skip_list_name, default_value=None) - if skip_list_value is not None: - args_to_test262_cmd.extend([skip_list_name, skip_list_value]) - - if len(arg_list) == 0: - args_to_test262_cmd.append("--es2021 all") - elif len(arg_list) == 1: - arg = arg_list[0] - if arg == "sendable": - args_to_test262_cmd.append("--sendable sendable") - elif ".js" in arg: - args_to_test262_cmd.append("--file test262/data/test_es2021/{}".format(arg)) - elif "--abc2program" in arg: - args_to_test262_cmd.append("--abc2program --es2021 all") - else: - args_to_test262_cmd.append("--dir test262/data/test_es2021/{}".format(arg)) - else: - print("\033[92m\"test262\" not support multiple additional arguments.\033[0m\n".format()) - sys.exit(0) - - return " ".join(args_to_test262_cmd) - - @staticmethod - def build_args_to_regress_cmd(arg_list): - args_to_regress_cmd = [] - - disable_force_gc_name = "--disable-force-gc" - disable_force_gc_value, arg_list = ArkPy.parse_bool_option( - arg_list, option_name=disable_force_gc_name, default_value=False - ) - if disable_force_gc_value: - args_to_regress_cmd.extend([disable_force_gc_name]) - - processes_name = "--processes" - processes_value, arg_list = ArkPy.parse_option(arg_list, option_name=processes_name, default_value=1) - args_to_regress_cmd.extend([processes_name, processes_value]) - - test_list_name = "--test-list" - test_list_value, arg_list = ArkPy.parse_option(arg_list, option_name=test_list_name, default_value=None) - if test_list_value is not None: - args_to_regress_cmd.extend([test_list_name, test_list_value]) - compiler_opt_track_field_name = "--compiler-opt-track-field" - compiler_opt_track_field_value, arg_list = ArkPy.parse_bool_option( - arg_list, option_name=compiler_opt_track_field_name, default_value=False - ) - if compiler_opt_track_field_value: - args_to_regress_cmd.append(f"{compiler_opt_track_field_name}={compiler_opt_track_field_value}") - if len(arg_list) == 1: - arg = arg_list[0] - if ".js" in arg: - args_to_regress_cmd.append(f"--test-file {arg}") - else: - args_to_regress_cmd.append(f"--test-dir {arg}") - elif len(arg_list) > 1: - print("\033[92m\"regresstest\" not support multiple additional arguments.\033[0m\n".format()) - sys.exit(0) - - return " ".join([str(arg) for arg in args_to_regress_cmd]) - - @staticmethod - def parse_option(arg_list: List[str], option_name: str, default_value: Optional[Union[str, int]]) \ - -> Tuple[Optional[Union[str, int]], List[str]]: - option_value, arg_list = ArkPy.__parse_option_with_space(arg_list, option_name) - if option_value is None: - option_value, arg_list = ArkPy.__parse_option_with_equal(arg_list, option_name) - if option_value is None and default_value is not None: - option_value = default_value - return option_value, arg_list - - @staticmethod - def parse_bool_option(arg_list: List[str], option_name: str, default_value: bool) \ - -> Tuple[bool, List[str]]: - if option_name in arg_list: - option_index = arg_list.index(option_name) - option_value = not default_value - arg_list = arg_list[:option_index] + arg_list[option_index + 1:] - else: - option_value = default_value - - return option_value, arg_list - - @staticmethod - def __is_option_value_int(value: Optional[Union[str, int]]) -> Tuple[bool, Optional[int]]: - if isinstance(value, int): - return True, int(value) - else: - return False, None - - @staticmethod - def __is_option_value_str(value: Optional[Union[str, int]]) -> Tuple[bool, Optional[str]]: - if isinstance(value, str): - return True, str(value) - else: - return False, None - - @staticmethod - def __get_option_value(option_name: str, value: Optional[Union[str, int]]) -> Union[str, int]: - result, res_value = ArkPy.__is_option_value_int(value) - if result: - return res_value - result, res_value = ArkPy.__is_option_value_str(value) - if result: - return res_value - print(f"Invalid '{option_name}' value.") - sys.exit(1) - - @staticmethod - def __parse_option_with_space(arg_list: List[str], option_name: str) \ - -> Tuple[Optional[Union[str, int]], List[str]]: - if option_name in arg_list: - option_index = arg_list.index(option_name) - if len(arg_list) > option_index + 1: - option_value = ArkPy.__get_option_value(option_name, arg_list[option_index + 1]) - arg_list = arg_list[:option_index] + arg_list[option_index + 2:] - else: - print(f"Missing {option_name} value.") - sys.exit(1) - - return option_value, arg_list - return None, arg_list - - @staticmethod - def __parse_option_with_equal(arg_list: List[str], option_name: str) \ - -> Tuple[Optional[Union[str, int]], List[str]]: - for index, arg in enumerate(arg_list): - local_option_name = f"{option_name}=" - if arg.startswith(local_option_name): - option_value = arg[len(local_option_name):] - if option_value: - option_value = ArkPy.__get_option_value(option_name, option_value) - arg_list = arg_list[:index] + arg_list[index + 1:] - return option_value, arg_list - else: - print(f"Missing {option_name} value.") - sys.exit(1) - return None, arg_list - - @staticmethod - def __get_x64_out_path(out_path) -> str: - if 'release' in out_path: - return 'out/x64.release' - if 'debug' in out_path: - return 'out/x64.debug' - if 'fastverify' in out_path: - return 'out/x64.fastverify' - return "" - - def get_binaries(self): - host_os = sys.platform - host_cpu = platform.machine() - try: - with open(self.PREBUILTS_DOWNLOAD_CONFIG_FILE_PATH) as file_prebuilts_download_config: - prebuilts_download_config_dict = json.load(file_prebuilts_download_config) - file_prebuilts_download_config.close() - for element in prebuilts_download_config_dict[host_os][host_cpu]["copy_config"]: - if element["unzip_filename"] == "gn": - self.gn_binary_path = os.path.join(element["unzip_dir"], element["unzip_filename"]) - elif element["unzip_filename"] == "ninja": - self.ninja_binary_path = os.path.join(element["unzip_dir"], element["unzip_filename"]) - except Exception as error: - print("\nLogic of getting gn binary or ninja binary does not match logic of prebuilts_download." \ - "\nCheck func \033[92m{0} of class {1} in file {2}\033[0m against file {3} if the name of this " \ - "file had not changed!\n".format( - sys._getframe().f_code.co_name, self.__class__.__name__, CURRENT_FILENAME, - self.PREBUILTS_DOWNLOAD_CONFIG_FILE_PATH)) - raise error - if self.gn_binary_path == "" or self.ninja_binary_path == "": - print("\nLogic of prebuilts_download may be wrong." \ - "\nCheck \033[92mdata in file {0}\033[0m against func {1} of class {2} in file {3}!\n".format( - self.PREBUILTS_DOWNLOAD_CONFIG_FILE_PATH, sys._getframe().f_code.co_name, self.__class__.__name__, - CURRENT_FILENAME)) - sys.exit(0) - if not os.path.isfile(self.gn_binary_path) or not os.path.isfile(self.ninja_binary_path): - print("\nStep for prebuilts_download may be ommited. (\033[92m./prebuilts_download.sh\033[0m)" \ - "\nCheck \033[92mwhether gn binary and ninja binary are under directory prebuilts\033[0m!\n".format()) - sys.exit(0) - return - - def which_dict_flags_match_arg(self, dict_including_dicts_to_match: dict, arg_to_match: str) -> str: - for key in dict_including_dicts_to_match.keys(): - if self.is_dict_flags_match_arg(dict_including_dicts_to_match[key], arg_to_match): - return key - return "" - - def dict_in_os_cpu_mode_match_arg(self, arg: str) -> [bool, str, str]: - os_cpu_part = "" - mode_part = "" - match_success = True - key_to_dict_in_os_cpu_matched_arg = "" - key_to_dict_in_mode_matched_arg = "" - arg_to_list = arg.split(self.DELIMITER_BETWEEN_OS_CPU_MODE_FOR_COMMAND) - if len(arg_to_list) == 1: - os_cpu_part = arg_to_list[0] - mode_part = "release" - key_to_dict_in_os_cpu_matched_arg = self.which_dict_flags_match_arg(self.ARG_DICT.get("os_cpu"), os_cpu_part) - key_to_dict_in_mode_matched_arg = self.which_dict_flags_match_arg(self.ARG_DICT.get("mode"), mode_part) - elif len(arg_to_list) == 2: - os_cpu_part = arg_to_list[0] - mode_part = arg_to_list[1] - key_to_dict_in_os_cpu_matched_arg = self.which_dict_flags_match_arg(self.ARG_DICT.get("os_cpu"), os_cpu_part) - key_to_dict_in_mode_matched_arg = self.which_dict_flags_match_arg(self.ARG_DICT.get("mode"), mode_part) - else: - print("\"\033[92m{0}\033[0m\" combined with more than 2 flags is not supported.".format(arg)) - if (key_to_dict_in_os_cpu_matched_arg == "") | (key_to_dict_in_mode_matched_arg == ""): - match_success = False - return [match_success, key_to_dict_in_os_cpu_matched_arg, key_to_dict_in_mode_matched_arg] - - def get_help_msg_of_dict(self, dict_in: dict, indentation_str_current: str, indentation_str_per_level: str) -> str: - help_msg = "".format() - for key in dict_in.keys(): - if isinstance(dict_in[key], dict): - help_msg += "{0}{1}:\n".format(indentation_str_current, key) - help_msg += self.get_help_msg_of_dict( - dict_in[key], indentation_str_current + indentation_str_per_level, indentation_str_per_level) - elif key == "flags": - help_msg += "{0}{1}: \033[92m{2}\033[0m\n".format(indentation_str_current, key, " ".join(dict_in[key])) - elif key == "description": - help_msg += "{0}{1}: {2}\n".format(indentation_str_current, key, dict_in[key]) - return help_msg - - def get_help_msg_of_all(self) -> str: - help_msg = "".format() - # Command template - help_msg += "\033[32mCommand template:\033[0m\n{}\n\n".format( - " python3 ark.py \033[92m[os_cpu].[mode] [gn_target] [option]\033[0m\n" - " python3 ark.py \033[92m[os_cpu].[mode] [test262] [none or --aot] " \ - "[none or --pgo] [none or --litecg] [none, file or dir] [none or --threads=X] [option]\033[0m\n" - " python3 ark.py \033[92m[os_cpu].[mode] [test262] [none or --jit] [none or --threads=X]\033[0m\n" - " python3 ark.py \033[92m[os_cpu].[mode] [test262] [none or --baseline-jit] [none or --enable-rm] " \ - "[none or --threads=X and/or --test-list TEST_LIST_NAME]\033[0m\n" - " python3 ark.py \033[92m[os_cpu].[mode] [unittest] [option]\033[0m\n" - " python3 ark.py \033[92m[os_cpu].[mode] [runtime_core_unittest] [option]\033[0m\n" - " python3 ark.py \033[92m[os_cpu].[mode] [regresstest] [none, file or dir] " \ - "[none or --processes X and/or --test-list TEST_LIST_NAME]\033[0m\n") - # Command examples - help_msg += "\033[32mCommand examples:\033[0m\n{}\n\n".format( - " python3 ark.py \033[92mx64.release\033[0m\n" - " python3 ark.py \033[92mx64.release ets_runtime\033[0m\n" - " python3 ark.py \033[92mx64.release ark_js_vm es2panda\033[0m\n" - " python3 ark.py \033[92mx64.release ark_js_vm es2panda --clean\033[0m\n" - " python3 ark.py \033[92mx64.release test262\033[0m\n" - " python3 ark.py \033[92mx64.release test262 --threads=16\033[0m\n" - " python3 ark.py \033[92mx64.release test262 --aot --pgo --litecg\033[0m\n" - " python3 ark.py \033[92mx64.release test262 --aot --pgo --litecg --threads=8\033[0m\n" - " python3 ark.py \033[92mx64.release test262 --jit --enable-rm\033[0m\n" - " python3 ark.py \033[92mx64.release test262 --baseline-jit\033[0m\n" - " python3 ark.py \033[92mx64.release test262 built-ins/Array\033[0m\n" - " python3 ark.py \033[92mx64.release test262 built-ins/Array/name.js\033[0m\n" - " python3 ark.py \033[92mx64.release unittest\033[0m\n" - " python3 ark.py \033[92mx64.release runtime_core_unittest\033[0m\n" - " python3 ark.py \033[92mx64.release regresstest\033[0m\n" - " python3 ark.py \033[92mx64.release regresstest --processes=4\033[0m\n" - " python3 ark.py \033[92mx64.release workload\033[0m\n" - " python3 ark.py \033[92mx64.release workload report\033[0m\n" - " python3 ark.py \033[92mx64.release workload report dev\033[0m\n" - " python3 ark.py \033[92mx64.release workload report dev -20\033[0m\n" - " python3 ark.py \033[92mx64.release workload report dev -20 10\033[0m\n" - " python3 ark.py \033[92mx64.release workload report dev -20 10 weekly_workload\033[0m\n") - # Arguments - help_msg += "\033[32mArguments:\033[0m\n{}".format( - self.get_help_msg_of_dict( - self.ARG_DICT, self.INDENTATION_STRING_PER_LEVEL, self.INDENTATION_STRING_PER_LEVEL)) - return help_msg - - def clean(self, out_path: str): - if not os.path.exists(out_path): - print("Path \"{}\" does not exist! No need to clean it.".format(out_path)) - else: - print("=== clean start ===") - code = _call("{0} clean {1}".format(self.gn_binary_path, out_path)) - if code != 0: - print("=== clean failed! ===\n") - sys.exit(code) - print("=== clean success! ===\n") - return - - def build_for_gn_target(self, out_path: str, gn_args: list, arg_list: list, log_file_name: str): - # prepare log file - build_log_path = os.path.join(out_path, log_file_name) - backup(build_log_path, "w") - if arg_list is not None: - build_target = " ".join([str(arg).strip() for arg in arg_list - if arg is not None or len(str(arg).strip()) > 0]) - else: - build_target = "" - str_to_build_log = "================================\nbuild_time: {0}\nbuild_target: {1}\n\n".format( - str_of_time_now(), build_target) - _write(build_log_path, str_to_build_log, "a") - # gn command - print("=== gn gen start ===") - code = call_with_output( - "{0} gen {1} --args=\"{2}\" --export-compile-commands".format( - self.gn_binary_path, out_path, " ".join(gn_args).replace("\"", "\\\"")), - build_log_path) - if code != 0: - print("=== gn gen failed! ===\n") - sys.exit(code) - else: - print("=== gn gen success! ===\n") - # ninja command - # Always add " -d keeprsp" to ninja command to keep response file("*.rsp"), thus we could get shared libraries - # of an excutable from its response file. - ninja_cmd = \ - self.ninja_binary_path + \ - (" -v" if self.enable_verbose else "") + \ - (" -d keepdepfile" if self.enable_keepdepfile else "") + \ - " -d keeprsp" + \ - " -C {}".format(out_path) + \ - " {}".format(" ".join(arg_list if arg_list else [])) + \ - " -k {}".format(self.ignore_errors) - print(ninja_cmd) - code = call_with_output(ninja_cmd, build_log_path) - if code != 0: - print("=== ninja failed! ===\n") - sys.exit(code) - else: - print("=== ninja success! ===\n") - return - - def call_build_gn_target(self, gn_args, out_path, x64_out_path, test_suite, log_file_name): - if any('target_cpu="arm64"' in arg for arg in gn_args): - gn_args.append("so_dir_for_qemu=\"../../{0}/common/common/libc/\"".format(out_path)) - gn_args.append("run_with_qemu=true".format(out_path)) - if not os.path.exists(x64_out_path): - os.makedirs(x64_out_path) - self.build_for_gn_target( - x64_out_path, - ['target_os="linux"', 'target_cpu="x64"', 'is_debug=false'], - self.ARG_DICT.get("target").get(test_suite).get("gn_targets_depend_on"), - log_file_name) - self.build_for_gn_target( - out_path, - gn_args, - self.ARG_DICT.get("target").get(test_suite).get("arm64_gn_targets_depend_on"), - log_file_name) - else: - self.build_for_gn_target( - out_path, - gn_args, - self.ARG_DICT.get("target").get(test_suite).get("gn_targets_depend_on"), - log_file_name) - - def get_build_cmd(self, *, test_suite, test_script_name, test_script_path, - out_path, x64_out_path, gn_args: list, args_to_cmd: str, timeout, - run_jit: bool = False, run_baseline_jit: bool = False, aot_mode: bool = False, - run_pgo: bool = False, enable_litecg: bool = False, ignore_list: Optional[str] = None) -> str: - if run_jit: - cmd = self.get_jit_cmd(test_suite, test_script_name, test_script_path, - gn_args, out_path, x64_out_path, args_to_cmd, timeout) - elif run_baseline_jit: - cmd = self.get_baseline_jit_cmd(test_suite, test_script_name, test_script_path, - gn_args, out_path, x64_out_path, args_to_cmd, timeout) - elif aot_mode and test_suite == "test262": - cmd = self.get_test262_aot_cmd(gn_args, out_path, x64_out_path, run_pgo, - enable_litecg, args_to_cmd, timeout) - else: - cmd = self.get_cmd(test_suite, test_script_name, test_script_path, - gn_args, out_path, x64_out_path, aot_mode, run_pgo, - enable_litecg, args_to_cmd, timeout, ignore_list) - return cmd - - def build_for_suite(self, *, test_suite, test_script_name, test_script_path, - out_path, gn_args: list, log_file_name, args_to_cmd: str, timeout, - run_jit: bool = False, run_baseline_jit: bool = False, aot_mode: bool = False, - run_pgo: bool = False, enable_litecg: bool = False, ignore_list: Optional[str] = None, - skip_compiler: bool = False): - x64_out_path = self.__get_x64_out_path(out_path) - if not skip_compiler: - self.call_build_gn_target(gn_args, out_path, x64_out_path, test_suite, log_file_name) - cmd = self.get_build_cmd( - test_suite=test_suite, - test_script_name=test_script_name, - test_script_path=test_script_path, - out_path=out_path, - x64_out_path=x64_out_path, - gn_args=gn_args, - args_to_cmd=args_to_cmd, - timeout=timeout, - run_jit=run_jit, - run_baseline_jit=run_baseline_jit, - aot_mode=aot_mode, run_pgo=run_pgo, enable_litecg=enable_litecg, ignore_list=ignore_list) - log_path = str(os.path.join(out_path, log_file_name)) - str_to_log = "================================\n{2}_time: {0}\n{2}_target: {1}\n\n".format( - str_of_time_now(), args_to_cmd, test_suite) - _write(log_path, str_to_log, "a") - print(f"=== {test_suite} start ===") - code = call_with_output(cmd, log_path) - if code != 0: - print(f"=== {test_suite} fail! ===\n") - sys.exit(code) - print(f"=== {test_suite} success! ===\n") - - def build_for_test262(self, out_path, gn_args: list, arg_list: list): - timeout, arg_list = self.parse_timeout(arg_list) - arg_list = arg_list[1:] - - is_aot_mode, arg_list = self.__purge_arg_list("--aot", arg_list) - is_pgo, arg_list = self.__purge_arg_list("--pgo", arg_list) - is_litecg, arg_list = self.__purge_arg_list("--litecg", arg_list) - is_jit, arg_list = self.__purge_arg_list("--jit", arg_list) - is_baseline_jit, arg_list = self.__purge_arg_list("--baseline-jit", arg_list) - is_skip_compiler, arg_list = self.__purge_arg_list("--skip-compiler", arg_list) - print(f"Test262: arg_list = {arg_list}") - - args_to_test262_cmd = self.build_args_to_test262_cmd(arg_list) - self.build_for_suite( - test_suite="test262", - test_script_name="test262/run_test262.py", - test_script_path="arkcompiler/ets_frontend", - out_path=out_path, - gn_args=gn_args, - log_file_name=self.TEST262_LOG_FILE_NAME, - args_to_cmd=args_to_test262_cmd, - timeout=timeout, - run_jit=is_jit, - run_pgo=is_pgo, - run_baseline_jit=is_baseline_jit, - aot_mode=is_aot_mode, - enable_litecg=is_litecg, - skip_compiler=is_skip_compiler - ) - - def build_for_unittest(self, out_path: str, gn_args: list, log_file_name: str): - self.build_for_gn_target( - out_path, gn_args, self.ARG_DICT.get("target").get("unittest").get("gn_targets_depend_on"), - log_file_name) - return - - def build_for_runtime_core_unittest(self, out_path: str, gn_args: list, log_file_name: str): - runtime_core_ut_depend = self.ARG_DICT.get("target").get("runtime_core_unittest").get("gn_targets_depend_on") - self.build_for_gn_target(out_path, gn_args, runtime_core_ut_depend, log_file_name) - return - - def build_for_regress_test(self, out_path, gn_args: list, arg_list: list): - timeout, arg_list = self.parse_option(arg_list, option_name="--timeout", default_value=200) - ignore_list, arg_list = self.parse_option(arg_list, option_name="--ignore-list", default_value=None) - - arg_list = arg_list[1:] - - is_aot, arg_list = self.__purge_arg_list("--aot", arg_list) - is_pgo, arg_list = self.__purge_arg_list("--pgo", arg_list) - is_litecg, arg_list = self.__purge_arg_list("--litecg", arg_list) - is_jit, arg_list = self.__purge_arg_list("--jit", arg_list) - is_baseline_jit, arg_list = self.__purge_arg_list("--baseline-jit", arg_list) - is_skip_compiler, arg_list = self.__purge_arg_list("--skip-compiler", arg_list) - print(f"Regress: arg_list = {arg_list}") - - args_to_regress_test_cmd = self.build_args_to_regress_cmd(arg_list) - self.build_for_suite( - test_suite="regresstest", - test_script_name="test/regresstest/run_regress_test.py", - test_script_path="arkcompiler/ets_runtime", - out_path=out_path, - gn_args=gn_args, - log_file_name=self.REGRESS_TEST_LOG_FILE_NAME, - args_to_cmd=args_to_regress_test_cmd, - timeout=timeout, - run_jit=is_jit, - run_pgo=is_pgo, - run_baseline_jit=is_baseline_jit, - aot_mode=is_aot, - enable_litecg=is_litecg, - ignore_list=ignore_list, - skip_compiler=is_skip_compiler - ) - - def build(self, out_path: str, gn_args: list, arg_list: list): - if not os.path.exists(out_path): - print("# mkdir -p {}".format(out_path)) - os.makedirs(out_path) - if len(arg_list) == 0: - self.build_for_gn_target(out_path, gn_args, ["default"], self.GN_TARGET_LOG_FILE_NAME) - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("workload"), arg_list[0]): - self.build_for_workload(arg_list, out_path, gn_args, 'workload.log') - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("test262"), arg_list[0]): - self.build_for_test262(out_path, gn_args, arg_list) - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("unittest"), arg_list[0]): - if len(arg_list) > 1: - print("\033[92m\"unittest\" not support additional arguments.\033[0m\n".format()) - sys.exit(0) - self.build_for_unittest(out_path, gn_args, self.UNITTEST_LOG_FILE_NAME) - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("runtime_core_unittest"), arg_list[0]): - if len(arg_list) > 1: - print("\033[92m\"runtime_core_unittest\" not support additional arguments.\033[0m\n".format()) - sys.exit(0) - self.build_for_runtime_core_unittest(out_path, gn_args, self.RUNTIME_CORE_UNITTEST_LOG_FILE_NAME) - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("regresstest"), arg_list[0]): - self.build_for_regress_test(out_path, gn_args, arg_list) - else: - self.build_for_gn_target(out_path, gn_args, arg_list, self.GN_TARGET_LOG_FILE_NAME) - return - - def parse_timeout(self, arg_list) -> Tuple[Optional[Union[str, int]], List[str]]: - return self.parse_option(arg_list, option_name="--timeout", default_value=400000) - - def match_options(self, arg_list: list, out_path: str) -> [list, list]: - arg_list_ret = [] - gn_args_ret = [] - for arg in arg_list: - # match [option][clean] flag - if self.is_dict_flags_match_arg(self.ARG_DICT.get("option").get("clean"), arg): - self.clean(out_path) - sys.exit(0) - # match [option][clean-continue] flag - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("option").get("clean-continue"), arg): - if not self.has_cleaned: - self.clean(out_path) - self.has_cleaned = True - # match [option][gn-args] flag - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("option").get("gn-args"), arg): - gn_args_ret.append(arg[(arg.find("=") + 1):]) - # match [option][keepdepfile] flag - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("option").get("keepdepfile"), arg): - if not self.enable_keepdepfile: - self.enable_keepdepfile = True - # match [option][verbose] flag - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("option").get("verbose"), arg): - if not self.enable_verbose: - self.enable_verbose = True - # match [option][keep-going] flag - elif self.is_dict_flags_match_arg(self.ARG_DICT.get("option").get("keep-going"), arg): - if self.ignore_errors == 1: - input_value = arg[(arg.find("=") + 1):] - try: - self.ignore_errors = int(input_value) - except Exception as _: - print("\033[92mIllegal value \"{}\" for \"--keep-going\" argument.\033[0m\n".format( - input_value - )) - sys.exit(0) - # make a new list with flag that do not match any flag in [option] - else: - arg_list_ret.append(arg) - return [arg_list_ret, gn_args_ret] - - def build_for_workload(self, arg_list, out_path, gn_args, log_file_name): - root_dir = os.path.dirname(os.path.abspath(__file__)) - report = False - tools = 'dev' - boundary_value = '-10' - run_count = '10' - code_v = '' - run_interpreter = False - if len(arg_list) >= 2 and arg_list[1] == 'report': - report = True - if len(arg_list) >= 3 and arg_list[2]: - tools = arg_list[2] - if len(arg_list) >= 4 and arg_list[3]: - boundary_value = arg_list[3] - if len(arg_list) >= 5 and arg_list[4]: - run_count = arg_list[4] - if len(arg_list) >= 6 and arg_list[5]: - code_v = arg_list[5] - if len(arg_list) >= 7 and arg_list[6] == '--run-interpreter': - run_interpreter = True - self.build_for_gn_target(out_path, gn_args, ["default"], self.GN_TARGET_LOG_FILE_NAME) - workload_cmd = "cd arkcompiler/ets_runtime/test/workloadtest/ && python3 work_load.py" \ - " --code-path {0}" \ - " --report {1}" \ - " --tools-type {2}" \ - " --boundary-value {3}" \ - " --run-count {4}" \ - " --code-v {5}" \ - .format(root_dir, report, tools, boundary_value, run_count, code_v) - if run_interpreter: - workload_cmd += " --run-interpreter true" - workload_log_path = os.path.join(out_path, log_file_name) - str_to_workload_log = "================================\nwokload_time: {0}\nwokload_target: {1}\n\n".format( - str_of_time_now(), 'file') - _write(workload_log_path, str_to_workload_log, "a") - print("=== workload start ===") - code = call_with_output(workload_cmd, workload_log_path) - if code != 0: - print("=== workload fail! ===\n") - sys.exit(code) - print("=== workload success! ===\n") - return - - def start_for_matched_os_cpu_mode(self, os_cpu_key: str, mode_key: str, arg_list: list): - # get binary gn and ninja - self.get_binaries() - # get out_path - name_of_out_dir_of_second_level = \ - self.ARG_DICT.get("os_cpu").get(os_cpu_key).get("prefix_of_name_of_out_dir_of_second_level") + \ - self.DELIMITER_FOR_SECOND_OUT_DIR_NAME + \ - self.ARG_DICT.get("mode").get(mode_key).get("suffix_of_name_of_out_dir_of_second_level") - out_path = os.path.join(self.NAME_OF_OUT_DIR_OF_FIRST_LEVEL, name_of_out_dir_of_second_level) - # match [option] flag - [arg_list, gn_args] = self.match_options(arg_list, out_path) - # get expression which would be written to args.gn file - gn_args.extend(self.ARG_DICT.get("os_cpu").get(os_cpu_key).get("gn_args")) - gn_args.extend(self.ARG_DICT.get("mode").get(mode_key).get("gn_args")) - # start to build - self.build(out_path, gn_args, arg_list) - return - - def __purge_arg_list(self, option_name: str, arg_list: List[Any]) -> Tuple[bool, List[Any]]: - if option_name in arg_list: - arg_list.remove(option_name) - return True, arg_list - return False, arg_list - - -if __name__ == "__main__": - ark_py = ArkPy() - ark_py.__main__(sys.argv[1:]) diff --git a/build/compile_script/helloworld.ts b/build/compile_script/helloworld.ts deleted file mode 100644 index 97f31ff31827cef0fc628811542f3713b3845e01..0000000000000000000000000000000000000000 --- a/build/compile_script/helloworld.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -declare function print(arg:string):string; -print('Hello world!'); - diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn deleted file mode 100644 index 1323361d8ae47e822b9471db9261c7be6c8e58c5..0000000000000000000000000000000000000000 --- a/build/config/BUILD.gn +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -config("executable_config") { - configs = [] - - if (!is_mac) { - if (!is_mingw) { - cflags = [ "-fPIE" ] - asmflags = [ "-fPIE" ] - ldflags = [ - "-Wl,-rpath=\$ORIGIN/", - "-Wl,-rpath-link=", - ] - if (current_os == "linux") { - ldflags += [ "-lpthread" ] - } - } - if (is_ohos) { - ldflags += [ "-lpthread" ] - configs += [ "$build_root/config/ohos:executable_config" ] - } else if (is_android) { - configs += [ "$build_root/config/aosp:executable_config" ] - } - } else if (is_mac) { - configs += [ "$build_root/config/mac:mac_dynamic_flags" ] - } -} - -# This config defines the configs applied to all shared libraries. -config("shared_library_config") { - configs = [] - - if (is_mac) { - configs += [ "$build_root/config/mac:mac_dynamic_flags" ] - } -} - -config("default_libs") { - if (is_win) { - libs = [ - "advapi32.lib", - "comdlg32.lib", - "dbghelp.lib", - "dnsapi.lib", - "gdi32.lib", - "msimg32.lib", - "odbc32.lib", - "odbccp32.lib", - "oleaut32.lib", - "psapi.lib", - "shell32.lib", - "shlwapi.lib", - "user32.lib", - "usp10.lib", - "uuid.lib", - "version.lib", - "wininet.lib", - "winmm.lib", - "winspool.lib", - "ws2_32.lib", - - # Please don't add more stuff here. We should actually be making this - # list smaller, since all common things should be covered. If you need - # some extra libraries, please just add a libs = [ "foo.lib" ] to your - # target that needs it. - ] - if (current_os == "winuwp") { - # These libraries are needed for Windows UWP (i.e. store apps). - libs += [ - "dloadhelper.lib", - "WindowsApp.lib", - ] - } else { - # These libraries are not compatible with Windows UWP (i.e. store apps.) - libs += [ - "delayimp.lib", - "kernel32.lib", - "ole32.lib", - ] - } - } else if (is_ohos || is_android) { - libs = [ - "dl", - "m", - ] - } else if (is_mac) { - # Targets should choose to explicitly link frameworks they require. Since - # linking can have run-time side effects, nothing should be listed here. - libs = [] - } else if (is_linux) { - libs = [ - "dl", - "pthread", - "rt", - ] - } -} - -group("common_deps") { - public_deps = [] - if (use_musl && is_ohos) { - public_deps += [ "$build_root/third_party_gn/musl:soft_shared_libs" ] - } -} - -group("executable_deps") { - public_deps = [ ":common_deps" ] -} - -group("shared_library_deps") { - public_deps = [ ":common_deps" ] -} - -group("static_library_deps") { - public_deps = [ ":common_deps" ] -} - -group("source_set_deps") { - public_deps = [ ":common_deps" ] -} diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn deleted file mode 100644 index 6f9d1fbf83b1b05c217d61cb5bc14e7254e82976..0000000000000000000000000000000000000000 --- a/build/config/BUILDCONFIG.gn +++ /dev/null @@ -1,255 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -declare_args() { - ark_standalone_build = true - use_musl = true - build_root = "//arkcompiler/toolchain/build" - run_with_qemu = false - so_dir_for_qemu = "common/common/libc" - enable_lto_O0 = false - disable_force_gc = false - timeout = 1200 -} - -check_mac_system_and_cpu_script = - rebase_path("$build_root/scripts/check_mac_system_and_cpu.py") -check_darwin_system_result = - exec_script(check_mac_system_and_cpu_script, [ "system" ], "string") - -if (check_darwin_system_result != "") { - check_mac_host_cpu_result = - exec_script(check_mac_system_and_cpu_script, [ "cpu" ], "string") - if (check_mac_host_cpu_result != "") { - host_cpu = "arm64" - } -} - -if (host_os == "linux") { - if (host_cpu == "arm64") { - host_platform_dir = "linux-aarch64" - } else { - host_platform_dir = "linux-x86_64" - } -} else if (host_os == "mac") { - if (host_cpu == "arm64") { - host_platform_dir = "darwin-arm64" - } else { - host_platform_dir = "darwin-x86_64" - } -} else { - assert(false, "Unsupported host_os: $host_os") -} - -declare_args() { - # Debug build. Enabling official builds automatically sets is_debug to false. - is_debug = false - is_standard_system = false -} - -declare_args() { - # Enable mini debug info, it will add .gnu_debugdata - # section in each stripped sofile - - # Currently, we don't publish ohos-adapted python on m1 platform, - # So that we disable mini debug info on m1 platform until - # ohos-adapted python publishing on m1 platform - if (host_os == "mac") { - full_mini_debug = false - } else { - full_mini_debug = true - } -} - -declare_args() { - host_toolchain = "" - custom_toolchain = "" - target_toolchain = "" - - is_clang = current_os != "linux" || - (current_cpu != "s390x" && current_cpu != "s390" && - current_cpu != "ppc64" && current_cpu != "ppc" && - current_cpu != "mips" && current_cpu != "mips64") - - target_platform = "phone" - - is_official_build = false - - is_component_build = false - - # build for cross platform - is_arkui_x = false -} - -is_wearable_product = "${target_platform}" == "wearable" - -is_emulator = false - -if (target_os == "ohos" && target_cpu == "x86_64") { - is_emulator = true -} - -# Determine host_toolchain. (like a constant in a build on a certain host) -if (host_toolchain == "") { - if (host_os == "linux") { - if (target_os != "linux") { - host_toolchain = "$build_root/toolchain/linux:clang_$host_cpu" - } else if (is_clang) { - host_toolchain = "$build_root/toolchain/linux:clang_$host_cpu" - } else { - host_toolchain = "$build_root/toolchain/linux:$host_cpu" - } - } else if (host_os == "mac") { - host_toolchain = "$build_root/toolchain/mac:clang_$host_cpu" - } else { - assert(false, "Unsupported host_os: $host_os") - } -} - -# Determine default_toolchain. -# (like a constant in a build for a certain target on a certain host) -_default_toolchain = host_toolchain -if (target_os == "ohos") { - _default_toolchain = "$build_root/toolchain/ark:ark_clang_${target_cpu}" -} else if (target_os == "linux" && target_cpu == "x64") { - _default_toolchain = "$build_root/toolchain/linux:clang_x64" -} else if (target_os == "linux" && target_cpu == "x86") { - _default_toolchain = "$build_root/toolchain/linux:clang_x86" -} else if (target_os == "mingw" && target_cpu == "x86_64") { - _default_toolchain = "$build_root/toolchain/mingw:mingw_x86_64" -} else if (target_os == "android" && target_cpu == "arm64") { - _default_toolchain = "$build_root/toolchain/aosp:aosp_clang_arm64" -} else if (target_os == "mac" && target_cpu == "arm64") { - _default_toolchain = "$build_root/toolchain/mac:clang_arm64" -} -if (custom_toolchain != "") { - set_default_toolchain(custom_toolchain) -} else if (_default_toolchain != "") { - set_default_toolchain(_default_toolchain) -} - -# Determine current_cpu and current_os. -# (like a variable which could be changed during tracing deps) -if (current_cpu == "") { - current_cpu = target_cpu -} -if (current_os == "") { - current_os = target_os -} - -# Variables like "is_..." are already used to represent for -# "current_os == "..."" in most of the repositories. Thus, we need to make them -# change with the change of current_os. -if (current_os == "mac") { - is_aix = false - is_ohos = false - is_chromeos = false - is_linux = false - is_mac = true - is_nacl = false - is_posix = true - is_win = false - is_mingw = false - is_android = false - is_ios = false -} else if (current_os == "ohos") { - is_ohos = true - is_linux = false - is_mac = false - is_posix = true - is_win = false - is_mingw = false - is_android = false - is_ios = false -} else if (current_os == "linux") { - is_ohos = false - is_linux = true - is_mac = false - is_posix = true - is_win = false - is_mingw = false - is_android = false - is_ios = false -} else if (current_os == "mingw") { - is_ohos = false - is_linux = false - is_mac = false - is_posix = true - is_win = false - is_mingw = true - is_android = false - is_ios = false -} else if (current_os == "android") { - is_ohos = false - is_linux = false - is_mac = false - is_posix = true - is_win = false - is_mingw = false - is_android = true - is_ios = false -} - -default_compiler_configs = [ - "$build_root/config/compiler:default_warnings", - "$build_root/config/compiler:compiler", - "$build_root/config/compiler:default_include_dirs", - "$build_root/config/compiler:default_optimization", - "$build_root/config/compiler:runtime_config", - "$build_root/config:default_libs", - "$build_root/config/compiler:ark_code", - "$build_root/config/compiler:no_rtti", -] - -default_static_library_configs = default_compiler_configs -default_source_set_configs = default_compiler_configs -default_shared_library_configs = - default_compiler_configs + [ "$build_root/config:shared_library_config" ] -default_executable_configs = - default_compiler_configs + [ "$build_root/config:executable_config" ] - -set_defaults("executable") { - configs = default_executable_configs -} - -set_defaults("static_library") { - configs = default_static_library_configs -} - -set_defaults("shared_library") { - configs = default_shared_library_configs -} - -set_defaults("source_set") { - configs = default_source_set_configs -} - -target_list = [ - "static_library", - "shared_library", - "source_set", - "executable", -] - -foreach(target, target_list) { - template(target) { - target(target, target_name) { - forward_variables_from(invoker, "*", [ "no_default_deps" ]) - if (!defined(deps)) { - deps = [] - } - if (!defined(invoker.no_default_deps) || !invoker.no_default_deps) { - deps += [ "$build_root/config:${target}_deps" ] - } - } - } -} diff --git a/build/config/aosp/BUILD.gn b/build/config/aosp/BUILD.gn deleted file mode 100644 index 60891cd8eff886ddedf22f4df872dffb945d5b06..0000000000000000000000000000000000000000 --- a/build/config/aosp/BUILD.gn +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/aosp/config.gni") -import("$build_root/config/clang/clang.gni") -import("$build_root/config/compiler/compiler.gni") - -assert(is_android) - -config("compiler") { - if (current_cpu == "arm64") { - abi_target = "aarch64-linux-android" - compile_api_level = aosp64_ndk_api_level - } else { - assert(false, "Architecture not supported") - } - - cflags = [ - "--target=$abi_target", - "-isystem" + rebase_path("$aosp_ndk_root/sysroot/usr/include/$abi_target", - root_build_dir), - "-D__ANDROID_API__=$compile_api_level", - ] - if (compile_api_level < 20) { - cflags += [ "-DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC=1" ] - } - - asmflags = cflags - - ldflags = [ - "--target=$abi_target", - "-Wl,--no-undefined", - "-Wl,--exclude-libs=libgcc.a", - "-Wl,--exclude-libs=libc++_static.a", - "-Wl,--exclude-libs=libvpx_assembly_arm.a", - ] -} - -config("runtime_config") { - cflags_cc = [] - cflags_cc = [] - if (aosp_ndk_major_version >= 13) { - libcxx_include_path = - rebase_path("$aosp_libcpp_root/include", root_build_dir) - libcxxabi_include_path = - rebase_path("$aosp_ndk_root/sources/cxx-stl/llvm-libc++abi/include", - root_build_dir) - } else { - libcxx_include_path = - rebase_path("$aosp_libcpp_root/libcxx/include", root_build_dir) - libcxxabi_include_path = rebase_path( - "$aosp_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include", - root_build_dir) - } - cflags_cc += [ - "-isystem" + libcxx_include_path, - "-isystem" + libcxxabi_include_path, - ] - - defines = [ - "__GNU_SOURCE=1", # Necessary for clone(). - ] - ldflags = [ "-nostdlib" ] - lib_dirs = [ aosp_libcpp_lib_dir ] - - libs = [] - libs += [ "c++_static" ] - libs += [ "c++abi" ] - - # Manually link the libgcc.a that the cross compiler uses. This is - # absolute because the linker will look inside the sysroot if it's not. - libs += [ - rebase_path(aosp_libgcc_file), - rebase_path(aosp_log_file), - "c", - ] - - ldflags += [ "-Wl,--warn-shared-textrel" ] -} - -config("executable_config") { - cflags = [ "-fPIE" ] - asmflags = [ "-fPIE" ] - ldflags = [ "-pie" ] -} diff --git a/build/config/aosp/abi.gni b/build/config/aosp/abi.gni deleted file mode 100644 index 98e3559a04ceedb6ae64b002a27e67f43ab706cb..0000000000000000000000000000000000000000 --- a/build/config/aosp/abi.gni +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -assert(is_android) - -if (current_cpu == "arm64") { - aosp_app_abi = "arm64-v8a" -} else { - assert(false, "Unknown Aosp ABI, current_cpu: $current_cpu") -} diff --git a/build/config/aosp/config.gni b/build/config/aosp/config.gni deleted file mode 100644 index 007408decfeb479a4db81114a0cbfbfb5b61b74e..0000000000000000000000000000000000000000 --- a/build/config/aosp/config.gni +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -assert(is_android) - -import("abi.gni") - -# Get Android Env used to build Android Library. -ANDROID_HOME = getenv("ANDROID_HOME") -if (ANDROID_HOME == "") { - assert( - false, - "Maybe you have not set up android development environment." + - " Or some environment variable is named differently. Check, please!" + - " Get set-up steps from https://gitee.com/ark_standalone_build/docs") -} else { - print("ANDROID_HOME=$ANDROID_HOME") -} - -# Using a separate declare_args block for only these arguments, so that -# we can decide if we have to pull in definitions from the internal config -# early. -declare_args() { - # AOSP API level for 64 bits platforms - aosp64_ndk_api_level = 29 -} - -if (!defined(default_aosp_ndk_root)) { - default_aosp_ndk_root = "${ANDROID_HOME}/ndk/21.3.6528147" - default_aosp_ndk_major_version = 16 -} else { - assert(defined(default_aosp_ndk_major_version)) -} - -declare_args() { - aosp_ndk_root = default_aosp_ndk_root - aosp_ndk_major_version = default_aosp_ndk_major_version - - # Libc++ library directory. Override to use a custom libc++ binary. - aosp_libcpp_lib_dir = "" -} - -# Defines the name the AOSP build gives to the current host CPU -# architecture, which is different than the names GN uses. -if (host_cpu == "x64") { - aosp_host_arch = "x86_64" -} else if (host_cpu == "x86") { - aosp_host_arch = "x86" -} else { - assert(false, "Need AOSP toolchain support for your build CPU arch.") -} - -# Defines the name the aosp build gives to the current host CPU -# architecture, which is different than the names GN uses. -if (host_os == "linux") { - aosp_host_os = "linux" -} else if (host_os == "mac") { - aosp_host_os = "darwin" -} else { - assert(false, "Need AOSP toolchain support for your build OS.") -} - -# Directories and files -arm64_aosp_sysroot_subdir = - "platforms/android-${aosp64_ndk_api_level}/arch-arm64" - -# # Toolchain root directory for each build. The actual binaries are inside -# # a "bin" directory inside of these. -_aosp_toolchain_version = "4.9" -_aosp_toolchain_detailed_version = "4.9.x" -arm64_aosp_toolchain_root = "$aosp_ndk_root/toolchains/aarch64-linux-android-${_aosp_toolchain_version}/prebuilt/${aosp_host_os}-${aosp_host_arch}" - -# Location of libgcc. This is only needed for the current GN toolchain, so we -# only need to define the current one, rather than one for every platform -# like the toolchain roots. -if (current_cpu == "arm64") { - aosp_prebuilt_arch = "android-arm64" - _binary_prefix = "aarch64-linux-android" - aosp_toolchain_root = "$arm64_aosp_toolchain_root" - aosp_libgcc_file = "$aosp_toolchain_root/lib/gcc/aarch64-linux-android/${_aosp_toolchain_detailed_version}/libgcc.a" - aosp_log_file = "$aosp_ndk_root/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/30/liblog.so" -} - -aosp_libcpp_root = "$aosp_ndk_root/sources/cxx-stl/llvm-libc++" -if (aosp_libcpp_lib_dir == "") { - aosp_libcpp_lib_dir = "${aosp_libcpp_root}/libs/${aosp_app_abi}" -} diff --git a/build/config/arm.gni b/build/config/arm.gni deleted file mode 100644 index ad615098f8b7a084ea41d8f25cac1ae9356b7486..0000000000000000000000000000000000000000 --- a/build/config/arm.gni +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# These are primarily relevant in current_cpu == "arm" contexts, where -# ARM code is being compiled. But they can also be relevant in the -# other contexts when the code will change its behavior based on the -# cpu it wants to generate code for. -if (current_cpu == "arm") { - declare_args() { - # Version of the ARM processor when compiling on ARM. Ignored on non-ARM - # platforms. - arm_version = 7 - - # The ARM architecture. This will be a string like "armv6" or "armv7-a". - # An empty string means to use the default for the arm_version. - arm_arch = "" - - # The ARM floating point hardware. This will be a string like "neon" or - # "vfpv3". An empty string means to use the default for the arm_version. - arm_fpu = "" - - # The ARM floating point mode. This is either the string "hard", "soft", or - # "softfp". An empty string means to use the default one for the - # arm_version. - arm_float_abi = "" - - # The ARM variant-specific tuning mode. This will be a string like "armv6" - # or "cortex-a15". An empty string means to use the default for the - # arm_version. - arm_tune = "" - - # Whether to use the neon FPU instruction set or not. - arm_use_neon = "" - - # Whether to enable optional NEON code paths. - arm_optionally_use_neon = false - - # Thumb is a reduced instruction set available on some ARM processors that - # has increased code density. - arm_use_thumb = true - } - - assert(arm_float_abi == "" || arm_float_abi == "hard" || - arm_float_abi == "soft" || arm_float_abi == "softfp") - - if (arm_use_neon == "") { - if (current_os == "linux") { - # Don't use neon as a default. - arm_use_neon = false - } else { - arm_use_neon = true - } - } - - if (arm_version == 6) { - if (arm_arch == "") { - arm_arch = "armv6" - } - if (arm_tune != "") { - arm_tune = "" - } - if (arm_float_abi == "") { - arm_float_abi = "softfp" - } - if (arm_fpu == "") { - arm_fpu = "vfp" - } - arm_use_thumb = false - arm_use_neon = false - } else if (arm_version == 7) { - if (arm_arch == "") { - arm_arch = "armv7-a" - } - if (arm_tune == "") { - arm_tune = "generic-armv7-a" - } - - if (arm_float_abi == "") { - if (current_os == "ohos" || target_os == "ohos") { - arm_float_abi = "softfp" - } else if (current_os == "linux") { - arm_float_abi = "softfp" - } else { - arm_float_abi = "hard" - } - } - - if (arm_fpu == "") { - if (arm_use_neon) { - arm_fpu = "neon" - } else { - arm_fpu = "vfpv3-d16" - } - } - } else if (arm_version == 8) { - if (arm_arch == "") { - arm_arch = "armv8-a" - } - if (arm_tune == "") { - arm_tune = "generic-armv8-a" - } - - if (arm_float_abi == "") { - if (current_os == "ohos" || target_os == "ohos") { - arm_float_abi = "softfp" - } else { - arm_float_abi = "hard" - } - } - - if (arm_fpu == "") { - if (arm_use_neon) { - arm_fpu = "neon" - } else { - arm_fpu = "vfpv3-d16" - } - } - } -} else if (current_cpu == "arm64") { - if (!defined(board_arch)) { - arm_arch = "armv8-a" - } else { - arm_arch = "$board_arch" - } - if (!defined(board_cpu)) { - arm_cpu = "cortex-a55" - } else { - arm_cpu = "$board_cpu" - } - if (!defined(board_fpu)) { - arm_fpu = "neon-fp-armv8" - } else { - arm_fpu = "$board_fpu" - } - - # arm64 supports only "hard". - arm_float_abi = "hard" - arm_use_neon = true -} diff --git a/build/config/build_type.gni b/build/config/build_type.gni deleted file mode 100644 index e45ecd0799ce115aa5692221e9d17f64d8139c0d..0000000000000000000000000000000000000000 --- a/build/config/build_type.gni +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -declare_args() { - is_fastverify = false -} diff --git a/build/config/clang/clang.gni b/build/config/clang/clang.gni deleted file mode 100644 index 77ec27693f6d7889f2653fef478f4a07ed96eb6a..0000000000000000000000000000000000000000 --- a/build/config/clang/clang.gni +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/toolchain/toolchain.gni") - -default_clang_base_path = "//prebuilts/clang/ohos/${host_platform_dir}/llvm" -clang_lib_path = "//prebuilts/clang/ohos/${host_platform_dir}/llvm/lib/clang/${clang_version}/lib" - -declare_args() { - clang_base_path = default_clang_base_path - clang_lib_base_path = clang_lib_path -} diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn deleted file mode 100644 index cabbc862170cf82380e09e59914548aa0ea43653..0000000000000000000000000000000000000000 --- a/build/config/compiler/BUILD.gn +++ /dev/null @@ -1,505 +0,0 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/compiler/compiler.gni") -import("$build_root/config/sanitizers/sanitizers.gni") -import("$build_root/toolchain/toolchain.gni") -if (current_cpu == "arm" || current_cpu == "arm64") { - import("$build_root/config/arm.gni") -} - -declare_args() { - treat_warnings_as_errors = true -} - -use_rtti = use_cfi_diag || is_ubsan_vptr || is_ubsan_security - -config("rtti") { - if (is_win) { - cflags_cc = [ "/GR" ] - } else { - cflags_cc = [ "-frtti" ] - } -} - -config("no_exceptions") { - if (is_linux) { - cflags_cc = [ "-fno-exceptions" ] - cflags_objcc = cflags_cc - } -} - -config("optimize_speed") { - if (is_linux) { - cflags_cc = [ "-O3" ] - } -} - -config("no_rtti") { - # Some sanitizer configs may require RTTI to be left enabled globally - if (!use_rtti) { - if (is_win) { - cflags_cc = [ "/GR-" ] - } else { - cflags_cc = [ "-fno-rtti" ] - cflags_objcc = cflags_cc - } - } -} - -config("exceptions") { - cflags_cc = [ "-fexceptions" ] -} - -common_optimize_on_cflags = [] -common_optimize_on_ldflags = [] - -if (is_ohos) { - common_optimize_on_ldflags += [ - "-Wl,--warn-shared-textrel", # Warn in case of text relocations. - ] -} - -if (!(is_mac || is_ios)) { - # Non-Mac Posix flags. - - common_optimize_on_ldflags += [ - # Specifically tell the linker to perform optimizations. - # -O2 enables string tail merge optimization in gold and lld. - "-Wl,-O2", - ] - if (!is_mingw) { - common_optimize_on_ldflags += [ "-Wl,--gc-sections" ] - } - - common_optimize_on_cflags += [ - # Put data and code in their own sections, so that unused symbols - # can be removed at link time with --gc-sections. - "-fdata-sections", - "-ffunction-sections", - - # Don't emit the GCC version ident directives, they just end up in the - # .comment section taking up binary size. - "-fno-ident", - ] -} - -# Turn off optimizations. -config("no_optimize") { - if (is_ohos_or_android) { - ldflags = common_optimize_on_ldflags - cflags = common_optimize_on_cflags - - # On ohos we kind of optimize some things that don't affect debugging - # much even when optimization is disabled to get the binary size down. - if (is_clang) { - cflags += [ "-Oz" ] - } else { - cflags += [ "-Os" ] - } - } -} - -# Default "optimization on" config. -config("optimize") { - ldflags = common_optimize_on_ldflags - cflags = common_optimize_on_cflags - if (optimize_for_size) { - # Favor size over speed. - if (is_clang) { - cflags += [ "-O2" ] - } else { - cflags += [ "-Os" ] - } - } else { - cflags += [ "-O2" ] - } -} - -# The default optimization applied to all targets. This will be equivalent to -# either "optimize" or "no_optimize", depending on the build flags. -config("default_optimization") { - if (is_debug) { - configs = [ ":no_optimize" ] - } else { - configs = [ ":optimize" ] - } -} - -# default_warnings ------------------------------------------------------------ -# -# Collects all warning flags that are used by default.This way these -# flags are guaranteed to appear on the compile command line after -Wall. -config("default_warnings") { - cflags = [] - cflags_cc = [] - ldflags = [] - - # Suppress warnings about ABI changes on ARM (Clang doesn't give this - # warning). - if (current_cpu == "arm" && !is_clang) { - cflags += [ "-Wno-psabi" ] - } - - if (!is_clang) { - cflags_cc += [ - # See comment for -Wno-c++11-narrowing. - "-Wno-narrowing", - ] - - # -Wunused-local-typedefs is broken in gcc, - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872 - cflags += [ "-Wno-unused-local-typedefs" ] - - # Don't warn about "maybe" uninitialized. Clang doesn't include this - # in -Wall but gcc does, and it gives false positives. - cflags += [ "-Wno-maybe-uninitialized" ] - cflags += [ "-Wno-deprecated-declarations" ] - - # -Wcomment gives too many false positives in the case a - # backslash ended comment line is followed by a new line of - # comments - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61638 - cflags += [ "-Wno-comments" ] - } - - # Common Clang and GCC warning setup. - if (!is_win || is_clang) { - cflags += [ - # Disables. - "-Wno-missing-field-initializers", # "struct foo f = {0};" - "-Wno-unused-parameter", # Unused function parameters. - ] - } - - if (is_mingw) { - cflags += [ - "-Wno-error=c99-designator", - "-Wno-error=anon-enum-enum-conversion", - "-Wno-error=implicit-fallthrough", - "-Wno-error=sizeof-array-div", - "-Wno-error=reorder-init-list", - "-Wno-error=range-loop-construct", - "-Wno-error=deprecated-copy", - "-Wno-error=implicit-int-float-conversion", - "-Wno-error=inconsistent-dllimport", - "-Wno-error=abstract-final-class", - "-Wno-error=sign-compare", - "-Wno-unknown-warning-option", - ] - } - - if (target_cpu == "mipsel") { - cflags += [ - "-Wno-extra-semi", - "-Wno-error=tautological-constant-out-of-range-compare", - "-Wno-shift-count-overflow", - "-Wno-constant-conversion", - ] - } - - if (is_clang) { - cflags += [ - # This warns on using ints as initializers for floats in - # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), - "-Wno-c++11-narrowing", - "-Wno-unneeded-internal-declaration", - ] - if (current_os == "android") { - # Disable calls to out-of-line helpers, don't implement atomic operations for these calls. - # (Keep consistent with the default of clang15 in directory prebuilts.) - cflags += [ "-mno-outline-atomics" ] - } - if (use_musl) { - cflags += [ - "-Wno-error=c99-designator", - "-Wno-error=anon-enum-enum-conversion", - "-Wno-error=implicit-fallthrough", - "-Wno-error=sizeof-array-div", - "-Wno-error=reorder-init-list", - "-Wno-error=range-loop-construct", - "-Wno-error=deprecated-copy", - "-Wno-error=implicit-int-float-conversion", - "-Wno-error=inconsistent-dllimport", - "-Wno-error=unknown-warning-option", - "-Wno-error=abstract-final-class", - "-Wno-error=sign-compare", - "-Wno-error=int-in-bool-context", - "-Wno-error=xor-used-as-pow", - "-Wno-error=return-stack-address", - "-Wno-error=dangling-gsl", - "-Wno-unused-but-set-variable", - "-Wno-deprecated-declarations", - "-Wno-unused-but-set-parameter", - "-Wno-null-pointer-subtraction", - "-Wno-unqualified-std-cast-call", - ] - } - } -} - -config("compiler") { - asmflags = [] - cflags = [] - cflags_c = [] - cflags_cc = [] - cflags_objc = [] - cflags_objcc = [] - ldflags = [] - defines = [] - configs = [] - inputs = [] - - # System-specific flags. If your compiler flags apply to one of the - # categories here, add it to the associated file to keep this shared config - # smaller. - if (is_android) { - configs += [ "$build_root/config/aosp:compiler" ] - } - if (is_mingw) { - configs += [ "$build_root/config/mingw:compiler" ] - cflags += [ "-fno-stack-protector" ] - } else if (is_ohos) { - configs += [ "$build_root/config/ohos:compiler" ] - } else if (is_mac) { - configs += [ "$build_root/config/mac:compiler" ] - } - if (is_linux || is_ohos || is_android) { - cflags += [ "-fPIC" ] - ldflags += [ "-fPIC" ] - if (!is_clang) { - # Use pipes for communicating between sub-processes. Faster. - # (This flag doesn't do anything with Clang.) - cflags += [ "-pipe" ] - } - - ldflags += [ - "-Wl,-z,noexecstack", - "-Wl,-z,now", - "-Wl,-z,relro", - ] - - # Compiler instrumentation can introduce dependencies in DSOs to symbols in - # the executable they are loaded into, so they are unresolved at link-time. - if (is_ohos || (!using_sanitizer && !is_safestack)) { - ldflags += [ - "-Wl,-z,defs", - "-Wl,--as-needed", - ] - } - - # # Change default thread stack size to 2MB for asan. - if (is_ohos && using_sanitizer) { - ldflags += [ "-Wl,-z,stack-size=2097152" ] - } - } - - if (is_posix && use_lld) { - # Explicitly select LLD, or else some link actions would fail and print - # "/usr/bin/ld ... {SharedLibrayName}.so ... not found". - ldflags += [ "-fuse-ld=lld" ] - if (current_cpu == "arm64") { - # Reduce the page size from 65536 in order to reduce binary size slightly - # by shrinking the alignment gap between segments. This also causes all - # segments to be mapped adjacently, which breakpad relies on. - ldflags += [ "-Wl,-z,max-page-size=4096" ] - } - } - - configs += [ - # See the definitions below. - ":compiler_cpu_abi", - ":compiler_codegen", - ] - - if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) { - ldflags += [ "-Wl,--pack-dyn-relocs=android+relr" ] - } - - if (is_linux) { - cflags += [ "-pthread" ] - # Do not use the -pthread ldflag here since it becomes a no-op - # when using -nodefaultlibs, which would cause an unused argument - # error. "-lpthread" is added in $build_root/config:default_libs. - } - if (is_clang) { - cflags += [ "-fcolor-diagnostics" ] - cflags += [ "-fmerge-all-constants" ] - } - - use_xcode_clang = false - if (is_clang && !use_xcode_clang) { - cflags += [ - "-Xclang", - "-mllvm", - "-Xclang", - "-instcombine-lower-dbg-declare=0", - ] - } - - if (is_clang) { - cflags += [ "-no-canonical-prefixes" ] - } - - # specify language standard version. - if (is_linux || is_ohos || is_android || current_os == "aix") { - if (is_clang) { - cflags_cc += [ "-std=c++17" ] - } else { - # In standards-conforming mode, some features like macro "##__VA_ARGS__" - # are not supported by gcc. Add flags to support these features. - cflags_cc += [ "-std=gnu++17" ] - } - } else if (!is_win && !is_mingw) { - cflags_cc += [ "-std=c++17" ] - } -} - -# This provides the basic options to select the target CPU and ABI. -# It is factored out of "compiler" so that special cases can use this -# without using everything that "compiler" brings in. Options that -# tweak code generation for a particular CPU do not belong here! -# See "compiler_codegen", below. -config("compiler_cpu_abi") { - cflags = [] - ldflags = [] - defines = [] - - if (is_posix && !is_mac) { - # CPU architecture. We may or may not be doing a cross compile now, so for - # simplicity we always explicitly set the architecture. - if (current_cpu == "x64") { - cflags += [ - "-m64", - "-march=x86-64", - ] - ldflags += [ "-m64" ] - } else if (current_cpu == "x86") { - cflags += [ - "-m32", - "-msse2", - "-mfpmath=sse", - "-mmmx", - ] - ldflags += [ "-m32" ] - } else if (current_cpu == "arm") { - if (is_clang && !is_ohos) { - cflags += [ "--target=arm-linux-gnueabihf" ] - ldflags += [ "--target=arm-linux-gnueabihf" ] - } - cflags += [ - "-march=$arm_arch", - "-mfloat-abi=$arm_float_abi", - ] - if (arm_tune != "") { - cflags += [ "-mtune=$arm_tune" ] - } - } else if (current_cpu == "arm64") { - if (is_clang && !is_ohos && !is_android) { - cflags += [ "--target=aarch64-linux-gnu" ] - ldflags += [ "--target=aarch64-linux-gnu" ] - } - if (is_clang && (is_ohos || is_android)) { - ldflags += [ "-Wl,--hash-style=gnu" ] - } - if (!is_android && !is_clang) { - cflags += [ - "-march=$arm_arch", - "-mfloat-abi=$arm_float_abi", - "-mfpu=$arm_fpu", - ] - } else { - cflags += [ "-march=$arm_arch" ] - } - ldflags += [ "-march=$arm_arch" ] - } - } - - asmflags = cflags - if (current_cpu == "arm64") { - asmflags += [ "-march=armv8.2-a+dotprod+fp16" ] - } -} - -config("compiler_codegen") { - configs = [] - cflags = [] - - if (is_posix && !is_mac) { - if (current_cpu == "x86") { - if (is_clang) { - cflags += [ "-momit-leaf-frame-pointer" ] - } - } else if (current_cpu == "arm") { - if (is_ohos && !is_clang) { - # Clang doesn't support these flags. - cflags += [ - "-fno-tree-sra", - "-fno-caller-saves", - ] - } - } - } - - asmflags = cflags -} - -config("default_include_dirs") { - include_dirs = [ - "//", - root_gen_dir, - ] -} - -config("runtime_config") { - configs = [] - if (is_posix) { - configs += [ "$build_root/config/posix:runtime_config" ] - } - - # System-specific flags. If your compiler flags apply to one of the - # categories here, add it to the associated file to keep this shared config - # smaller. - if (is_ohos) { - configs += [ "$build_root/config/ohos:runtime_config" ] - } - - if (is_android) { - configs += [ "$build_root/config/aosp:runtime_config" ] - } - - if (is_mac) { - configs += [ "$build_root/config/mac:runtime_config" ] - } -} - -config("ark_code") { - cflags = [ "-Wall" ] - if (treat_warnings_as_errors) { - cflags += [ "-Werror" ] - ldflags = [ "-Werror" ] - } - if (is_clang) { - # Enable extra warnings for ark_code when we control the compiler. - cflags += [ "-Wextra" ] - } - - if (is_clang) { - cflags += [ - "-Wimplicit-fallthrough", - "-Wthread-safety", - ] - } - - configs = [ ":default_warnings" ] -} diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni deleted file mode 100644 index 2b300ab5c605cdfd15e71f9a6c1e1cb929f7bca8..0000000000000000000000000000000000000000 --- a/build/config/compiler/compiler.gni +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if (current_cpu == "arm" || current_cpu == "arm64") { - import("$build_root/config/arm.gni") -} - -if (current_cpu == "arm" || current_cpu == "arm64") { - import("$build_root/config/arm.gni") -} - -is_ohos_or_android = is_ohos || is_android - -optimize_for_size = is_ohos_or_android - -declare_args() { - symbol_level = -1 - - # Set to true to use lld, the LLVM linker. This flag may be used on Windows, - # Linux. - use_lld = is_clang && - (is_win || (is_linux && current_cpu == "x64") || - (is_linux && (current_cpu == "x86" || current_cpu == "arm64")) || - (is_ohos_or_android && (current_cpu != "arm" || arm_version >= 7))) -} - -declare_args() { - # Whether to use the gold linker from binutils instead of lld or bfd. - use_gold = - !use_lld && - ((is_linux && (current_cpu == "x64" || current_cpu == "x86" || - current_cpu == "arm")) || - (is_ohos_or_android && (current_cpu == "x86" || current_cpu == "x64" || - current_cpu == "arm" || current_cpu == "arm64"))) -} - -if (symbol_level == -1) { - if (is_ohos_or_android) { - # With instrumentation enabled, debug info puts libchrome.so over 4gb, which - # causes the linker to produce an invalid ELF. http://crbug.com/574476 - symbol_level = 0 - } else if (is_ohos) { - # Reduce symbol level when it will cause invalid elf files to be created - # (due to file size). https://crbug.com/648948. - symbol_level = 1 - } else { - symbol_level = 0 - } -} diff --git a/build/config/components/ets_frontend/es2abc_config.gni b/build/config/components/ets_frontend/es2abc_config.gni deleted file mode 100644 index a805c564fa4c122631c95cbe7474e9db056af64a..0000000000000000000000000000000000000000 --- a/build/config/components/ets_frontend/es2abc_config.gni +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/components/ets_frontend/ets_frontend_config.gni") - -es2abc_root = "//arkcompiler/ets_frontend/es2panda" -es2abc_build_path = "" -es2abc_build_deps = "" -es2abc_out_root = "" - -if (host_toolchain == toolchain_mac) { - es2abc_out_root = - get_label_info("$es2abc_root:es2panda($toolchain_mac)", "root_out_dir") - es2abc_build_deps = [ "$es2abc_root:es2panda($toolchain_mac)" ] -} else if (host_toolchain == toolchain_win) { - es2abc_out_root = - get_label_info("$es2abc_root:es2panda($toolchain_win)", "root_out_dir") - es2abc_build_deps = [ "$es2abc_root:es2panda($toolchain_win)" ] -} else { - es2abc_out_root = - get_label_info("$es2abc_root:es2panda($toolchain_linux)", "root_out_dir") - es2abc_build_deps = [ "$es2abc_root:es2panda($toolchain_linux)" ] -} -es2abc_build_path = es2abc_out_root + "/arkcompiler/ets_frontend" - -# Generate abc. -# -# Mandatory arguments: -# plugin_path -- plugin js file path -# plugin_name -- name of js file, ex: BatteryPlugin.js -# generat_file -- name of generated file -# package_name -- name of generated file's package -# extra_dependencies -- a list of files that should be considered as dependencies, must be label -# out_puts -template("es2abc_gen_abc") { - assert(defined(invoker.src_js), "src_js is required!") - assert(defined(invoker.dst_file), "dst_file is required!") - assert(defined(invoker.out_puts), "out_puts is required!") - - extra_dependencies = [] - if (defined(invoker.extra_dependencies)) { - extra_dependencies += invoker.extra_dependencies - } - - action("$target_name") { - if (defined(invoker.extra_visibility)) { - visibility = invoker.extra_visibility - } - - script = "$build_root/scripts/generate_js_bytecode.py" - - deps = extra_dependencies - deps += es2abc_build_deps - - args = [ - "--src-js", - invoker.src_js, - "--dst-file", - invoker.dst_file, - "--frontend-tool-path", - rebase_path("${es2abc_build_path}"), - ] - - if (defined(invoker.extension)) { - args += [ - "--extension", - invoker.extension, - ] - } - - if (defined(invoker.dump_symbol_table)) { - args += [ - "--dump-symbol-table", - invoker.dump_symbol_table, - ] - } - if (defined(invoker.input_symbol_table)) { - args += [ - "--input-symbol-table", - invoker.input_symbol_table, - ] - } - - if (defined(invoker.extra_args)) { - args += invoker.extra_args - } - - if (defined(invoker.in_puts)) { - inputs = invoker.in_puts - } - - outputs = invoker.out_puts - } -} diff --git a/build/config/components/ets_frontend/ets_frontend_config.gni b/build/config/components/ets_frontend/ets_frontend_config.gni deleted file mode 100644 index 2a3c66d98f8a8e5b7b9f54e23b1afaed1b771a40..0000000000000000000000000000000000000000 --- a/build/config/components/ets_frontend/ets_frontend_config.gni +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if (!defined(ark_standalone_build)) { - ark_standalone_build = false -} - -if (!ark_standalone_build) { - build_root = "//build" - ark_third_party_root = "//third_party" - import("$build_root/ohos.gni") -} else { - ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn" - import("$build_root/ark.gni") -} -import("$build_root/test.gni") - -ets_frontend_root = "//arkcompiler/ets_frontend" - -if (host_cpu == "arm64") { - toolchain_linux = "$build_root/toolchain/linux:clang_arm64" - toolchain_mac = "$build_root/toolchain/mac:clang_arm64" -} else { - toolchain_linux = "$build_root/toolchain/linux:clang_x64" - toolchain_mac = "$build_root/toolchain/mac:clang_x64" -} -toolchain_win = "$build_root/toolchain/mingw:mingw_x86_64" diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn deleted file mode 100644 index 10c92c49288ef764838a381f17d1d10d5882f93f..0000000000000000000000000000000000000000 --- a/build/config/linux/BUILD.gn +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -config("executable_config") { - cflags = [ "-fPIE" ] - asmflags = [ "-fPIE" ] - ldflags = [ "-pie" ] -} diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn deleted file mode 100644 index f49ed7cdb001789f19911d5d591e9bf7275908ec..0000000000000000000000000000000000000000 --- a/build/config/mac/BUILD.gn +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/mac/mac_sdk.gni") -import("$build_root/config/mac/symbols.gni") -import("$build_root/config/sysroot.gni") - -# This is included by reference in the //build/config/compiler config that -# is applied to all targets. It is here to separate out the logic. -config("compiler") { - # These flags are shared between the C compiler and linker. - common_mac_flags = [] - - # CPU architecture. - if (current_cpu == "x64") { - common_mac_flags += [ - "-arch", - "x86_64", - ] - } else if (current_cpu == "x86") { - common_mac_flags += [ - "-arch", - "i386", - ] - } - - # This is here so that all files get recompiled after an Xcode update. - # (defines are passed via the command line, and build system rebuild things - # when their commandline changes). Nothing should ever read this define. - defines = [ "CR_XCODE_VERSION=$xcode_version" ] - - defines += [ - "_LIBCPP_CONFIG_SITE", - "_LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=0", - ] - - asmflags = common_mac_flags - cflags = common_mac_flags - - # Without this, the constructors and destructors of a C++ object inside - # an Objective C struct won't be called, which is very bad. - cflags_objcc = [ "-fobjc-call-cxx-cdtors" ] - - ldflags = common_mac_flags - - # Create a new read-only segment for protected memory. The default segments - # (__TEXT and __DATA) are mapped read-execute and read-write by default. - ldflags += [ - "-segprot", - "PROTECTED_MEMORY", - "rw", - "r", - ] - - if (save_unstripped_output) { - ldflags += [ "-Wcrl,unstripped," + rebase_path(root_out_dir) ] - } -} - -# This is included by reference in the //build/config/compiler:runtime_library -# config that is applied to all targets. It is here to separate out the logic -# that is Mac-only. Please see that target for advice on what should go in -# :runtime_library vs. :compiler. -config("runtime_config") { - common_flags = [ - "-isysroot", - sysroot, - "-mmacosx-version-min=$mac_deployment_target", - ] - - asmflags = common_flags - cflags = common_flags - ldflags = common_flags - framework_dirs = [ sysroot ] - - # Prevent Mac OS X AssertMacros.h (included by system header) from defining - # macros that collide with common names, like 'check', 'require', and - # 'verify'. - # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h - defines = [ "__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0" ] -} - -# On Mac, this is used for everything except static libraries. -config("mac_dynamic_flags") { - ldflags = [ "-Wl,-ObjC" ] # Always load Objective-C categories and classes. - - if (is_component_build) { - ldflags += [ - # Path for loading shared libraries for unbundled binaries. - "-Wl,-rpath,@loader_path/.", - - # Path for loading shared libraries for bundled binaries. Get back from - # Binary.app/Contents/MacOS. - "-Wl,-rpath,@loader_path/../../..", - ] - } -} - -# The ldflags referenced below are handled by -# //build/toolchain/mac/linker_driver.py. -# Remove this config if a target wishes to change the arguments passed to the -# strip command during linking. This config by default strips all symbols -# from a binary, but some targets may wish to specify an exports file to -# preserve specific symbols. -config("strip_all") { - if (enable_stripping) { - ldflags = [ "-Wcrl,strip,-x,-S" ] - } -} diff --git a/build/config/mac/mac_sdk.gni b/build/config/mac/mac_sdk.gni deleted file mode 100644 index a274654353f4898e86ae4278b2dcac1305eea3df..0000000000000000000000000000000000000000 --- a/build/config/mac/mac_sdk.gni +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/mac/mac_sdk_overrides.gni") -import("$build_root/toolchain/toolchain.gni") - -declare_args() { - mac_deployment_target = "10.13.0" - - mac_min_system_version = "10.13.0" - - # Path to a specific version of the Mac SDK, not including a slash at the end. - # If empty, the path to the lowest version greater than or equal to - # mac_sdk_min is used. - mac_sdk_path = "" - - # The SDK name as accepted by xcodebuild. - mac_sdk_name = "macosx" -} - -# Check that the version of macOS SDK used is the one requested when building -# a version of Chrome shipped to the users. Disable the check if building for -# iOS as the version macOS SDK used is not relevant for the tool build for the -# host (they are not shipped) --- this is required as Chrome on iOS is usually -# build with the latest version of Xcode that may not ship with the version of -# the macOS SDK used to build Chrome on mac. -_verify_sdk = is_official_build && target_os != "ios" - -find_sdk_args = [ "--print_sdk_path" ] -if (!use_system_xcode) { - find_sdk_args += [ - "--developer_dir", - hermetic_xcode_path, - ] -} -if (_verify_sdk) { - find_sdk_args += [ - "--verify", - mac_sdk_min, - "--sdk_path=" + mac_sdk_path, - ] -} else { - find_sdk_args += [ mac_sdk_min ] -} - -# The tool will print the SDK path on the first line, and the version on the -# second line. -find_sdk_lines = - exec_script("$build_root/misc/mac/find_sdk.py", find_sdk_args, "list lines") - -mac_sdk_version = find_sdk_lines[1] -if (mac_sdk_path == "") { - mac_sdk_path = find_sdk_lines[0] -} - -script_name = "$build_root/config/mac/sdk_info.py" -sdk_info_args = [] -if (!use_system_xcode) { - sdk_info_args += [ - "--developer_dir", - hermetic_xcode_path, - ] -} -sdk_info_args += [ mac_sdk_name ] - -_mac_sdk_result = exec_script(script_name, sdk_info_args, "scope") -xcode_version = _mac_sdk_result.xcode_version -xcode_build = _mac_sdk_result.xcode_build -machine_os_build = _mac_sdk_result.machine_os_build -xcode_version_int = _mac_sdk_result.xcode_version_int - -if (mac_sdk_version != mac_sdk_min && - exec_script("$build_root/misc/mac/check_return_value.py", - [ - "test", - xcode_version, - "-ge", - "0730", - ], - "value") != 1) { - print( - "********************************************************************************") - print( - " WARNING: The Mac OS X SDK is incompatible with the version of Xcode. To fix,") - print( - " either upgrade Xcode to the latest version or install the Mac OS X") - print( - " $mac_sdk_min SDK. For more information, see https://crbug.com/620127.") - print() - print(" Current SDK Version: $mac_sdk_version") - print(" Current Xcode Version: $xcode_version ($xcode_build)") - print( - "********************************************************************************") - assert(false, "SDK is incompatible with Xcode") -} diff --git a/build/config/mac/mac_sdk_overrides.gni b/build/config/mac/mac_sdk_overrides.gni deleted file mode 100644 index 91ddada125dae9de41d874fd2bc53816beae2b04..0000000000000000000000000000000000000000 --- a/build/config/mac/mac_sdk_overrides.gni +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This file contains arguments that subprojects may choose to override. It -# asserts that those overrides are used, to prevent unused args warnings. - -_sdk_min_from_env = getenv("FORCE_MAC_SDK_MIN") -declare_args() { - # Minimum supported version of the Mac SDK. - if (_sdk_min_from_env == "") { - mac_sdk_min = "10.12" - } else { - mac_sdk_min = _sdk_min_from_env - } -} - -# Always assert that mac_sdk_min is used on non-macOS platforms to prevent -# unused args warnings. -if (!is_mac) { - assert(mac_sdk_min == "10.12" || true) -} diff --git a/build/config/mac/sdk_info.py b/build/config/mac/sdk_info.py deleted file mode 100755 index b1f4be671e6fbc46ffdddbc256a1b43b3827202d..0000000000000000000000000000000000000000 --- a/build/config/mac/sdk_info.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import argparse -import doctest -import itertools -import os -import subprocess -import sys - -# This script prints information about the build system, the operating -# system and the iOS or Mac SDK (depending on the platform "iphonesimulator", -# "iphoneos" or "macosx" generally). - - -def split_version(version: str or bytes): - """ - Splits the Xcode version to 3 values. - - >>> list(split_version('8.2.1.1')) - ['8', '2', '1'] - >>> list(split_version('9.3')) - ['9', '3', '0'] - >>> list(split_version('10.0')) - ['10', '0', '0'] - """ - if isinstance(version, bytes): - version = version.decode() - version = version.split('.') - return itertools.islice(itertools.chain(version, itertools.repeat('0')), 0, 3) - - -def format_version(version: str or bytes): - """ - Converts Xcode version to a format required for DTXcode in Info.plist - - >>> format_version('8.2.1') - '0821' - >>> format_version('9.3') - '0930' - >>> format_version('10.0') - '1000' - """ - major, minor, patch = split_version(version) - return ('%2s%s%s' % (major, minor, patch)).replace(' ', '0') - - -def fill_xcode_version(fill_settings: dict) -> dict: - """Fills the Xcode version and build number into |fill_settings|.""" - - try: - lines = subprocess.check_output(['xcodebuild', '-version']).splitlines() - fill_settings['xcode_version'] = format_version(lines[0].split()[-1]) - fill_settings['xcode_version_int'] = int(fill_settings['xcode_version'], 10) - fill_settings['xcode_build'] = lines[-1].split()[-1] - except subprocess.CalledProcessError as cpe: - print(f"Failed to run xcodebuild -version: {cpe}") - - -def fill_machine_os_build(fill_settings: dict): - """Fills OS build number into |fill_settings|.""" - fill_settings['machine_os_build'] = subprocess.check_output( - ['sw_vers', '-buildVersion']).strip() - - -def fill_sdk_path_and_version(fill_settings: dict, platform: str, xcode_version: str or bytes): - """Fills the SDK path and version for |platform| into |fill_settings|.""" - fill_settings['sdk_path'] = subprocess.check_output([ - 'xcrun', '-sdk', platform, '--show-sdk-path']).strip() - fill_settings['sdk_version'] = subprocess.check_output([ - 'xcrun', '-sdk', platform, '--show-sdk-version']).strip() - fill_settings['sdk_platform_path'] = subprocess.check_output([ - 'xcrun', '-sdk', platform, '--show-sdk-platform-path']).strip() - if xcode_version >= '0720': - fill_settings['sdk_build'] = subprocess.check_output([ - 'xcrun', '-sdk', platform, '--show-sdk-build-version']).strip() - else: - fill_settings['sdk_build'] = fill_settings['sdk_version'] - - -if __name__ == '__main__': - doctest.testmod() - - parser = argparse.ArgumentParser() - parser.add_argument("--developer_dir", required=False) - args, unknownargs = parser.parse_known_args() - if args.developer_dir: - os.environ['DEVELOPER_DIR'] = args.developer_dir - - if len(unknownargs) != 1: - sys.stderr.write( - 'usage: %s [iphoneos|iphonesimulator|macosx]\n' % - os.path.basename(sys.argv[0])) - sys.exit(1) - - settings = {} - fill_machine_os_build(settings) - fill_xcode_version(settings) - try: - fill_sdk_path_and_version(settings, unknownargs[0], settings.get('xcode_version')) - except ValueError as vle: - print(f"Error: {vle}") - - for key in sorted(settings): - value = settings.get(key) - if isinstance(value, bytes): - value = value.decode() - if key != 'xcode_version_int': - value = '"%s"' % value - print('%s=%s' % (key, value)) - else: - print('%s=%d' % (key, value)) diff --git a/build/config/mac/symbols.gni b/build/config/mac/symbols.gni deleted file mode 100644 index 6e69ed4c634981944a4cfbb7e396219ca516dbbb..0000000000000000000000000000000000000000 --- a/build/config/mac/symbols.gni +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/sanitizers/sanitizers.gni") - -# This file declares arguments and configs that control whether dSYM debug -# info is produced and whether build products are stripped. - -declare_args() { - # Produce dSYM files for targets that are configured to do so. dSYM - # generation is controlled globally as it is a linker output (produced via - # the //build/toolchain/mac/linker_driver.py. Enabling this will result in - # all shared library, loadable module, and executable targets having a dSYM - # generated. - enable_dsyms = is_official_build || using_sanitizer - - # Strip symbols from linked targets by default. If this is enabled, the - # //build/config/mac:strip_all config will be applied to all linked targets. - # If custom stripping parameters are required, remove that config from a - # linked target and apply custom -Wcrl,strip flags. See - # //build/toolchain/mac/linker_driver.py for more information. - enable_stripping = is_official_build -} - -# Save unstripped copies of targets with a ".unstripped" suffix. This is -# useful to preserve the original output when enable_stripping=true but -# we're not actually generating real dSYMs. -save_unstripped_output = enable_stripping && !enable_dsyms diff --git a/build/config/mac/xcrun.py b/build/config/mac/xcrun.py deleted file mode 100755 index f322a9ee69dd6ec9bce053fe8bfa7b0534b64119..0000000000000000000000000000000000000000 --- a/build/config/mac/xcrun.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import argparse -import os -import subprocess -import sys - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description='A script to execute a command via xcrun.') - parser.add_argument('--stamp', action='store', type=str, - help='Write a stamp file to this path on success.') - parser.add_argument('--developer_dir', required=False, - help='Path to Xcode.') - args, unknown_args = parser.parse_known_args() - - if args.developer_dir: - os.environ['DEVELOPER_DIR'] = args.developer_dir - - rv = subprocess.check_call(['xcrun'] + unknown_args) - flags = os.O_RDWR | os.O_CREAT | os.O_EXCL - modes = stat.S_IWUSR | stat.S_IRUSR - if rv == 0 and args.stamp: - if os.path.exists(args.stamp): - os.unlink(args.stamp) - with os.fdopen(os.open(args.stamp, flags, modes), 'w+') as fp: - sys.exit(rv) diff --git a/build/config/mingw/BUILD.gn b/build/config/mingw/BUILD.gn deleted file mode 100644 index 216319459ad4486c27b88066b9a7c3b119387e07..0000000000000000000000000000000000000000 --- a/build/config/mingw/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -assert(is_mingw) - -config("compiler") { - _target = [ - "-target", - "x86_64-pc-windows-gnu", - ] - - _mingw_flags = [ - "-rtlib=compiler-rt", - "-stdlib=libc++", - "-lunwind", - "-lpthread", - "-Qunused-arguments", - ] - - cflags = _target - asmflags = _target - ldflags = _target - - cflags += _mingw_flags - asmflags += _mingw_flags - ldflags += _mingw_flags - - cflags += [ "-fuse-ld=lld" ] - - ldflags += [ "-fuse-ld=lld" ] - - cflags += [ "-D__CUSTOM_SECURITY_LIBRARY" ] -} diff --git a/build/config/ohos/BUILD.gn b/build/config/ohos/BUILD.gn deleted file mode 100644 index e91c71020912710a5d7ef8e938b341f889325de1..0000000000000000000000000000000000000000 --- a/build/config/ohos/BUILD.gn +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/compiler/compiler.gni") -import("$build_root/config/ohos/config.gni") -import("$build_root/third_party_gn/musl/musl_config.gni") - -assert(is_ohos) - -config("compiler") { - cflags = [ - "-ffunction-sections", - "-fno-short-enums", - ] - defines = [ "HAVE_SYS_UIO_H" ] - - cflags += [ "--target=$abi_target" ] - include_dirs = [ "${musl_sysroot}/usr/include/${abi_target}" ] - - ldflags = [ "--target=$abi_target" ] - asmflags = cflags -} - -config("runtime_config") { - cflags_cc = [] - - defines = [ - "__MUSL__", - "_LIBCPP_HAS_MUSL_LIBC", - "__BUILD_LINUX_WITH_CLANG", - ] - ldflags = [ "-nostdlib" ] - - libs = [ - rebase_path(libclang_rt_file), - "c", - rebase_path(libcxxabi_file), - ] - - if ((current_cpu == "arm" && arm_version == 6) || current_cpu == "mipsel") { - libs += [ "atomic" ] - libs_out_dir = "usr/lib/${musl_target_triple}" - output_dir = "${target_out_dir}/${libs_out_dir}" - atomic_path = rebase_path("${output_dir}") - ldflags += [ "-L${atomic_path}" ] - } - - ldflags += [ "-Wl,--warn-shared-textrel" ] -} - -config("executable_config") { - cflags = [ - "-fPIE", - "-fPIC", - ] - asmflags = [ "-fPIE" ] -} diff --git a/build/config/ohos/config.gni b/build/config/ohos/config.gni deleted file mode 100644 index 1da4bc2f34ba46f5169bac7ff7c17a0cac024247..0000000000000000000000000000000000000000 --- a/build/config/ohos/config.gni +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/ohos/musl.gni") -if (is_ohos) { - import("$build_root/config/clang/clang.gni") - - if (current_cpu == "arm") { - abi_target = "arm-linux-ohos" - } else if (current_cpu == "x86") { - abi_target = "" - } else if (current_cpu == "arm64") { - abi_target = "aarch64-linux-ohos" - } else if (current_cpu == "x86_64" || current_cpu == "x64") { - abi_target = "x86_64-linux-ohos" - } else if (current_cpu == "mipsel") { - abi_target = "mipsel-linux-ohos" - } else { - assert(false, "Arch not supported") - } - libclang_rt_file = "${clang_base_path}/lib/clang/15.0.4/lib/${abi_target}/libclang_rt.builtins.a" - libcxxabi_file = "${clang_base_path}/lib/${abi_target}/libc++abi.a" - libcxxso_file = "${clang_base_path}/lib/${abi_target}/libc++.so" -} diff --git a/build/config/ohos/musl.gni b/build/config/ohos/musl.gni deleted file mode 100644 index 281022c96037f1ce4fa9a1037c0df49d82890f81..0000000000000000000000000000000000000000 --- a/build/config/ohos/musl.gni +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if (use_musl) { - musl_target = "$build_root/third_party_gn/musl:musl_libs" - musl_sysroot = get_label_info(musl_target, "target_out_dir") -} diff --git a/build/config/posix/BUILD.gn b/build/config/posix/BUILD.gn deleted file mode 100644 index b8c7da7eadfd6346805d487ab283f33afe349158..0000000000000000000000000000000000000000 --- a/build/config/posix/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/sysroot.gni") - -assert(is_posix) - -config("runtime_config") { - ldflags = [] - cflags_objcc = [] - cflags_objc = [] - cflags_cc = [] - cflags_c = [] - cflags = [] - asmflags = [] - - if (sysroot != "") { - # Pass the sysroot to all C compiler variants, the assembler, and linker. - sysroot_flags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] - - asmflags += sysroot_flags - - link_sysroot_flags = - [ "--sysroot=" + rebase_path(link_sysroot, root_build_dir) ] - ldflags += link_sysroot_flags - cflags_c += sysroot_flags - cflags_cc += sysroot_flags - cflags_objc += sysroot_flags - cflags_objcc += sysroot_flags - } -} diff --git a/build/config/qemu/config.gni b/build/config/qemu/config.gni deleted file mode 100644 index 76f5fe298c4c45be6dcdf055b021f0a925705f5a..0000000000000000000000000000000000000000 --- a/build/config/qemu/config.gni +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Get QEMU_INSTALLATION_PATH used to run executables cross platform. -QEMU_INSTALLATION_PATH = getenv("QEMU_INSTALLATION_PATH") -print("QEMU_INSTALLATION_PATH=$QEMU_INSTALLATION_PATH") -if (QEMU_INSTALLATION_PATH == "") { - # Do not assert false, building for targets of non-host type would fail at gn - # step if assert false. - print("You may not set up environment for qemu which is used for running" + - " executables of non-host type. Or some environment variable is named" + - " differently. Get set-up steps from" + - " https://gitee.com/ark_standalone_build/docs if you need to run" + - " executables of non-host type.") - QEMU_INSTALLATION_PATH = "/" -} diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni deleted file mode 100644 index effba924bb58361d2692125246431d8470e0e749..0000000000000000000000000000000000000000 --- a/build/config/sanitizers/sanitizers.gni +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -declare_args() { - is_asan = false - - is_ubsan_vptr = false - - is_safestack = false - - use_cfi_diag = false - - use_libfuzzer = false - - is_ubsan_security = false - - using_sanitizer = false - - use_sanitizer_coverage = false - - use_fuzzing_engine = false -} diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni deleted file mode 100644 index a6520ff392515a3a387ac04a6f6fac51ba65f27e..0000000000000000000000000000000000000000 --- a/build/config/sysroot.gni +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sysroot = "" -if (is_ohos) { - import("$build_root/config/ohos/config.gni") - sysroot = "${musl_sysroot}" -} else if (is_android) { - import("$build_root/config/aosp/config.gni") - sysroot = "$aosp_ndk_root/sysroot" -} else if (is_mac) { - import("$build_root/config/mac/mac_sdk.gni") - sysroot = mac_sdk_path -} - -link_sysroot = sysroot -if (is_android) { - if (current_cpu == "arm64") { - link_sysroot = "$aosp_ndk_root/$arm64_aosp_sysroot_subdir" - } else { - assert(false, "No aosp link sysroot for cpu: $current_cpu") - } -} diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn deleted file mode 100644 index 8281cdfa44e2361ed14744c02514e8b6c79c7ecf..0000000000000000000000000000000000000000 --- a/build/core/gn/BUILD.gn +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//arkcompiler/toolchain/toolchain.gni") -import("$build_root/config/components/ets_frontend/ets_frontend_config.gni") - -print("root_out_dir=$root_out_dir") -print("root_build_dir=$root_build_dir") -print("root_gen_dir=$root_gen_dir") -print("default_toolchain=$default_toolchain") -print("current_toolchain=$current_toolchain") -print("host_toolchain=$host_toolchain") -print("current_os=$current_os, current_cpu=$current_cpu") -print("host_os=$host_os, host_cpu=$host_cpu") -print("target_os=$target_os, target_cpu=$target_cpu") - -print() - -group("default") { - deps = [ - ":ets_frontend", - ":ets_runtime", - ":runtime_core", - ":toolchain", - ] -} - -group("unittest_packages") { - testonly = true - deps = [ "$toolchain_root:ark_js_host_unittest" ] -} - -group("runtime_core_unittest_packages") { - testonly = true - deps = [ "$toolchain_root:runtime_core_host_ut" ] -} - -group("ets_runtime") { - deps = [ - "$js_root:js_type_metadata", - "$js_root:libark_jsruntime", - "$js_root/ecmascript/dfx/hprof:ark_js_heap_snapshot_tool", - "$js_root/ecmascript/dfx/hprof/rawheap_translate:rawheap_translator", - "$js_root/ecmascript/js_vm:ark_js_vm", - "$js_root/ecmascript/quick_fix:quick_fix", - ] - if ((target_os == "linux" && target_cpu == "x64") || - (target_cpu == "arm64" && target_os == "ohos") || - (target_cpu == "arm64" && target_os == "mac")) { - deps += [ - "$js_root/ecmascript/compiler:ark_aot_compiler", - "$js_root/ecmascript/compiler:ark_stub_compiler", - "$js_root/ecmascript/compiler:libark_jsoptimizer", - "$js_root/ecmascript/compiler:stub.an", - "$js_root/ecmascript/pgo_profiler/prof_dump:profdump", - ] - } -} - -group("ets_frontend") { - if ((target_os == "linux" && target_cpu == "x64") || target_os == "mingw" || - target_os == "mac") { - deps = [ - "$ets_frontend_root/es2panda:es2panda", - "$ets_frontend_root/merge_abc:merge_abc", - ] - } -} - -group("runtime_core") { - deps = [ - "$ark_root:ark_host_defectscanaux_tools", - "$ark_root/disassembler:ark_disasm", - ] -} - -group("static_core") { - deps = [ - "$ark_root/static_core/assembler:libarktsassembler", - "$ark_root/static_core/compiler:libarktscompiler", - "$ark_root/static_core/libpandabase:libarktsbase", - "$ark_root/static_core/libpandafile:libarktsfile", - ] -} - -group("toolchain") { - deps = [] - if (target_cpu != "mipsel") { - deps += [ - "$toolchain_root/inspector:ark_debugger", - "$toolchain_root/inspector:connectserver_debugger", - "$toolchain_root/tooling:libark_ecma_debugger", - ] - } - if (target_os != "mingw") { - deps += [ - "$toolchain_root/tooling/client:libark_client", - "$toolchain_root/tooling/client/ark_cli:arkdb", - "$toolchain_root/tooling/client/ark_multi:ark_multi", - ] - } -} diff --git a/build/misc/mac/check_return_value.py b/build/misc/mac/check_return_value.py deleted file mode 100755 index db4e96ee5f9ca5e347fc5d32c7de30b018c2e1d8..0000000000000000000000000000000000000000 --- a/build/misc/mac/check_return_value.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This program wraps an arbitrary command and prints "1" if the command ran -successfully. -""" - -import os -import subprocess -import sys - -with open(os.devnull, 'wb') as devnull: - if not subprocess.call(sys.argv[1:], stdout=devnull, stderr=devnull): - print(1) - else: - print(0) diff --git a/build/misc/mac/find_sdk.py b/build/misc/mac/find_sdk.py deleted file mode 100755 index 1923cddbcdb77b251cc748ab8cc5106cbe078ccb..0000000000000000000000000000000000000000 --- a/build/misc/mac/find_sdk.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Prints the lowest locally available SDK version greater than or equal to a -given minimum sdk version to standard output. If --developer_dir is passed, then -the script will use the Xcode toolchain located at DEVELOPER_DIR. - -Usage: - python find_sdk.py [--developer_dir DEVELOPER_DIR] 10.6 # Ignores SDKs < 10.6 -""" - -import os -import re -import subprocess -import sys - -from optparse import OptionParser - - -class SdkError(Exception): - def __init__(self, value): - self.value = value - - def __str__(self): - return repr(self.value) - - -def parse_version(version_str): - """'10.6' => [10, 6]""" - return map(int, re.findall(r'(\d+)', version_str)) - - -def main(): - parser = OptionParser() - parser.add_option("--verify", - action="store_true", dest="verify", default=False, - help="return the sdk argument and warn if it doesn't exist") - parser.add_option("--sdk_path", - action="store", type="string", dest="sdk_path", - default="", - help="user-specified SDK path; bypasses verification") - parser.add_option("--print_sdk_path", - action="store_true", dest="print_sdk_path", default=False, - help="Additionally print the path the SDK (appears first).") - parser.add_option("--developer_dir", help='Path to Xcode.') - options, args = parser.parse_args() - if len(args) != 1: - parser.error('Please specify a minimum SDK version') - min_sdk_version = args[0] - - if options.developer_dir: - os.environ['DEVELOPER_DIR'] = options.developer_dir - - job = subprocess.Popen(['xcode-select', '-print-path'], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - out, err = job.communicate() - if job.returncode != 0: - print(out, file=sys.stderr) - print(err, file=sys.stderr) - raise Exception('Error %d running xcode-select' % job.returncode) - sdk_dir = os.path.join( - str(out.rstrip(), encoding="utf-8"), - 'Platforms/MacOSX.platform/Developer/SDKs') - - file_path = os.path.relpath("/path/to/Xcode.app") - if not os.path.isdir(sdk_dir) or not '.app/Contents/Developer' in sdk_dir: - raise SdkError('Install Xcode, launch it, accept the license ' + - 'agreement, and run `sudo xcode-select -s %s` ' % file_path + - 'to continue.') - sdks = [re.findall('^MacOSX(1[0,1,2,3,4,5,6,7,8]\.\d+)\.sdk$', s) for s in - os.listdir(sdk_dir)] - sdks = [s[0] for s in sdks if s] # [['10.5'], ['10.6']] => ['10.5', '10.6'] - sdks = [s for s in sdks # ['10.5', '10.6'] => ['10.6'] - if list(parse_version(s)) >= list(parse_version(min_sdk_version))] - - if not sdks: - raise Exception('No %s+ SDK found' % min_sdk_version) - best_sdk = sorted(sdks)[0] - - if options.verify and best_sdk != min_sdk_version and not options.sdk_path: - print('', file=sys.stderr) - print(' vvvvvvv', - file=sys.stderr) - print('', file=sys.stderr) - print( - 'This build requires the %s SDK, but it was not found on your system.' \ - % min_sdk_version, file=sys.stderr) - print( - 'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.', - file=sys.stderr) - print('', file=sys.stderr) - print(' ^^^^^^^', - file=sys.stderr) - print('', file=sys.stderr) - sys.exit(1) - - if options.print_sdk_path: - _sdk_path = subprocess.check_output( - ['xcrun', '-sdk', 'macosx' + best_sdk, '--show-sdk-path']).strip() - if isinstance(_sdk_path, bytes): - _sdk_path = _sdk_path.decode() - print(_sdk_path) - return best_sdk - - -if __name__ == '__main__': - if sys.platform != 'darwin': - raise Exception("This script only runs on Mac") - print(main()) - sys.exit(0) diff --git a/build/misc/overrides/build.gni b/build/misc/overrides/build.gni deleted file mode 100644 index 7d6e3c1ccddc292b5a7aa1c25a123d9df5790eb4..0000000000000000000000000000000000000000 --- a/build/misc/overrides/build.gni +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -enable_java_templates = true - -linux_use_bundled_binutils_override = true - -# Skip assertions about 4GiB file size limit. -ignore_elf32_limitations = true - -# Use the system install of Xcode for tools like ibtool, libtool, etc. -use_system_xcode = true diff --git a/build/prebuilts_download/prebuilts_download.py b/build/prebuilts_download/prebuilts_download.py deleted file mode 100755 index 74815dfd6b1a46db2580591a76818393a5138135..0000000000000000000000000000000000000000 --- a/build/prebuilts_download/prebuilts_download.py +++ /dev/null @@ -1,246 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import sys -import argparse -import subprocess -import tarfile -import zipfile -import ssl -import shutil -from multiprocessing import cpu_count -from concurrent.futures import ThreadPoolExecutor, as_completed -from functools import partial -from urllib.request import urlopen -import urllib.error -from rich.progress import ( - BarColumn, - DownloadColumn, - Progress, - TaskID, - TextColumn, - TimeRemainingColumn, - TransferSpeedColumn, -) -from util import read_json_file - -progress = Progress( - TextColumn("[bold blue]{task.fields[filename]}", justify="right"), - BarColumn(bar_width=None), - "[progress.percentage]{task.percentage:>3.1f}%", - "•", - DownloadColumn(), - "•", - TransferSpeedColumn(), - "•", - TimeRemainingColumn(), -) - -def _run_cmd(cmd): - res = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - sout, serr = res.communicate() - return sout.rstrip().decode('utf-8'), serr, res.returncode - -def _check_sha256(check_url, local_file): - check_sha256_cmd = ''.join(['curl -s -k ', check_url, '.sha256']) - local_sha256_cmd = ''.join(['sha256sum ', local_file, "|cut -d ' ' -f1"]) - check_sha256, err, returncode = _run_cmd(check_sha256_cmd) - local_sha256, err, returncode = _run_cmd(local_sha256_cmd) - return check_sha256 == local_sha256 - -def _check_sha256_by_mark(args, check_url, code_dir, unzip_dir, unzip_filename): - check_sha256_cmd = ''.join(['curl -s -k ', check_url, '.sha256']) - check_sha256, err, returncode = _run_cmd(check_sha256_cmd) - mark_file_dir = os.path.join(code_dir, unzip_dir) - mark_file_name = ''.join([check_sha256, '.', unzip_filename, '.mark']) - mark_file_path = os.path.join(mark_file_dir, mark_file_name) - args.mark_file_path = mark_file_path - return os.path.exists(mark_file_path) - -def _config_parse(config, tool_repo): - unzip_dir = config.get('unzip_dir') - huaweicloud_url = ''.join([tool_repo, config.get('file_path')]) - unzip_filename = config.get('unzip_filename') - md5_huaweicloud_url_cmd = ''.join(['echo ', huaweicloud_url, "|md5sum|cut -d ' ' -f1"]) - md5_huaweicloud_url, err, returncode = _run_cmd(md5_huaweicloud_url_cmd) - bin_file = os.path.basename(huaweicloud_url) - return unzip_dir, huaweicloud_url, unzip_filename, md5_huaweicloud_url, bin_file - -def _uncompress(args, src_file, code_dir, unzip_dir, unzip_filename, mark_file_path): - dest_dir = os.path.join(code_dir, unzip_dir) - if src_file[-3:] == 'zip': - cmd = 'unzip -o {} -d {};echo 0 > {}'.format(src_file, dest_dir, mark_file_path) - elif src_file[-6:] == 'tar.gz': - cmd = 'tar -xvzf {} -C {};echo 0 > {}'.format(src_file, dest_dir, mark_file_path) - else: - cmd = 'tar -xvf {} -C {};echo 0 > {}'.format(src_file, dest_dir, mark_file_path) - _, _, returncode = _run_cmd(cmd) - return returncode - -def _copy_url(args, task_id, url, local_file, code_dir, unzip_dir, unzip_filename, mark_file_path): - # download files - download_buffer_size = 32768 - progress.console.log('Requesting {}'.format(url)) - flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL - modes = 0o777 - try: - response = urlopen(url) - except urllib.error.HTTPError as e: - progress.console.log("Failed to open {}, HTTPError: {}".format(url, e.code), style='red') - return 1 - progress.update(task_id, total=int(response.info()["Content-length"])) - with os.fdopen(os.open(local_file, flags, modes), 'wb') as dest_file: - progress.start_task(task_id) - for data in iter(partial(response.read, download_buffer_size), b""): - dest_file.write(data) - progress.update(task_id, advance=len(data)) - progress.console.log("Downloaded {}".format(local_file)) - if not _check_sha256(url, local_file): - progress.console.log('{}, Sha256 check download FAILED.'.format(local_file), style='red') - return 1 - - # decompressing files - progress.console.log("Decompressing {}".format(local_file)) - returncode = _uncompress(args, local_file, code_dir, unzip_dir, unzip_filename, mark_file_path) - progress.console.log("Decompressed {}".format(local_file)) - return returncode - - -def _hwcloud_download_wrapper(args, config, bin_dir, code_dir, retries): - attempt = 0 - success = False - with progress: - while not success and attempt < retries: - success = _hwcloud_download(args, config, bin_dir, code_dir, retries) - attempt += 1 - return success - - -def _hwcloud_download(args, config, bin_dir, code_dir, retries): - try: - cnt = cpu_count() - except: - cnt = 1 - - success = False - with ThreadPoolExecutor(max_workers=cnt) as pool: - tasks = dict() - for config_info in config: - unzip_dir, huaweicloud_url, unzip_filename, md5_huaweicloud_url, bin_file = _config_parse(config_info, - args.tool_repo) - abs_unzip_dir = os.path.join(code_dir, unzip_dir) - if not os.path.exists(abs_unzip_dir): - os.makedirs(abs_unzip_dir) - if _check_sha256_by_mark(args, huaweicloud_url, code_dir, unzip_dir, unzip_filename): - progress.console.log('{}, Sha256 markword check OK.'.format(huaweicloud_url), style='green') - continue - - _run_cmd(''.join(['rm -rf ', code_dir, '/', unzip_dir, '/*.', unzip_filename, '.mark'])) - _run_cmd(''.join(['rm -rf ', code_dir, '/', unzip_dir, '/', unzip_filename])) - local_file = os.path.join(bin_dir, ''.join([md5_huaweicloud_url, '.', bin_file])) - - if os.path.exists(local_file) and not _check_sha256(huaweicloud_url, local_file): - os.remove(local_file) - - if not os.path.exists(local_file): - filename = huaweicloud_url.split("/")[-1] - task_id = progress.add_task("download", filename=filename, start=False) - task = pool.submit(_copy_url, args, task_id, huaweicloud_url, local_file, code_dir, unzip_dir, - unzip_filename, args.mark_file_path) - tasks[task] = os.path.basename(huaweicloud_url) - continue - - if _check_sha256(huaweicloud_url, local_file): - progress.console.log('{}, Sha256 check download OK.'.format(local_file), style='green') - task = pool.submit(_uncompress, args, local_file, code_dir, unzip_dir, unzip_filename, - args.mark_file_path) - tasks[task] = os.path.basename(huaweicloud_url) - else: - os.remove(local_file) - returncode = 0 - for task in as_completed(tasks): - if task.result(): - returncode += task.result() - progress.console.log('{}, download and decompress completed, exit code: {}' - .format(tasks.get(task), task.result()), style='green') - success = returncode == 0 - return success - - -def _file_handle(config, code_dir): - for config_info in config: - src_dir = ''.join([code_dir, config_info.get('src')]) - dest_dir = ''.join([code_dir, config_info.get('dest')]) - tmp_dir = config_info.get('tmp') - symlink_src = config_info.get('symlink_src') - symlink_dest = config_info.get('symlink_dest') - if os.path.exists(src_dir): - if tmp_dir: - tmp_dir = ''.join([code_dir, tmp_dir]) - shutil.move(src_dir, tmp_dir) - cmd = 'mv {}/*.mark {}'.format(dest_dir, tmp_dir) - _run_cmd(cmd) - if os.path.exists(dest_dir): - shutil.rmtree(dest_dir) - shutil.move(tmp_dir, dest_dir) - elif symlink_src and symlink_dest: - if os.path.exists(dest_dir) and dest_dir != src_dir: - shutil.rmtree(dest_dir) - shutil.move(src_dir, dest_dir) - os.symlink(''.join([dest_dir, symlink_src]), ''.join([dest_dir, symlink_dest])) - else: - _run_cmd('chmod 755 {} -R'.format(dest_dir)) - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--skip-ssl', action='store_true', help='skip ssl authentication') - parser.add_argument('--tool-repo', default='https://repo.huaweicloud.com', help='prebuilt file download source') - parser.add_argument('--host-cpu', help='host cpu', required=True) - parser.add_argument('--host-platform', help='host platform', required=True) - args = parser.parse_args() - args.code_dir = os.path.abspath(os.path.join(os.getcwd())) - if args.skip_ssl: - ssl._create_default_https_context = ssl._create_unverified_context - - host_platform = args.host_platform - host_cpu = args.host_cpu - tool_repo = args.tool_repo - config_file = os.path.join(args.code_dir, - 'arkcompiler/toolchain/build/prebuilts_download/prebuilts_download_config.json') - config_info = read_json_file(config_file) - file_handle_config = config_info.get('file_handle_config') - - args.bin_dir = os.path.join(args.code_dir, config_info.get('prebuilts_download_dir')) - if not os.path.exists(args.bin_dir): - os.makedirs(args.bin_dir) - copy_config = config_info.get(host_platform).get(host_cpu).get('copy_config') - if host_platform == 'linux': - linux_copy_config = config_info.get(host_platform).get(host_cpu).get('linux_copy_config') - copy_config.extend(linux_copy_config) - elif host_platform == 'darwin': - darwin_copy_config = config_info.get(host_platform).get(host_cpu).get('darwin_copy_config') - copy_config.extend(darwin_copy_config) - retries = config_info.get('retries') - args.retries = 1 if retries is None else retries - if not _hwcloud_download_wrapper(args, copy_config, args.bin_dir, args.code_dir, args.retries): - return 1 - _file_handle(file_handle_config, args.code_dir) - return 0 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/prebuilts_download/prebuilts_download.sh b/build/prebuilts_download/prebuilts_download.sh deleted file mode 100755 index 3d0844f91d04e3e95eaaad813ff2d0ef0c2b1944..0000000000000000000000000000000000000000 --- a/build/prebuilts_download/prebuilts_download.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -e -while [ $# -gt 0 ]; do - case "$1" in - -skip-ssl|--skip-ssl) # wget skip ssl check, which will allow - # hacker to get and modify data stream between server and client! - SKIP_SSL=YES - ;; - -h|--help) - HELP=YES - ;; - --tool-repo) - TOOL_REPO="$2" - shift - ;; - --tool-repo=*) - TOOL_REPO="${1#--tool-repo=}" - ;; - --trusted-host) - TRUSTED_HOST="$2" - shift - ;; - --trusted-host=*) - TRUSTED_HOST="${1#--trusted-host=}" - ;; - --pypi-url) # python package index url - PYPI_URL="$2" - shift - ;; - --pypi-url=*) - PYPI_URL="${1#--pypi-url=}" - ;; - *) - echo "$0: Warning: unsupported parameter: $1" >&2 - ;; - esac - shift -done - -case $(uname -s) in - Linux) - - host_platform=linux - ;; - Darwin) - host_platform=darwin - ;; - *) - echo "Unsupported host platform: $(uname -s)" - exit 1 -esac - -case $(uname -m) in - arm64) - - host_cpu=arm64 - ;; - *) - host_cpu=x86_64 -esac - -if [ "X${SKIP_SSL}" == "XYES" ];then - wget_ssl_check="--skip-ssl" -else - wget_ssl_check='' -fi - -if [ "X${HELP}" == "XYES" ];then - help="-h" -else - help='' -fi - -if [ ! -z "$TOOL_REPO" ];then - tool_repo="--tool-repo $TOOL_REPO" -else - tool_repo='' -fi - -if [ ! -z "$TRUSTED_HOST" ];then - trusted_host=$TRUSTED_HOST -elif [ ! -z "$PYPI_URL" ];then - trusted_host=${PYPI_URL/#*:\/\//} # remove prefix part such as http:// https:// etc. - trusted_host=${trusted_host/%[:\/]*/} # remove suffix part including the port number -else - trusted_host='repo.huaweicloud.com' -fi - -if [ ! -z "$PYPI_URL" ];then - pypi_url=$PYPI_URL -else - pypi_url='http://repo.huaweicloud.com/repository/pypi/simple' -fi - -cpu="--host-cpu $host_cpu" -platform="--host-platform $host_platform" - -script_path=$(cd $(dirname $0);pwd) -code_dir=$(dirname ${script_path}) -pip3 install --trusted-host $trusted_host -i $pypi_url rich -echo "prebuilts_download start" -python3 "arkcompiler/toolchain/build/prebuilts_download/prebuilts_download.py" $wget_ssl_check $tool_repo $help $cpu $platform -echo "prebuilts_download end" - -echo -e "\n" diff --git a/build/prebuilts_download/prebuilts_download_config.json b/build/prebuilts_download/prebuilts_download_config.json deleted file mode 100644 index c2091efa76d4f61fc60f775729985b599e0963eb..0000000000000000000000000000000000000000 --- a/build/prebuilts_download/prebuilts_download_config.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "prebuilts_download_dir": "../openharmony_prebuilts", - "retries": 3, - "file_handle_config": [ - { - "src": "/prebuilts/clang/ohos/linux-x86_64/clang_linux-x86_64-ef68e8-20240229", - "dest": "/prebuilts/clang/ohos/linux-x86_64/llvm", - "rename": "true", - "symlink_src": "/lib/clang/15.0.4", - "symlink_dest": "/lib/clang/current" - }, - { - "src": "/prebuilts/clang/ohos/darwin-arm64/clang_darwin-arm64-ef68e8-20240229", - "dest": "/prebuilts/clang/ohos/darwin-arm64/llvm", - "rename": "true", - "symlink_src": "/lib/clang/15.0.4", - "symlink_dest": "/lib/clang/current" - } - ], - "linux": { - "x86_64": { - "copy_config": [ - { - "unzip_dir": "prebuilts/build-tools/linux-x86/bin", - "file_path": "/openharmony/compiler/gn/20240219/gn-linux-x86-20240219.tar.gz", - "unzip_filename": "gn" - }, - { - "unzip_dir": "prebuilts/build-tools/linux-x86/bin", - "file_path": "/openharmony/compiler/ninja/1.11.0/linux/ninja-linux-x86-1.11.0.tar.gz", - "unzip_filename": "ninja" - }, - { - "unzip_dir": "prebuilts/ark_tools", - "file_path": "/openharmony/compiler/llvm_prebuilt_libs/ark_js_prebuilts_20230713.tar.gz", - "unzip_filename": "ark_js_prebuilts" - } - ], - "linux_copy_config": [ - { - "unzip_dir": "prebuilts/mingw-w64/ohos/linux-x86_64", - "file_path": "/openharmony/compiler/mingw-w64/11.0.1/clang-mingw-20240510.tar.gz", - "unzip_filename": "clang-mingw" - }, - { - "unzip_dir": "prebuilts/clang/ohos/linux-x86_64", - "file_path": "/openharmony/compiler/clang/15.0.4-ef68e8/linux/clang_linux-x86_64-ef68e8-20240229.tar.gz", - "unzip_filename": "llvm" - } - ] - }, - "aarch64": { - "copy_config": [ - { - "unzip_dir": "prebuilts/build-tools/linux-aarch64/bin", - "unzip_filename": "gn" - }, - { - "unzip_dir": "prebuilts/build-tools/linux-aarch64/bin", - "unzip_filename": "ninja" - }, - { - "unzip_dir": "prebuilts/ark_tools", - "unzip_filename": "ark_js_prebuilts" - } - ], - "linux_copy_config": [ - { - "unzip_dir": "prebuilts/clang/ohos/linux-aarch64", - "unzip_filename": "llvm" - } - ] - } - }, - "darwin": { - "arm64": { - "copy_config": [ - { - "unzip_dir": "prebuilts/build-tools/darwin-arm64/bin", - "file_path": "/openharmony/compiler/gn/2024/darwin/gn-darwin-x86-20230425.tar.gz", - "unzip_filename": "gn" - }, - { - "unzip_dir": "prebuilts/build-tools/darwin-arm64/bin", - "file_path": "/openharmony/compiler/ninja/1.11.0/darwin/ninja-darwin-x86-1.11.0.tar.gz", - "unzip_filename": "ninja" - }, - { - "unzip_dir": "prebuilts/ark_tools", - "file_path": "/openharmony/compiler/llvm_prebuilt_libs/ark_js_prebuilts_darwin_arm64_20230209.tar.gz", - "unzip_filename": "ark_js_prebuilts" - } - ], - "darwin_copy_config": [ - { - "unzip_dir": "prebuilts/clang/ohos/darwin-arm64", - "file_path": "/openharmony/compiler/clang/15.0.4-ef68e8/darwin_arm64/clang_darwin-arm64-ef68e8-20240229.tar.gz", - "unzip_filename": "llvm" - }, - { - "unzip_dir": "prebuilts/clang/ohos/darwin-arm64", - "file_path": "/openharmony/compiler/clang/15.0.4-ef68e8/darwin_arm64/libcxx-ndk_darwin-arm64-ef68e8-20240229.tar.gz", - "unzip_filename": "libcxx-ndk" - } - ] - } - } -} diff --git a/build/prebuilts_download/util.py b/build/prebuilts_download/util.py deleted file mode 100755 index f1152e1f468535b6a7a28d86c75f68a8e18d90ad..0000000000000000000000000000000000000000 --- a/build/prebuilts_download/util.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import json -import os -import subprocess -import hashlib - - -# Read json file data -def read_json_file(input_file): - if not os.path.exists(input_file): - print("file '{}' doesn't exist.".format(input_file)) - return None - - data = None - try: - with open(input_file, 'r') as input_f: - data = json.load(input_f) - except json.decoder.JSONDecodeError: - print("The file '{}' format is incorrect.".format(input_file)) - raise - except: # noqa E722 - print("read file '{}' failed.".format(input_file)) - raise - return data - - -# Read file by line -def read_file(input_file): - if not os.path.exists(input_file): - print("file '{}' doesn't exist.".format(input_file)) - return None - - data = [] - try: - with open(input_file, 'r') as file_obj: - for line in file_obj.readlines(): - data.append(line.rstrip('\n')) - except: # noqa E722 - print("read file '{}' failed".format(input_file)) - raise - return data - - -# Write json file data -def write_json_file(output_file, content, check_changes=False): - file_dir = os.path.dirname(os.path.abspath(output_file)) - flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL - modes = stat.S_IWUSR | stat.S_IRUSR - if not os.path.exists(file_dir): - os.makedirs(file_dir, exist_ok=True) - - if check_changes is True: - changed = __check_changes(output_file, content) - else: - changed = True - if changed is True: - with os.fdopen(os.open(output_file, flags, modes), 'w') as output_f: - json.dump(content, output_f, sort_keys=True, indent=2) - - -def __check_changes(output_file, content): - if os.path.exists(output_file) and os.path.isfile(output_file): - # file content md5 val - sha256_obj = hashlib.sha256() - sha256_obj.update(str(read_json_file(output_file)).encode()) - hash_value = sha256_obj.hexdigest() - # new content md5 val - sha256_obj_new = hashlib.sha256() - sha256_obj_new.update(str(content).encode()) - hash_value_new = sha256_obj_new.hexdigest() - if hash_value_new == hash_value: - return False - return True - - -# Write file data -def write_file(output_file, content): - file_dir = os.path.dirname(os.path.abspath(output_file)) - flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL - modes = stat.S_IWUSR | stat.S_IRUSR - if not os.path.exists(file_dir): - os.makedirs(file_dir, exist_ok=True) - - with os.fdopen(os.open(output_file, flags, modes), 'w') as output_f: - output_f.write(content) - if output_file.endswith('.gni') or output_file.endswith('.gn'): - # Call gn format to make the output gn file prettier. - cmd = ['gn', 'format'] - cmd.append(output_file) - subprocess.check_output(cmd) diff --git a/build/scripts/check_mac_system_and_cpu.py b/build/scripts/check_mac_system_and_cpu.py deleted file mode 100755 index 49f8413b0131ad29f1acc379ea38d7101c279a04..0000000000000000000000000000000000000000 --- a/build/scripts/check_mac_system_and_cpu.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import sys -import subprocess - - -def run_cmd(cmd): - res = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - sout, serr = res.communicate() - - return res.pid, res.returncode, sout, serr - - -def check_darwin_system(): - check_system_cmd = "uname -s" - res = run_cmd(check_system_cmd) - if res[1] == 0 and res[2] != "": - if "Darwin" in res[2].strip().decode(): - print("system is darwin") - - return 0 - - -def check_m1_cpu(): - check_host_cpu_cmd = "sysctl machdep.cpu.brand_string" - res = run_cmd(check_host_cpu_cmd) - if res[1] == 0 and res[2] != "": - host_cpu = res[2].strip().decode().split("brand_string:")[-1] - if "M1" in host_cpu: - print("host cpu is m1") - elif "M2" in host_cpu: - print("host cpu is m2") - elif "M3" in host_cpu: - print("host_cpu is m3") - elif "M4" in host_cpu: - print("host_cpu is m4") - - return 0 - - -def main(): - if sys.argv[1] == "cpu": - check_m1_cpu() - elif sys.argv[1] == "system": - check_darwin_system() - else: - return 0 - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/scripts/generate_js_bytecode.py b/build/scripts/generate_js_bytecode.py deleted file mode 100755 index ea7ae832e2b999ca3405d5c2cd0c3611b7b1c381..0000000000000000000000000000000000000000 --- a/build/scripts/generate_js_bytecode.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python3 -# coding: utf-8 - -""" -Copyright (c) 2021 Huawei Device Co., Ltd. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Description: Generate javascript byte code using es2abc -""" - -import os -import subprocess -import platform -import argparse - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--src-js', - help='js source file') - parser.add_argument('--dst-file', - help='the converted target file') - parser.add_argument('--frontend-tool-path', - help='path of the frontend conversion tool') - parser.add_argument('--extension', - help='source file extension') - parser.add_argument("--debug", action='store_true', - help='whether add debuginfo') - parser.add_argument("--module", action='store_true', - help='whether is module') - parser.add_argument("--commonjs", action='store_true', - help='whether is commonjs') - parser.add_argument("--merge-abc", action='store_true', - help='whether is merge abc') - parser.add_argument("--generate-patch", action='store_true', - help='generate patch abc') - parser.add_argument("--dump-symbol-table", - help='dump symbol table of base abc') - parser.add_argument("--input-symbol-table", - help='input symbol table for patch abc') - parser.add_argument("--target-api-sub-version", - help='input symbol table for patch abc') - parser.add_argument("--module-record-field-name", - help='specify the field name of module record in unmerged abc. This argument is optional, ' + - 'its value will be the path of input file if not specified') - parser.add_argument("--source-file", - help='specify the file path info recorded in generated abc. This argument is optional, ' + - 'its value will be the path of input file if not specified') - parser.add_argument("--enable-annotations", action='store_true', - help='whether annotations are enabled or not') - arguments = parser.parse_args() - return arguments - - -def run_command(cmd, execution_path): - print(" ".join(cmd) + " | execution_path: " + execution_path) - proc = subprocess.Popen(cmd, cwd=execution_path) - proc.wait() - if proc.returncode != 0: - raise subprocess.CalledProcessError(proc.returncode, cmd) - - -def gen_abc_info(input_arguments): - frontend_tool_path = input_arguments.frontend_tool_path - - (path, name) = os.path.split(frontend_tool_path) - - cmd = [os.path.join("./", name, "es2abc"), - '--output', input_arguments.dst_file, - input_arguments.src_js] - - if input_arguments.extension: - cmd += ['--extension', input_arguments.extension] - if input_arguments.dump_symbol_table: - cmd += ['--dump-symbol-table', input_arguments.dump_symbol_table] - if input_arguments.input_symbol_table: - cmd += ['--input-symbol-table', input_arguments.input_symbol_table] - if input_arguments.debug: - src_index = cmd.index(input_arguments.src_js) - cmd.insert(src_index, '--debug-info') - if input_arguments.module: - src_index = cmd.index(input_arguments.src_js) - cmd.insert(src_index, '--module') - if input_arguments.commonjs: - src_index = cmd.index(input_arguments.src_js) - cmd.insert(src_index, '--commonjs') - if input_arguments.merge_abc: - src_index = cmd.index(input_arguments.src_js) - cmd.insert(src_index, '--merge-abc') - if input_arguments.generate_patch: - src_index = cmd.index(input_arguments.src_js) - cmd.insert(src_index, '--generate-patch') - if input_arguments.module_record_field_name: - cmd += ["--module-record-field-name", input_arguments.module_record_field_name] - if input_arguments.source_file: - cmd += ["--source-file", input_arguments.source_file] - if input_arguments.enable_annotations: - src_index = cmd.index(input_arguments.src_js) - cmd.insert(src_index, '--enable-annotations') - # insert d.ts option to cmd later - cmd.append("--target-api-sub-version=beta3") - - try: - run_command(cmd, path) - except subprocess.CalledProcessError as e: - exit(e.returncode) - - -if __name__ == '__main__': - gen_abc_info(parse_args()) - diff --git a/build/templates/cxx/cxx.gni b/build/templates/cxx/cxx.gni deleted file mode 100755 index 00e3393901968a975822879fd5635cca26127230..0000000000000000000000000000000000000000 --- a/build/templates/cxx/cxx.gni +++ /dev/null @@ -1,398 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/ark_var.gni") - -template("ohos_executable") { - if (defined(invoker.subsystem_name) && defined(invoker.part_name)) { - subsystem_name = invoker.subsystem_name - part_name = invoker.part_name - } else if (defined(invoker.subsystem_name)) { - subsystem_name = invoker.subsystem_name - part_name = subsystem_name - } else { - subsystem_name = "arkcompiler" - part_name = "common" - } - assert(part_name != "") - assert(subsystem_name != "") - - if (defined(invoker.unit_test) && invoker.unit_test) { - output_dir = invoker.test_output_dir - } else { - output_dir = "${root_out_dir}/${subsystem_name}/${part_name}" - } - - executable(target_name) { - forward_variables_from(invoker, - "*", - [ - "configs", - "remove_configs", - "subsystem_name", - "install_enable", - "part_name", - "use_exceptions", - "static_link", - "output_dir", - "unit_test", - "external_deps", - "stack_protector_ret", - "use_rtti", - ]) - output_dir = output_dir - if (defined(invoker.configs)) { - configs += invoker.configs - } - - if (defined(invoker.remove_configs)) { - configs -= invoker.remove_configs - } - - if (defined(invoker.use_exceptions) && invoker.use_exceptions) { - configs += [ "//arkcompiler/toolchain/build/config/compiler:exceptions" ] - ldflags = [] - } - if (defined(invoker.use_rtti) && invoker.use_rtti) { - configs += [ "//arkcompiler/toolchain/build/config/compiler:rtti" ] - } - if (!defined(libs)) { - libs = [] - } - if (!defined(ldflags)) { - ldflags = [] - } - if (!defined(inputs)) { - inputs = [] - } - - if (defined(version_script)) { - _version_script = rebase_path(version_script, root_build_dir) - inputs += [ version_script ] - ldflags += [ "-Wl,--version-script=${_version_script}" ] - } - - if (defined(invoker.static_link) && invoker.static_link) { - no_default_deps = true - ldflags += [ "-static" ] - configs -= [ "$build_root/config:executable_config" ] - if (is_ohos) { - import("$build_root/config/ohos/musl.gni") - deps += [ "$build_root/third_party_gn/musl:soft_static_libs" ] - } - } else if (is_ohos) { - if (current_cpu == "arm" || current_cpu == "arm64") { - libs += [ "unwind" ] - } - libs += [ "c++" ] - } - - if (defined(invoker.external_deps) && invoker.external_deps != []) { - if (!defined(deps)) { - deps = [] - } - - external_deps_temp_file = - "$target_gen_dir/${part_name}__${target_name}_external_deps_temp.json" - arguments = [ - "--root-src-dir", - rebase_path("//", root_build_dir), - "--external-deps-temp-file", - rebase_path(external_deps_temp_file, root_build_dir), - "--external-deps", - ] - arguments += invoker.external_deps - exec_script("$build_root/templates/cxx/external_deps_handler.py", - arguments, - "string") - external_deps_info = read_file(external_deps_temp_file, "json") - if (defined(external_deps_info.deps)) { - deps += external_deps_info.deps - } - } - } -} - -template("ohos_static_library") { - if (defined(invoker.subsystem_name) && defined(invoker.part_name)) { - part_name = invoker.part_name - } else if (defined(invoker.part_name)) { - part_name = invoker.part_name - } else if (defined(invoker.subsystem_name)) { - part_name = invoker.subsystem_name - } else { - part_name = "common" - } - assert(part_name != "") - - static_library(target_name) { - forward_variables_from(invoker, - "*", - [ - "configs", - "remove_configs", - "subsystem_name", - "part_name", - "use_exceptions", - "external_deps", - "stack_protector_ret", - "use_rtti", - ]) - if (defined(invoker.configs)) { - configs += invoker.configs - } - - if (defined(invoker.remove_configs)) { - configs -= invoker.remove_configs - } - - if (defined(invoker.use_exceptions) && invoker.use_exceptions) { - configs += [ "//arkcompiler/toolchain/build/config/compiler:exceptions" ] - ldflags = [] - } - - if (defined(invoker.use_rtti) && invoker.use_rtti) { - configs += [ "//arkcompiler/toolchain/build/config/compiler:rtti" ] - } - if (!defined(libs)) { - libs = [] - } - if (!defined(include_dirs)) { - include_dirs = [] - } - - if (defined(invoker.external_deps) && invoker.external_deps != []) { - if (!defined(deps)) { - deps = [] - } - - external_deps_temp_file = - "$target_gen_dir/${part_name}__${target_name}_external_deps_temp.json" - arguments = [ - "--root-src-dir", - rebase_path("//", root_build_dir), - "--external-deps-temp-file", - rebase_path(external_deps_temp_file, root_build_dir), - "--external-deps", - ] - arguments += invoker.external_deps - exec_script("$build_root/templates/cxx/external_deps_handler.py", - arguments, - "string") - external_deps_info = read_file(external_deps_temp_file, "json") - if (defined(external_deps_info.deps)) { - deps += external_deps_info.deps - } - } - } -} - -template("ohos_shared_library") { - if (defined(invoker.subsystem_name) && defined(invoker.part_name)) { - subsystem_name = invoker.subsystem_name - part_name = invoker.part_name - } else if (defined(invoker.subsystem_name)) { - subsystem_name = invoker.subsystem_name - part_name = subsystem_name - } else { - subsystem_name = "arkcompiler" - part_name = "common" - } - output_dir = "${root_out_dir}/${subsystem_name}/${part_name}" - shared_library(target_name) { - forward_variables_from(invoker, - "*", - [ - "relative_install_dir", - "configs", - "subsystem_name", - "install_enable", - "part_name", - "output_dir", - "install_images", - "use_exceptions", - "external_deps", - "stack_protector_ret", - "innerapi_tags", - "use_rtti", - ]) - output_dir = output_dir - if (defined(invoker.configs)) { - configs += invoker.configs - } - if (defined(invoker.remove_configs)) { - configs -= invoker.remove_configs - } - - if (!defined(libs)) { - libs = [] - } - if (!defined(ldflags)) { - ldflags = [] - } - if (!defined(inputs)) { - inputs = [] - } - if (defined(invoker.use_rtti) && invoker.use_rtti) { - configs += [ "//arkcompiler/toolchain/build/config/compiler:rtti" ] - } - - if (defined(version_script)) { - _version_script = rebase_path(version_script, root_build_dir) - inputs += [ version_script ] - ldflags += [ "-Wl,--version-script=${_version_script}" ] - } - - if (is_ohos) { - if (defined(invoker.stl)) { - cflags_cc += [ - "-nostdinc++", - "-I" + rebase_path( - "//prebuilts/clang/ohos/${host_platform_dir}/llvm_ndk/include/c++/v1", - root_build_dir), - ] - ldflags += [ - "-nostdlib++", - "-L" + rebase_path("${clang_stl_path}/${abi_target}/c++", - root_build_dir), - ] - libs += [ invoker.stl ] - } else { - if (current_cpu == "arm" || current_cpu == "arm64") { - libs += [ "unwind" ] - } - libs += [ "c++" ] - } - } - - if (defined(invoker.external_deps) && invoker.external_deps != []) { - if (!defined(deps)) { - deps = [] - } - - external_deps_temp_file = - "$target_gen_dir/${part_name}__${target_name}_external_deps_temp.json" - arguments = [ - "--root-src-dir", - rebase_path("//", root_build_dir), - "--external-deps-temp-file", - rebase_path(external_deps_temp_file, root_build_dir), - "--external-deps", - ] - arguments += invoker.external_deps - exec_script("$build_root/templates/cxx/external_deps_handler.py", - arguments, - "string") - external_deps_info = read_file(external_deps_temp_file, "json") - if (defined(external_deps_info.deps)) { - deps += external_deps_info.deps - } - } - } -} - -template("ohos_source_set") { - if (defined(invoker.subsystem_name) && defined(invoker.part_name)) { - subsystem_name = invoker.subsystem_name - part_name = invoker.part_name - } else if (defined(invoker.subsystem_name)) { - subsystem_name = invoker.subsystem_name - part_name = subsystem_name - } else { - subsystem_name = "arkcompiler" - part_name = "common" - } - assert(subsystem_name != "") - assert(part_name != "") - - source_set(target_name) { - forward_variables_from(invoker, - "*", - [ - "configs", - "remove_configs", - "no_default_deps", - "external_deps", - "license_file", - "license_as_sources", - "use_exceptions", - "subsystem_name", - "part_name", - "stack_protector_ret", - "use_rtti", - ]) - if (defined(invoker.configs)) { - configs += invoker.configs - } - if (defined(invoker.use_rtti) && invoker.use_rtti) { - configs += [ "//arkcompiler/toolchain/build/config/compiler:rtti" ] - } - if (defined(invoker.remove_configs)) { - configs -= invoker.remove_configs - } - if (defined(invoker.external_deps) && invoker.external_deps != []) { - if (!defined(deps)) { - deps = [] - } - external_deps_temp_file = - "$target_gen_dir/${part_name}__${target_name}_external_deps_temp.json" - arguments = [ - "--root-src-dir", - rebase_path("//", root_build_dir), - "--external-deps-temp-file", - rebase_path(external_deps_temp_file, root_build_dir), - "--external-deps", - ] - arguments += invoker.external_deps - exec_script("$build_root/templates/cxx/external_deps_handler.py", - arguments, - "string") - external_deps_info = read_file(external_deps_temp_file, "json") - if (defined(external_deps_info.deps)) { - deps += external_deps_info.deps - } - } - } -} - -template("ohos_copy") { - assert(defined(invoker.sources), - "sources must be defined for ${target_name}.") - assert(defined(invoker.outputs), - "outputs must be defined for ${target_name}.") - if (defined(invoker.subsystem_name) && defined(invoker.part_name)) { - copy_subsystem_name = invoker.subsystem_name - copy_part_name = invoker.part_name - } else if (defined(invoker.subsystem_name)) { - copy_subsystem_name = invoker.subsystem_name - copy_part_name = copy_subsystem_name - } else { - copy_subsystem_name = "common" - copy_part_name = copy_subsystem_name - } - assert(copy_subsystem_name != "") - assert(copy_part_name != "") - - copy(target_name) { - forward_variables_from(invoker, - "*", - [ - "relative_install_dir", - "module_source_dir", - "module_install_name", - "license_file", - "install_enable", - "module_type", - ]) - } -} diff --git a/build/templates/cxx/external_deps_handler.py b/build/templates/cxx/external_deps_handler.py deleted file mode 100755 index 6577eae412e82b24e3c19ddb805c5935f8824279..0000000000000000000000000000000000000000 --- a/build/templates/cxx/external_deps_handler.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import argparse -import hashlib -import json -import os -import sys - - -def __check_changes(output_file, content): - if os.path.exists(output_file) and os.path.isfile(output_file): - # file content md5 val - sha256_obj = hashlib.sha256() - sha256_obj.update(str(read_json_file(output_file)).encode()) - hash_value = sha256_obj.hexdigest() - # new content md5 val - sha256_obj_new = hashlib.sha256() - sha256_obj_new.update(str(content).encode()) - hash_value_new = sha256_obj_new.hexdigest() - if hash_value_new == hash_value: - return False - return True - - -# Read json file data -def read_json_file(input_file): - if not os.path.exists(input_file): - print("file '{}' doesn't exist.".format(input_file)) - return None - - data = None - try: - with open(input_file, 'r') as input_f: - data = json.load(input_f) - except json.decoder.JSONDecodeError: - print("The file '{}' format is incorrect.".format(input_file)) - raise - return data - - -# Write json file data -def write_json_file(output_file, content, check_changes=False): - file_dir = os.path.dirname(os.path.abspath(output_file)) - if not os.path.exists(file_dir): - os.makedirs(file_dir, exist_ok=True) - - if check_changes is True: - changed = __check_changes(output_file, content) - else: - changed = True - if changed is True: - with open(output_file, 'w') as output_f: - json.dump(content, output_f, sort_keys=True, indent=2) - - -def get_full_path_from_target_name(config_info, target_name) -> str: - inner_kits = config_info["component"]["build"]["inner_kits"] - for inner_kit in inner_kits: - inner_kit_parts = inner_kit["name"].split(":") - if inner_kit_parts[1].startswith(target_name): - return inner_kit["name"] - print("Attemp to get a target({}) which is not in the component's inner_kits!".format(target_name)) - sys.exit(1) - return "" - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--root-src-dir", required=True) - parser.add_argument("--external-deps-temp-file", required=True) - parser.add_argument("--external-deps", nargs='+', required=True) - args = parser.parse_args() - - deps = [] - for dep in args.external_deps: - if dep.startswith("ets_runtime"): - config_info = read_json_file("{}arkcompiler/ets_runtime/bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("runtime_core"): - config_info = read_json_file("{}arkcompiler/runtime_core/bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("ets_frontend"): - config_info = read_json_file("{}arkcompiler/ets_frontend/bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("toolchain"): - config_info = read_json_file("{}arkcompiler/toolchain/bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("libuv"): - config_info = read_json_file("{}arkcompiler/toolchain/build/" \ - "third_party_gn/libuv/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("bounds_checking_function"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "bounds_checking_function/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("icu"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "icu/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("cJSON"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "cJSON/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("openssl"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "openssl/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("zlib"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "zlib/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("json"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "json/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - elif dep.startswith("protobuf"): - config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ - "protobuf/dummy_bundle.json".format(args.root_src_dir)) - target_name = dep.split(":")[1] - deps.append(get_full_path_from_target_name(config_info, target_name)) - else: - print("Component in which the external_dep defined is ommited in the logic of {}!".format(__file__)) - sys.exit(1) - return - - result = {} - if deps: - result['deps'] = deps - write_json_file(args.external_deps_temp_file, result) - return 0 - - -if __name__ == "__main__": - main() diff --git a/build/templates/cxx/prebuilt.gni b/build/templates/cxx/prebuilt.gni deleted file mode 100644 index 8b102fdc44d3f905425597f876d56deb0ad7e3dd..0000000000000000000000000000000000000000 --- a/build/templates/cxx/prebuilt.gni +++ /dev/null @@ -1,242 +0,0 @@ -# Copyright (C) 2021-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/templates/cxx/cxx.gni") - -template("ohos_prebuilt_executable") { - assert(defined(invoker.source), "source must be defined for ${target_name}.") - - if (defined(invoker.output)) { - _copy_output = "${target_out_dir}/${invoker.output}" - } else { - _copy_output = "${target_out_dir}/${invoker.source}" - } - - if (!defined(invoker.deps)) { - invoker.deps = [] - } - - if (!defined(invoker.stable)) { - invoker.stable = false - } - - deps_info = [] - foreach(dep, invoker.deps) { - info = { - } - info = { - target_out_dir = - rebase_path(get_label_info(dep, "target_out_dir"), root_build_dir) - target_name = get_label_info(dep, "name") - } - deps_info += [ info ] - } - module_label = get_label_info(":${target_name}", "label_with_toolchain") - target_deps_data = { - label = module_label - module_deps_info = deps_info - type = "executable" - prebuilt = true - stable = invoker.stable - toolchain = get_label_info(":${target_name}", "toolchain") - source_path = rebase_path(invoker.source, root_build_dir) - output_path = rebase_path(_copy_output, root_build_dir) - } - write_file("${target_out_dir}/${target_name}_deps_data.json", - target_deps_data, - "json") - - ohos_copy(target_name) { - forward_variables_from(invoker, - [ - "testonly", - "visibility", - - "deps", - "public_configs", - "subsystem_name", - "part_name", - - # For generate_module_info - "install_images", - "module_install_dir", - "relative_install_dir", - "symlink_target_name", - - # Open source license related - "license_file", - "license_as_sources", - ]) - sources = [ invoker.source ] - outputs = [ _copy_output ] - } -} - -template("ohos_prebuilt_shared_library") { - assert(defined(invoker.source), "source must be defined for ${target_name}.") - - if (defined(invoker.output)) { - _copy_output = "${target_out_dir}/${invoker.output}" - } else { - _copy_output = "${target_out_dir}/${invoker.source}" - } - config("${target_name}__config") { - libs = [ _copy_output ] - } - - if (!defined(invoker.deps)) { - invoker.deps = [] - } - - if (!defined(invoker.stable)) { - invoker.stable = false - } - - deps_info = [] - foreach(dep, invoker.deps) { - info = { - } - info = { - target_out_dir = - rebase_path(get_label_info(dep, "target_out_dir"), root_build_dir) - target_name = get_label_info(dep, "name") - } - deps_info += [ info ] - } - module_label = get_label_info(":${target_name}", "label_with_toolchain") - target_deps_data = { - label = module_label - module_deps_info = deps_info - type = "shared_library" - prebuilt = true - stable = invoker.stable - toolchain = get_label_info(":${target_name}", "toolchain") - source_path = rebase_path(invoker.source, root_build_dir) - output_path = rebase_path(_copy_output, root_build_dir) - } - write_file("${target_out_dir}/${target_name}_deps_data.json", - target_deps_data, - "json") - - ohos_copy(target_name) { - forward_variables_from(invoker, - [ - "testonly", - "visibility", - - "deps", - "public_configs", - "subsystem_name", - "part_name", - - # For generate_module_info - "install_images", - "module_install_dir", - "relative_install_dir", - "symlink_target_name", - - # Open source license related - "license_file", - "license_as_sources", - ]) - sources = [ invoker.source ] - outputs = [ _copy_output ] - if (!defined(public_configs)) { - public_configs = [] - } - public_configs += [ ":${target_name}__config" ] - } -} - -template("ohos_prebuilt_static_library") { - assert(defined(invoker.source), "source must be defined for ${target_name}.") - - if (defined(invoker.output)) { - _copy_output = "${target_out_dir}/${invoker.output}" - } else { - _copy_output = "${target_out_dir}/${invoker.source}" - } - config("${target_name}__config") { - libs = [ _copy_output ] - } - - ohos_copy(target_name) { - forward_variables_from(invoker, - [ - "testonly", - "visibility", - - "deps", - "public_configs", - "subsystem_name", - "part_name", - - # Open source license related - "license_file", - "license_as_sources", - ]) - sources = [ invoker.source ] - outputs = [ _copy_output ] - if (!defined(public_configs)) { - public_configs = [] - } - public_configs += [ ":${target_name}__config" ] - } -} - -template("ohos_prebuilt_etc") { - assert(defined(invoker.source), "source must be defined for ${target_name}.") - - if (defined(invoker.output)) { - _copy_output = "${target_out_dir}/${invoker.output}" - } else { - _copy_output = "${target_out_dir}/${invoker.source}" - } - - module_label = get_label_info(":${target_name}", "label_with_toolchain") - target_deps_data = { - label = module_label - type = "etc" - prebuilt = true - source_path = rebase_path(invoker.source, root_build_dir) - output_path = rebase_path(_copy_output, root_build_dir) - } - write_file("${target_out_dir}/${target_name}_deps_data.json", - target_deps_data, - "json") - - ohos_copy(target_name) { - forward_variables_from(invoker, - [ - "testonly", - "visibility", - - "deps", - "public_configs", - "subsystem_name", - "part_name", - - # For generate_module_info - "install_images", - "module_install_dir", - "relative_install_dir", - "symlink_target_name", - - # Open source license related - "license_file", - "license_as_sources", - ]) - sources = [ invoker.source ] - outputs = [ _copy_output ] - } -} diff --git a/build/test.gni b/build/test.gni deleted file mode 100644 index 85e6055279894f4e1fb50c3094ffd82ad478b89f..0000000000000000000000000000000000000000 --- a/build/test.gni +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/clang/clang.gni") -import("$build_root/templates/cxx/cxx.gni") - -# ohos test template -template("_ohos_test") { - assert(defined(invoker.test_type), "test_type is required.") - assert(defined(invoker.module_out_path)) - - _deps = [] - if (defined(invoker.deps)) { - _deps += invoker.deps - } - - test_output_dir = - "$root_out_dir/tests/${invoker.test_type}/${invoker.module_out_path}" - - # copy fuzz config file - if (defined(invoker.fuzz_config_file)) { - fuzz_config_file = invoker.fuzz_config_file - script = "//build/ohos/testfwk/fuzz_config_file_copy.py" - _arguments = [] - _arguments += [ - "--fuzz-config-file-path", - rebase_path(fuzz_config_file, root_build_dir), - "--fuzz-config-file-output-path", - rebase_path(root_out_dir + "/tests/res", root_build_dir), - ] - exec_script(script, _arguments) - } - - _has_sources = defined(invoker.sources) && invoker.sources != [] - if (_has_sources) { - _c_sources_file = "$target_gen_dir/$target_name.sources" - write_file(_c_sources_file, rebase_path(invoker.sources, root_build_dir)) - } - - ohos_executable(target_name) { - forward_variables_from(invoker, - "*", - [ - "test_type", - "module_out_path", - "visibility", - "resource_config_file", - ]) - forward_variables_from(invoker, [ "visibility" ]) - - subsystem_name = "tests" - part_name = invoker.test_type - testonly = true - unit_test = true - output_name = "$target_name" - } -} - -template("ohos_unittest") { - _ohos_test(target_name) { - forward_variables_from(invoker, "*") - test_type = "unittest" - deps = [] - if (defined(invoker.deps)) { - deps += invoker.deps - } - - # Add static link library judgment logic below - - if (defined(invoker.rtti_compile_flag) && invoker.rtti_compile_flag) { - deps += [ "//arkcompiler/toolchain/build/third_party_gn/googletest:gtest_rtti_main" ] - } else { - deps += [ - "//arkcompiler/toolchain/build/third_party_gn/googletest:gtest_main", - ] - } - } -} diff --git a/build/third_party_gn/bounds_checking_function/BUILD.gn b/build/third_party_gn/bounds_checking_function/BUILD.gn deleted file mode 100644 index 24013d17b359367f79ee4ec39308a9376702325b..0000000000000000000000000000000000000000 --- a/build/third_party_gn/bounds_checking_function/BUILD.gn +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//third_party/bounds_checking_function/libsec_src.gni") -import("$build_root/ark.gni") - -config("libsec_public_config") { - include_dirs = [ "//third_party/bounds_checking_function/include" ] -} - -ohos_static_library("libsec_static") { - stack_protector_ret = false - sources = libsec_sources - public_configs = [ ":libsec_public_config" ] - cflags = [ - "-D_INC_STRING_S", - "-D_INC_WCHAR_S", - "-D_SECIMP=//", - "-D_STDIO_S_DEFINED", - "-D_INC_STDIO_S", - "-D_INC_STDLIB_S", - "-D_INC_MEMORY_S", - ] -} - -SEC_SHARED_SUBSYS_NAME = "thirdparty" -SEC_SHARED_PART_NAME = "bounds_checking_function" - -ohos_shared_library("libsec_shared") { - stack_protector_ret = false - sources = libsec_sources - public_configs = [ ":libsec_public_config" ] - cflags = [ - "-D_INC_STRING_S", - "-D_INC_WCHAR_S", - "-D_SECIMP=//", - "-D_STDIO_S_DEFINED", - "-D_INC_STDIO_S", - "-D_INC_STDLIB_S", - "-D_INC_MEMORY_S", - ] - - part_name = "${SEC_SHARED_PART_NAME}" - subsystem_name = "${SEC_SHARED_SUBSYS_NAME}" - install_images = [ - "system", - "updater", - ] -} -if (is_ohos && run_with_qemu) { - copy("libsec_shared_for_qemu") { - deps = [ ":libsec_shared" ] - - sources = [ "${root_out_dir}/${SEC_SHARED_SUBSYS_NAME}/${SEC_SHARED_PART_NAME}/libsec_shared.so" ] - outputs = [ "${root_out_dir}/${so_dir_for_qemu}/lib/libsec_shared.so" ] - } -} diff --git a/build/third_party_gn/bounds_checking_function/dummy_bundle.json b/build/third_party_gn/bounds_checking_function/dummy_bundle.json deleted file mode 100644 index 93976ab86e12ace85f3d44d6518d20e7096f1a6e..0000000000000000000000000000000000000000 --- a/build/third_party_gn/bounds_checking_function/dummy_bundle.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "name": "//arkcompiler/toolchain/build/third_party_gn/bounds_checking_function:libsec_shared", - "header": { - "header_files": [ - "securec.h", - "securectype.h" - ], - "header_base": "//third_party/bounds_checking_function/include" - } - }, - { - "name": "//arkcompiler/toolchain/build/third_party_gn/bounds_checking_function:libsec_static", - "header": { - "header_files": [ - "securec.h", - "securectype.h" - ], - "header_base": "//third_party/bounds_checking_function/include" - } - } - ] - } - } -} \ No newline at end of file diff --git a/build/third_party_gn/cJSON/BUILD.gn b/build/third_party_gn/cJSON/BUILD.gn deleted file mode 100644 index 8d37da1d172a8ff66ef9c9ecec1960887ed52966..0000000000000000000000000000000000000000 --- a/build/third_party_gn/cJSON/BUILD.gn +++ /dev/null @@ -1,36 +0,0 @@ -#Copyright (c) 2019-2021 Huawei Device Co., Ltd. -#Licensed under the Apache License, Version 2.0 (the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. - -import("$build_root/ark.gni") -config("cJSON_config") { - include_dirs = [ "//third_party/cJSON" ] - defines = [ "CJSON_NESTING_LIMIT=(128)" ] -} -ohos_static_library("cjson_static") { - stack_protector_ret = false - sources = [ "//third_party/cJSON/cJSON.c" ] - public_configs = [ ":cJSON_config" ] - part_name = "cJSON" - subsystem_name = "thirdparty" -} -ohos_shared_library("cjson") { - stack_protector_ret = false - deps = [ ":cjson_static" ] - public_configs = [ ":cJSON_config" ] - part_name = "cJSON" - subsystem_name = "thirdparty" - install_images = [ - "system", - "updater", - ] -} diff --git a/build/third_party_gn/cJSON/dummy_bundle.json b/build/third_party_gn/cJSON/dummy_bundle.json deleted file mode 100644 index 6474ed7d2e3fd55726bdab1e1265f4c9538d7a7b..0000000000000000000000000000000000000000 --- a/build/third_party_gn/cJSON/dummy_bundle.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "name": "//arkcompiler/toolchain/build/third_party_gn/cJSON:cjson" - }, - { - "name": "//arkcompiler/toolchain/build/third_party_gn/cJSON:cjson_static" - } - ] - } - } -} \ No newline at end of file diff --git a/build/third_party_gn/googletest/BUILD.gn b/build/third_party_gn/googletest/BUILD.gn deleted file mode 100644 index af3d901136d449a6eefd2559fde3571f0f1b0ac4..0000000000000000000000000000000000000000 --- a/build/third_party_gn/googletest/BUILD.gn +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -googletest_dir = "//third_party/googletest/googletest" -googlemock_dir = "//third_party/googletest/googlemock" - -config("gtest_private_config") { - visibility = [ ":*" ] - include_dirs = [ "$googletest_dir" ] -} - -config("gtest_private_config_rtti") { - visibility = [ ":*" ] - include_dirs = [ "$googletest_dir" ] - cflags = [ "-frtti" ] - cflags_objcc = [ "-frtti" ] - cflags_cc = [ "-frtti" ] -} - -config("gtest_config") { - include_dirs = [ "$googletest_dir/include" ] - cflags_cc = [ - "-std=c++17", - "-Wno-float-equal", - "-Wno-sign-compare", - "-Wno-reorder-init-list", - ] - if (is_mingw) { - cflags_cc += [ - "-Wno-unused-const-variable", - "-Wno-unused-private-field", - ] - } -} - -sources_files = [ - "$googletest_dir/include/gtest/gtest-death-test.h", - "$googletest_dir/include/gtest/gtest-matchers.h", - "$googletest_dir/include/gtest/gtest-message.h", - "$googletest_dir/include/gtest/gtest-param-test.h", - "$googletest_dir/include/gtest/gtest-printers.h", - "$googletest_dir/include/gtest/gtest-test-part.h", - "$googletest_dir/include/gtest/gtest-typed-test.h", - "$googletest_dir/include/gtest/gtest_pred_impl.h", - "$googletest_dir/include/gtest/gtest_prod.h", - "$googletest_dir/include/gtest/hwext/gtest-ext.h", - "$googletest_dir/include/gtest/hwext/gtest-filter.h", - "$googletest_dir/include/gtest/hwext/gtest-multithread.h", - "$googletest_dir/include/gtest/hwext/gtest-tag.h", - "$googletest_dir/include/gtest/hwext/utils.h", - "$googletest_dir/include/gtest/internal/custom/gtest-port.h", - "$googletest_dir/include/gtest/internal/custom/gtest-printers.h", - "$googletest_dir/include/gtest/internal/custom/gtest.h", - "$googletest_dir/include/gtest/internal/gtest-death-test-internal.h", - "$googletest_dir/include/gtest/internal/gtest-filepath.h", - "$googletest_dir/include/gtest/internal/gtest-internal.h", - "$googletest_dir/include/gtest/internal/gtest-param-util.h", - "$googletest_dir/include/gtest/internal/gtest-port-arch.h", - "$googletest_dir/include/gtest/internal/gtest-port.h", - "$googletest_dir/include/gtest/internal/gtest-string.h", - "$googletest_dir/include/gtest/internal/gtest-type-util.h", - "$googletest_dir/src/gtest-all.cc", - "$googletest_dir/src/gtest-assertion-result.cc", - "$googletest_dir/src/gtest-death-test.cc", - "$googletest_dir/src/gtest-filepath.cc", - "$googletest_dir/src/gtest-internal-inl.h", - "$googletest_dir/src/gtest-matchers.cc", - "$googletest_dir/src/gtest-port.cc", - "$googletest_dir/src/gtest-printers.cc", - "$googletest_dir/src/gtest-test-part.cc", - "$googletest_dir/src/gtest-typed-test.cc", - "$googletest_dir/src/gtest.cc", - "$googletest_dir/src/hwext/gtest-ext.cc", - "$googletest_dir/src/hwext/gtest-filter.cc", - "$googletest_dir/src/hwext/gtest-multithread.cpp", - "$googletest_dir/src/hwext/gtest-tag.cc", - "$googletest_dir/src/hwext/gtest-utils.cc", -] - -static_library("gtest") { - testonly = true - public = [ - "$googletest_dir/include/gtest/gtest-spi.h", - "$googletest_dir/include/gtest/gtest.h", - ] - sources = sources_files - sources -= [ "$googletest_dir/src/gtest-all.cc" ] - public_configs = [ ":gtest_config" ] - configs += [ ":gtest_private_config" ] -} - -static_library("gtest_rtti") { - testonly = true - public = [ - "$googletest_dir/include/gtest/gtest-spi.h", - "$googletest_dir/include/gtest/gtest.h", - ] - sources = sources_files - sources -= [ "$googletest_dir/src/gtest-all.cc" ] - public_configs = [ ":gtest_config" ] - configs += [ ":gtest_private_config_rtti" ] -} - -static_library("gtest_rtti_main") { # ADD - testonly = true - sources = [ "$googletest_dir/src/gtest_main.cc" ] - public_deps = [ ":gtest_rtti" ] -} - -static_library("gtest_main") { - testonly = true - sources = [ "$googletest_dir/src/gtest_main.cc" ] - public_deps = [ ":gtest" ] -} - -config("gmock_private_config") { - visibility = [ ":*" ] - include_dirs = [ "$googlemock_dir" ] -} - -config("gmock_private_config_rtti") { - visibility = [ ":*" ] - include_dirs = [ "googlemock_dir/include" ] - cflags = [ "-frtti" ] - cflags_objcc = [ "-frtti" ] - cflags_cc = [ "-frtti" ] -} - -config("gmock_config") { - include_dirs = [ "$googlemock_dir/include" ] - - cflags_cc = [ - # The MOCK_METHODn() macros do not specify "override", which triggers this - # warning in users: "error: 'Method' overrides a member function but is not - # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress - # these warnings until https://github.com/google/googletest/issues/533 is - # fixed. - "-Wno-inconsistent-missing-override", - ] -} - -gmock_sources_files = [ - "$googlemock_dir/include/gmock/gmock-actions.h", - "$googlemock_dir/include/gmock/gmock-cardinalities.h", - "$googlemock_dir/include/gmock/gmock-function-mocker.h", - "$googlemock_dir/include/gmock/gmock-matchers.h", - "$googlemock_dir/include/gmock/gmock-more-actions.h", - "$googlemock_dir/include/gmock/gmock-more-matchers.h", - "$googlemock_dir/include/gmock/gmock-nice-strict.h", - "$googlemock_dir/include/gmock/gmock-spec-builders.h", - "$googlemock_dir/include/gmock/internal/custom/gmock-generated-actions.h", - "$googlemock_dir/include/gmock/internal/custom/gmock-matchers.h", - "$googlemock_dir/include/gmock/internal/custom/gmock-port.h", - "$googlemock_dir/include/gmock/internal/gmock-internal-utils.h", - "$googlemock_dir/include/gmock/internal/gmock-port.h", - "$googlemock_dir/include/gmock/internal/gmock-pp.h", - "$googlemock_dir/src/gmock-all.cc", - "$googlemock_dir/src/gmock-cardinalities.cc", - "$googlemock_dir/src/gmock-internal-utils.cc", - "$googlemock_dir/src/gmock-matchers.cc", - "$googlemock_dir/src/gmock-spec-builders.cc", - "$googlemock_dir/src/gmock.cc", -] - -static_library("gmock") { - testonly = true - public = [ "$googlemock_dir/include/gmock/gmock.h" ] - sources = gmock_sources_files - sources -= [ "$googlemock_dir/src/gmock-all.cc" ] - public_configs = [ ":gmock_config" ] - configs += [ ":gmock_private_config" ] - deps = [ ":gtest" ] -} - -static_library("gmock_rtti") { - testonly = true - public = [ "$googlemock_dir/include/gmock/gmock.h" ] - sources = gmock_sources_files - sources -= [ "$googlemock_dir/src/gmock-all.cc" ] - public_configs = [ ":gmock_config" ] - configs += [ ":gmock_private_config_rtti" ] - deps = [ ":gtest_rtti" ] -} - -static_library("gmock_main") { - testonly = true - sources = [ "$googlemock_dir/src/gmock_main.cc" ] - public_deps = [ - ":gmock", - ":gtest", - ] -} diff --git a/build/third_party_gn/icu/dummy_bundle.json b/build/third_party_gn/icu/dummy_bundle.json deleted file mode 100644 index e48bae5f7f2d9778bf60c25d6ad092d90fe4b07f..0000000000000000000000000000000000000000 --- a/build/third_party_gn/icu/dummy_bundle.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "name": "//arkcompiler/toolchain/build/third_party_gn/icu/icu4c:shared_icuuc", - "header": { - "header_files": [ - "bmpset.h", - "brkeng.h", - "bytesinkutil.h", - "capi_helper.h", - "charstr.h", - "charstrmap.h", - "cmemory.h", - "cpputils.h", - "cstr.h", - "cstring.h", - "cwchar.h", - "dictbe.h", - "dictionarydata.h", - "emojiprops.h", - "hash.h", - "icuplugimp.h", - "localefallback_data.h", - "localeprioritylist.h", - "localsvc.h", - "locbased.h", - "locdistance.h", - "loclikelysubtags.h", - "locmap.h", - "locutil.h", - "lsr.h", - "lstmbe.h", - "messageimpl.h", - "msvcres.h", - "mutex.h", - "norm2allmodes.h", - "norm2_nfc_data.h", - "normalizer2impl.h", - "patternprops.h", - "pluralmap.h", - "propname.h", - "propname_data.h", - "propsvec.h", - "punycode.h", - "putilimp.h", - "rbbidata.h", - "rbbinode.h", - "rbbirb.h", - "rbbirpt.h", - "rbbiscan.h", - "rbbisetb.h", - "rbbitblb.h", - "rbbi_cache.h", - "resource.h", - "restrace.h", - "ruleiter.h", - "serv.h", - "servloc.h", - "servnotf.h", - "sharedobject.h", - "sprpimpl.h", - "static_unicode_sets.h", - "uarrsort.h", - "uassert.h", - "ubidiimp.h", - "ubidi_props.h", - "ubidi_props_data.h", - "ubrkimpl.h", - "ucase.h", - "ucasemap_imp.h", - "ucase_props_data.h", - "uchar_props_data.h", - "ucln.h", - "ucln_cmn.h", - "ucln_imp.h", - "ucmndata.h", - "ucnvmbcs.h", - "ucnv_bld.h", - "ucnv_cnv.h", - "ucnv_ext.h", - "ucnv_imp.h", - "ucnv_io.h", - "ucol_data.h", - "ucol_swp.h", - "ucptrie_impl.h", - "ucurrimp.h", - "udatamem.h", - "udataswp.h", - "uelement.h", - "uenumimp.h", - "uhash.h", - "uinvchar.h", - "ulayout_props.h", - "ulist.h", - "ulocimp.h", - "umapfile.h", - "umutex.h", - "unifiedcache.h", - "uniquecharstr.h", - "unisetspan.h", - "unistrappender.h", - "unormimp.h", - "uposixdefs.h", - "uprops.h", - "uresdata.h", - "uresimp.h", - "ureslocs.h", - "usc_impl.h", - "uset_imp.h", - "ustrenum.h", - "ustrfmt.h", - "ustr_cnv.h", - "ustr_imp.h", - "util.h", - "utracimp.h", - "utrie.h", - "utrie2.h", - "utrie2_impl.h", - "utypeinfo.h", - "uvector.h", - "uvectr32.h", - "uvectr64.h", - "wintz.h", - "unicode/appendable.h", - "unicode/brkiter.h", - "unicode/bytestream.h", - "unicode/bytestrie.h", - "unicode/bytestriebuilder.h", - "unicode/caniter.h", - "unicode/casemap.h", - "unicode/char16ptr.h", - "unicode/chariter.h", - "unicode/dbbi.h", - "unicode/docmain.h", - "unicode/dtintrv.h", - "unicode/edits.h", - "unicode/enumset.h", - "unicode/errorcode.h", - "unicode/filteredbrk.h", - "unicode/icudataver.h", - "unicode/icuplug.h", - "unicode/idna.h", - "unicode/localebuilder.h", - "unicode/localematcher.h", - "unicode/localpointer.h", - "unicode/locdspnm.h", - "unicode/locid.h", - "unicode/messagepattern.h", - "unicode/normalizer2.h", - "unicode/normlzr.h", - "unicode/parseerr.h", - "unicode/parsepos.h", - "unicode/platform.h", - "unicode/ptypes.h", - "unicode/putil.h", - "unicode/rbbi.h", - "unicode/rep.h", - "unicode/resbund.h", - "unicode/schriter.h", - "unicode/simpleformatter.h", - "unicode/std_string.h", - "unicode/strenum.h", - "unicode/stringoptions.h", - "unicode/stringpiece.h", - "unicode/stringtriebuilder.h", - "unicode/symtable.h", - "unicode/ubidi.h", - "unicode/ubiditransform.h", - "unicode/ubrk.h", - "unicode/ucasemap.h", - "unicode/ucat.h", - "unicode/uchar.h", - "unicode/ucharstrie.h", - "unicode/ucharstriebuilder.h", - "unicode/uchriter.h", - "unicode/uclean.h", - "unicode/ucnv.h", - "unicode/ucnvsel.h", - "unicode/ucnv_cb.h", - "unicode/ucnv_err.h", - "unicode/uconfig.h", - "unicode/ucpmap.h", - "unicode/ucptrie.h", - "unicode/ucurr.h", - "unicode/udata.h", - "unicode/udisplaycontext.h", - "unicode/uenum.h", - "unicode/uidna.h", - "unicode/uiter.h", - "unicode/uldnames.h", - "unicode/uloc.h", - "unicode/umachine.h", - "unicode/umisc.h", - "unicode/umutablecptrie.h", - "unicode/unifilt.h", - "unicode/unifunct.h", - "unicode/unimatch.h", - "unicode/uniset.h", - "unicode/unistr.h", - "unicode/unorm.h", - "unicode/unorm2.h", - "unicode/uobject.h", - "unicode/urename.h", - "unicode/urep.h", - "unicode/ures.h", - "unicode/uscript.h", - "unicode/uset.h", - "unicode/usetiter.h", - "unicode/ushape.h", - "unicode/usprep.h", - "unicode/ustring.h", - "unicode/ustringtrie.h", - "unicode/utext.h", - "unicode/utf.h", - "unicode/utf16.h", - "unicode/utf32.h", - "unicode/utf8.h", - "unicode/utf_old.h", - "unicode/utrace.h", - "unicode/utypes.h", - "unicode/uvernum.h", - "unicode/uversion.h" - ], - "header_base": "//third_party/icu/icu4c/source/common" - } - }, - { - "name": "//arkcompiler/toolchain/build/third_party_gn/icu/icu4c:shared_icui18n", - "header": { - "header_files": [ - "anytrans.h", - "astro.h", - "bocsu.h", - "brktrans.h", - "buddhcal.h", - "casetrn.h", - "cecal.h", - "chnsecal.h", - "collation.h", - "collationbuilder.h", - "collationcompare.h", - "collationdata.h", - "collationdatabuilder.h", - "collationdatareader.h", - "collationdatawriter.h", - "collationfastlatin.h", - "collationfastlatinbuilder.h", - "collationfcd.h", - "collationiterator.h", - "collationkeys.h", - "collationroot.h", - "collationrootelements.h", - "collationruleparser.h", - "collationsets.h", - "collationsettings.h", - "collationtailoring.h", - "collationweights.h", - "collunsafe.h", - "coptccal.h", - "cpdtrans.h", - "csdetect.h", - "csmatch.h", - "csr2022.h", - "csrecog.h", - "csrmbcs.h", - "csrsbcs.h", - "csrucode.h", - "csrutf8.h", - "currfmt.h", - "dangical.h", - "dayperiodrules.h", - "decContext.h", - "decNumber.h", - "decNumberLocal.h", - "double-conversion-bignum-dtoa.h", - "double-conversion-bignum.h", - "double-conversion-cached-powers.h", - "double-conversion-diy-fp.h", - "double-conversion-double-to-string.h", - "double-conversion-fast-dtoa.h", - "double-conversion-ieee.h", - "double-conversion-string-to-double.h", - "double-conversion-strtod.h", - "double-conversion-utils.h", - "double-conversion.h", - "dtitv_impl.h", - "dtptngen_impl.h", - "dt_impl.h", - "erarules.h", - "esctrn.h", - "ethpccal.h", - "fmtableimp.h", - "formattedval_impl.h", - "formatted_string_builder.h", - "fphdlimp.h", - "funcrepl.h", - "gregoimp.h", - "hebrwcal.h", - "indiancal.h", - "inputext.h", - "islamcal.h", - "japancal.h", - "measunit_impl.h", - "msgfmt_impl.h", - "name2uni.h", - "nfrlist.h", - "nfrs.h", - "nfrule.h", - "nfsubs.h", - "nortrans.h", - "nultrans.h", - "number_affixutils.h", - "number_asformat.h", - "number_compact.h", - "number_currencysymbols.h", - "number_decimalquantity.h", - "number_decimfmtprops.h", - "number_decnum.h", - "number_formatimpl.h", - "number_longnames.h", - "number_mapper.h", - "number_microprops.h", - "number_modifiers.h", - "number_multiplier.h", - "number_patternmodifier.h", - "number_patternstring.h", - "number_roundingutils.h", - "number_scientific.h", - "number_skeletons.h", - "number_types.h", - "number_usageprefs.h", - "number_utils.h", - "number_utypes.h", - "numparse_affixes.h", - "numparse_compositions.h", - "numparse_currency.h", - "numparse_decimal.h", - "numparse_impl.h", - "numparse_scientific.h", - "numparse_symbols.h", - "numparse_types.h", - "numparse_utils.h", - "numparse_validators.h", - "numrange_impl.h", - "numsys_impl.h", - "olsontz.h", - "persncal.h", - "pluralranges.h", - "plurrule_impl.h", - "quant.h", - "quantityformatter.h", - "rbt.h", - "rbt_data.h", - "rbt_pars.h", - "rbt_rule.h", - "rbt_set.h", - "regexcmp.h", - "regexcst.h", - "regeximp.h", - "regexst.h", - "regextxt.h", - "region_impl.h", - "reldtfmt.h", - "remtrans.h", - "scriptset.h", - "selfmtimpl.h", - "sharedbreakiterator.h", - "sharedcalendar.h", - "shareddateformatsymbols.h", - "sharednumberformat.h", - "sharedpluralrules.h", - "smpdtfst.h", - "standardplural.h", - "string_segment.h", - "strmatch.h", - "strrepl.h", - "taiwncal.h", - "titletrn.h", - "tolowtrn.h", - "toupptrn.h", - "transreg.h", - "tridpars.h", - "tzgnames.h", - "tznames_impl.h", - "ucln_in.h", - "ucol_imp.h", - "uitercollationiterator.h", - "umsg_imp.h", - "unesctrn.h", - "uni2name.h", - "units_complexconverter.h", - "units_converter.h", - "units_data.h", - "units_router.h", - "uspoof_conf.h", - "uspoof_impl.h", - "usrchimp.h", - "utf16collationiterator.h", - "utf8collationiterator.h", - "vzone.h", - "windtfmt.h", - "winnmfmt.h", - "wintzimpl.h", - "zonemeta.h", - "zrule.h", - "ztrans.h", - "unicode/alphaindex.h", - "unicode/basictz.h", - "unicode/calendar.h", - "unicode/choicfmt.h", - "unicode/coleitr.h", - "unicode/coll.h", - "unicode/compactdecimalformat.h", - "unicode/curramt.h", - "unicode/currpinf.h", - "unicode/currunit.h", - "unicode/datefmt.h", - "unicode/dcfmtsym.h", - "unicode/decimfmt.h", - "unicode/displayoptions.h", - "unicode/dtfmtsym.h", - "unicode/dtitvfmt.h", - "unicode/dtitvinf.h", - "unicode/dtptngen.h", - "unicode/dtrule.h", - "unicode/fieldpos.h", - "unicode/fmtable.h", - "unicode/format.h", - "unicode/formattedvalue.h", - "unicode/fpositer.h", - "unicode/gender.h", - "unicode/gregocal.h", - "unicode/listformatter.h", - "unicode/measfmt.h", - "unicode/measunit.h", - "unicode/measure.h", - "unicode/msgfmt.h", - "unicode/nounit.h", - "unicode/numberformatter.h", - "unicode/numberrangeformatter.h", - "unicode/numfmt.h", - "unicode/numsys.h", - "unicode/plurfmt.h", - "unicode/plurrule.h", - "unicode/rbnf.h", - "unicode/rbtz.h", - "unicode/regex.h", - "unicode/region.h", - "unicode/reldatefmt.h", - "unicode/scientificnumberformatter.h", - "unicode/search.h", - "unicode/selfmt.h", - "unicode/simpletz.h", - "unicode/smpdtfmt.h", - "unicode/sortkey.h", - "unicode/stsearch.h", - "unicode/tblcoll.h", - "unicode/timezone.h", - "unicode/tmunit.h", - "unicode/tmutamt.h", - "unicode/tmutfmt.h", - "unicode/translit.h", - "unicode/tzfmt.h", - "unicode/tznames.h", - "unicode/tzrule.h", - "unicode/tztrans.h", - "unicode/ucal.h", - "unicode/ucol.h", - "unicode/ucoleitr.h", - "unicode/ucsdet.h", - "unicode/udat.h", - "unicode/udateintervalformat.h", - "unicode/udatpg.h", - "unicode/udisplayoptions.h", - "unicode/ufieldpositer.h", - "unicode/uformattable.h", - "unicode/uformattedvalue.h", - "unicode/ugender.h", - "unicode/ulistformatter.h", - "unicode/ulocdata.h", - "unicode/umsg.h", - "unicode/unirepl.h", - "unicode/unum.h", - "unicode/unumberformatter.h", - "unicode/unumberrangeformatter.h", - "unicode/unumsys.h", - "unicode/upluralrules.h", - "unicode/uregex.h", - "unicode/uregion.h", - "unicode/ureldatefmt.h", - "unicode/usearch.h", - "unicode/uspoof.h", - "unicode/utmscale.h", - "unicode/utrans.h", - "unicode/vtzone.h" - ], - "header_base": "//third_party/icu/icu4c/source/i18n" - } - } - ] - } - } -} \ No newline at end of file diff --git a/build/third_party_gn/icu/icu4c/BUILD.gn b/build/third_party_gn/icu/icu4c/BUILD.gn deleted file mode 100644 index 67d5a36aff5ae0f08a6358f4c6a7e1d678635678..0000000000000000000000000000000000000000 --- a/build/third_party_gn/icu/icu4c/BUILD.gn +++ /dev/null @@ -1,788 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if (ark_standalone_build) { - import("$build_root/ark.gni") -} else { - import("//build/ohos.gni") -} - -config("icu_config") { - include_dirs = [ - "//third_party/icu/icu4c/source/common", - "//third_party/icu/icu4c/source/i18n", - "//third_party/icu/icu4c/source", - ] -} - -config("static_icustubdata_all_deps_config") { - include_dirs = [ "//third_party/icu/icu4c/source/common" ] -} - -ohos_static_library("static_icustubdata") { - configs = [ - ":icu_config", - "$build_root/config/compiler:rtti", - ] - sources = [ "//third_party/icu/icu4c/source/stubdata/stubdata.cpp" ] - - cflags_cc = [ - "-O3", - "-W", - "-Wall", - "-pedantic", - "-Wpointer-arith", - "-Wwrite-strings", - "-std=c++11", - "-Wno-ignored-attributes", - "-Wno-deprecated-declarations", - ] - output_dir = "${root_out_dir}/third_party/icu/stubdata" - output_name = "stubdata" - part_name = "icu" - subsystem_name = "thirdparty" -} - -icu_common_source = [ - "//third_party/icu/icu4c/source/common/ubiditransform.cpp", - "//third_party/icu/icu4c/source/common/locutil.cpp", - "//third_party/icu/icu4c/source/common/cstring.cpp", - "//third_party/icu/icu4c/source/common/rbbiscan.cpp", - "//third_party/icu/icu4c/source/common/utrie.cpp", - "//third_party/icu/icu4c/source/common/cwchar.cpp", - "//third_party/icu/icu4c/source/common/bytestriebuilder.cpp", - "//third_party/icu/icu4c/source/common/umapfile.cpp", - "//third_party/icu/icu4c/source/common/uenum.cpp", - "//third_party/icu/icu4c/source/common/putil.cpp", - "//third_party/icu/icu4c/source/common/bytestrieiterator.cpp", - "//third_party/icu/icu4c/source/common/unifunct.cpp", - "//third_party/icu/icu4c/source/common/rbbistbl.cpp", - "//third_party/icu/icu4c/source/common/bytestrie.cpp", - "//third_party/icu/icu4c/source/common/ucptrie.cpp", - "//third_party/icu/icu4c/source/common/errorcode.cpp", - "//third_party/icu/icu4c/source/common/unames.cpp", - "//third_party/icu/icu4c/source/common/restrace.cpp", - "//third_party/icu/icu4c/source/common/util.cpp", - "//third_party/icu/icu4c/source/common/sharedobject.cpp", - "//third_party/icu/icu4c/source/common/bmpset.cpp", - "//third_party/icu/icu4c/source/common/servlk.cpp", - "//third_party/icu/icu4c/source/common/ustrcase_locale.cpp", - "//third_party/icu/icu4c/source/common/localeprioritylist.cpp", - "//third_party/icu/icu4c/source/common/ucnvbocu.cpp", - "//third_party/icu/icu4c/source/common/ucharstrieiterator.cpp", - "//third_party/icu/icu4c/source/common/unisetspan.cpp", - "//third_party/icu/icu4c/source/common/locavailable.cpp", - "//third_party/icu/icu4c/source/common/unistr.cpp", - "//third_party/icu/icu4c/source/common/ustr_wcs.cpp", - "//third_party/icu/icu4c/source/common/ucnv_err.cpp", - "//third_party/icu/icu4c/source/common/ucnv_lmb.cpp", - "//third_party/icu/icu4c/source/common/rbbidata.cpp", - "//third_party/icu/icu4c/source/common/uarrsort.cpp", - "//third_party/icu/icu4c/source/common/ucnv2022.cpp", - "//third_party/icu/icu4c/source/common/uresbund.cpp", - "//third_party/icu/icu4c/source/common/ucnvsel.cpp", - "//third_party/icu/icu4c/source/common/unistr_titlecase_brkiter.cpp", - "//third_party/icu/icu4c/source/common/loadednormalizer2impl.cpp", - "//third_party/icu/icu4c/source/common/ustring.cpp", - "//third_party/icu/icu4c/source/common/unifilt.cpp", - "//third_party/icu/icu4c/source/common/ubrk.cpp", - "//third_party/icu/icu4c/source/common/bytesinkutil.cpp", - "//third_party/icu/icu4c/source/common/localebuilder.cpp", - "//third_party/icu/icu4c/source/common/rbbi_cache.cpp", - "//third_party/icu/icu4c/source/common/ucnvhz.cpp", - "//third_party/icu/icu4c/source/common/uniset_closure.cpp", - "//third_party/icu/icu4c/source/common/uloc.cpp", - "//third_party/icu/icu4c/source/common/utypes.cpp", - "//third_party/icu/icu4c/source/common/ucnv_u16.cpp", - "//third_party/icu/icu4c/source/common/uniset_props.cpp", - "//third_party/icu/icu4c/source/common/locbased.cpp", - "//third_party/icu/icu4c/source/common/unistr_cnv.cpp", - "//third_party/icu/icu4c/source/common/ucnv_ct.cpp", - "//third_party/icu/icu4c/source/common/unormcmp.cpp", - "//third_party/icu/icu4c/source/common/wintz.cpp", - "//third_party/icu/icu4c/source/common/ruleiter.cpp", - "//third_party/icu/icu4c/source/common/utrie2.cpp", - "//third_party/icu/icu4c/source/common/locresdata.cpp", - "//third_party/icu/icu4c/source/common/ucnv_u8.cpp", - "//third_party/icu/icu4c/source/common/uscript_props.cpp", - "//third_party/icu/icu4c/source/common/locdspnm.cpp", - "//third_party/icu/icu4c/source/common/locid.cpp", - "//third_party/icu/icu4c/source/common/rbbitblb.cpp", - "//third_party/icu/icu4c/source/common/icudataver.cpp", - "//third_party/icu/icu4c/source/common/ubidi.cpp", - "//third_party/icu/icu4c/source/common/brkiter.cpp", - "//third_party/icu/icu4c/source/common/uvectr32.cpp", - "//third_party/icu/icu4c/source/common/usc_impl.cpp", - "//third_party/icu/icu4c/source/common/normlzr.cpp", - "//third_party/icu/icu4c/source/common/icuplug.cpp", - "//third_party/icu/icu4c/source/common/uvector.cpp", - "//third_party/icu/icu4c/source/common/ucnv_set.cpp", - "//third_party/icu/icu4c/source/common/udataswp.cpp", - "//third_party/icu/icu4c/source/common/uhash_us.cpp", - "//third_party/icu/icu4c/source/common/rbbisetb.cpp", - "//third_party/icu/icu4c/source/common/ubidi_props.cpp", - "//third_party/icu/icu4c/source/common/ucmndata.cpp", - "//third_party/icu/icu4c/source/common/locdistance.cpp", - "//third_party/icu/icu4c/source/common/serv.cpp", - "//third_party/icu/icu4c/source/common/utrie_swap.cpp", - "//third_party/icu/icu4c/source/common/uchar.cpp", - "//third_party/icu/icu4c/source/common/uloc_tag.cpp", - "//third_party/icu/icu4c/source/common/ustr_titlecase_brkiter.cpp", - "//third_party/icu/icu4c/source/common/pluralmap.cpp", - "//third_party/icu/icu4c/source/common/lsr.cpp", - "//third_party/icu/icu4c/source/common/uhash.cpp", - "//third_party/icu/icu4c/source/common/propname.cpp", - "//third_party/icu/icu4c/source/common/ucnvlat1.cpp", - "//third_party/icu/icu4c/source/common/ucnv_ext.cpp", - "//third_party/icu/icu4c/source/common/ubidiln.cpp", - "//third_party/icu/icu4c/source/common/ucnv_cb.cpp", - "//third_party/icu/icu4c/source/common/static_unicode_sets.cpp", - "//third_party/icu/icu4c/source/common/dictbe.cpp", - "//third_party/icu/icu4c/source/common/stringtriebuilder.cpp", - "//third_party/icu/icu4c/source/common/uvectr64.cpp", - "//third_party/icu/icu4c/source/common/patternprops.cpp", - "//third_party/icu/icu4c/source/common/propsvec.cpp", - "//third_party/icu/icu4c/source/common/ustrenum.cpp", - "//third_party/icu/icu4c/source/common/ucnv_u32.cpp", - "//third_party/icu/icu4c/source/common/ustr_cnv.cpp", - "//third_party/icu/icu4c/source/common/edits.cpp", - "//third_party/icu/icu4c/source/common/loclikely.cpp", - "//third_party/icu/icu4c/source/common/parsepos.cpp", - "//third_party/icu/icu4c/source/common/loclikelysubtags.cpp", - "//third_party/icu/icu4c/source/common/uloc_keytype.cpp", - "//third_party/icu/icu4c/source/common/appendable.cpp", - "//third_party/icu/icu4c/source/common/filteredbrk.cpp", - "//third_party/icu/icu4c/source/common/ucharstrie.cpp", - "//third_party/icu/icu4c/source/common/uiter.cpp", - "//third_party/icu/icu4c/source/common/messagepattern.cpp", - "//third_party/icu/icu4c/source/common/servrbf.cpp", - "//third_party/icu/icu4c/source/common/rbbirb.cpp", - "//third_party/icu/icu4c/source/common/uinit.cpp", - "//third_party/icu/icu4c/source/common/stringpiece.cpp", - "//third_party/icu/icu4c/source/common/normalizer2impl.cpp", - "//third_party/icu/icu4c/source/common/ucharstriebuilder.cpp", - "//third_party/icu/icu4c/source/common/uobject.cpp", - "//third_party/icu/icu4c/source/common/ushape.cpp", - "//third_party/icu/icu4c/source/common/ucasemap.cpp", - "//third_party/icu/icu4c/source/common/uinvchar.cpp", - "//third_party/icu/icu4c/source/common/utf_impl.cpp", - "//third_party/icu/icu4c/source/common/ustack.cpp", - "//third_party/icu/icu4c/source/common/characterproperties.cpp", - "//third_party/icu/icu4c/source/common/rbbi.cpp", - "//third_party/icu/icu4c/source/common/ucasemap_titlecase_brkiter.cpp", - "//third_party/icu/icu4c/source/common/caniter.cpp", - "//third_party/icu/icu4c/source/common/ucnv_bld.cpp", - "//third_party/icu/icu4c/source/common/ucln_cmn.cpp", - "//third_party/icu/icu4c/source/common/chariter.cpp", - "//third_party/icu/icu4c/source/common/punycode.cpp", - "//third_party/icu/icu4c/source/common/ustrtrns.cpp", - "//third_party/icu/icu4c/source/common/ucnvmbcs.cpp", - "//third_party/icu/icu4c/source/common/bytestream.cpp", - "//third_party/icu/icu4c/source/common/servlkf.cpp", - "//third_party/icu/icu4c/source/common/udatamem.cpp", - "//third_party/icu/icu4c/source/common/ucnv_io.cpp", - "//third_party/icu/icu4c/source/common/dtintrv.cpp", - "//third_party/icu/icu4c/source/common/cstr.cpp", - "//third_party/icu/icu4c/source/common/ulist.cpp", - "//third_party/icu/icu4c/source/common/ucnvisci.cpp", - "//third_party/icu/icu4c/source/common/brkeng.cpp", - "//third_party/icu/icu4c/source/common/localematcher.cpp", - "//third_party/icu/icu4c/source/common/umutablecptrie.cpp", - "//third_party/icu/icu4c/source/common/locdispnames.cpp", - "//third_party/icu/icu4c/source/common/uchriter.cpp", - "//third_party/icu/icu4c/source/common/uresdata.cpp", - "//third_party/icu/icu4c/source/common/unifiedcache.cpp", - "//third_party/icu/icu4c/source/common/dictionarydata.cpp", - "//third_party/icu/icu4c/source/common/uscript.cpp", - "//third_party/icu/icu4c/source/common/ucnv_u7.cpp", - "//third_party/icu/icu4c/source/common/unistr_case.cpp", - "//third_party/icu/icu4c/source/common/ucat.cpp", - "//third_party/icu/icu4c/source/common/resource.cpp", - "//third_party/icu/icu4c/source/common/usprep.cpp", - "//third_party/icu/icu4c/source/common/ucnvdisp.cpp", - "//third_party/icu/icu4c/source/common/uniset.cpp", - "//third_party/icu/icu4c/source/common/ucnv.cpp", - "//third_party/icu/icu4c/source/common/ucnvscsu.cpp", - "//third_party/icu/icu4c/source/common/uset_props.cpp", - "//third_party/icu/icu4c/source/common/umutex.cpp", - "//third_party/icu/icu4c/source/common/ucnv_cnv.cpp", - "//third_party/icu/icu4c/source/common/locmap.cpp", - "//third_party/icu/icu4c/source/common/resbund.cpp", - "//third_party/icu/icu4c/source/common/filterednormalizer2.cpp", - "//third_party/icu/icu4c/source/common/uprops.cpp", - "//third_party/icu/icu4c/source/common/schriter.cpp", - "//third_party/icu/icu4c/source/common/simpleformatter.cpp", - "//third_party/icu/icu4c/source/common/uts46.cpp", - "//third_party/icu/icu4c/source/common/ucol_swp.cpp", - "//third_party/icu/icu4c/source/common/udata.cpp", - "//third_party/icu/icu4c/source/common/ustrfmt.cpp", - "//third_party/icu/icu4c/source/common/servslkf.cpp", - "//third_party/icu/icu4c/source/common/servls.cpp", - "//third_party/icu/icu4c/source/common/unistr_props.cpp", - "//third_party/icu/icu4c/source/common/utrace.cpp", - "//third_party/icu/icu4c/source/common/utrie2_builder.cpp", - "//third_party/icu/icu4c/source/common/ucase.cpp", - "//third_party/icu/icu4c/source/common/cmemory.cpp", - "//third_party/icu/icu4c/source/common/uset.cpp", - "//third_party/icu/icu4c/source/common/unistr_case_locale.cpp", - "//third_party/icu/icu4c/source/common/ures_cnv.cpp", - "//third_party/icu/icu4c/source/common/charstr.cpp", - "//third_party/icu/icu4c/source/common/uidna.cpp", - "//third_party/icu/icu4c/source/common/normalizer2.cpp", - "//third_party/icu/icu4c/source/common/resbund_cnv.cpp", - "//third_party/icu/icu4c/source/common/umath.cpp", - "//third_party/icu/icu4c/source/common/utext.cpp", - "//third_party/icu/icu4c/source/common/ucurr.cpp", - "//third_party/icu/icu4c/source/common/util_props.cpp", - "//third_party/icu/icu4c/source/common/unorm.cpp", - "//third_party/icu/icu4c/source/common/ubidiwrt.cpp", - "//third_party/icu/icu4c/source/common/usetiter.cpp", - "//third_party/icu/icu4c/source/common/rbbinode.cpp", - "//third_party/icu/icu4c/source/common/ustrcase.cpp", - "//third_party/icu/icu4c/source/common/servnotf.cpp", - "//third_party/icu/icu4c/source/common/emojiprops.cpp", - "//third_party/icu/icu4c/source/common/lstmbe.cpp", - "//third_party/icu/icu4c/source/ohos/init_data.cpp", -] - -icu_i18n_source = [ - "//third_party/icu/icu4c/source/i18n/number_capi.cpp", - "//third_party/icu/icu4c/source/i18n/upluralrules.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_currency.cpp", - "//third_party/icu/icu4c/source/i18n/ufieldpositer.cpp", - "//third_party/icu/icu4c/source/i18n/number_output.cpp", - "//third_party/icu/icu4c/source/i18n/number_currencysymbols.cpp", - "//third_party/icu/icu4c/source/i18n/curramt.cpp", - "//third_party/icu/icu4c/source/i18n/alphaindex.cpp", - "//third_party/icu/icu4c/source/i18n/indiancal.cpp", - "//third_party/icu/icu4c/source/i18n/dayperiodrules.cpp", - "//third_party/icu/icu4c/source/i18n/displayoptions.cpp", - "//third_party/icu/icu4c/source/i18n/quantityformatter.cpp", - "//third_party/icu/icu4c/source/i18n/collationfastlatinbuilder.cpp", - "//third_party/icu/icu4c/source/i18n/csrucode.cpp", - "//third_party/icu/icu4c/source/i18n/measunit_extra.cpp", - "//third_party/icu/icu4c/source/i18n/ethpccal.cpp", - "//third_party/icu/icu4c/source/i18n/anytrans.cpp", - "//third_party/icu/icu4c/source/i18n/number_scientific.cpp", - "//third_party/icu/icu4c/source/i18n/cpdtrans.cpp", - "//third_party/icu/icu4c/source/i18n/regexst.cpp", - "//third_party/icu/icu4c/source/i18n/numfmt.cpp", - "//third_party/icu/icu4c/source/i18n/formattedvalue.cpp", - "//third_party/icu/icu4c/source/i18n/unesctrn.cpp", - "//third_party/icu/icu4c/source/i18n/ucoleitr.cpp", - "//third_party/icu/icu4c/source/i18n/tmutamt.cpp", - "//third_party/icu/icu4c/source/i18n/transreg.cpp", - "//third_party/icu/icu4c/source/i18n/unum.cpp", - "//third_party/icu/icu4c/source/i18n/number_longnames.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_affixes.cpp", - "//third_party/icu/icu4c/source/i18n/plurrule.cpp", - "//third_party/icu/icu4c/source/i18n/zrule.cpp", - "//third_party/icu/icu4c/source/i18n/collationrootelements.cpp", - "//third_party/icu/icu4c/source/i18n/currunit.cpp", - "//third_party/icu/icu4c/source/i18n/funcrepl.cpp", - "//third_party/icu/icu4c/source/i18n/collationdatareader.cpp", - "//third_party/icu/icu4c/source/i18n/buddhcal.cpp", - "//third_party/icu/icu4c/source/i18n/number_decimalquantity.cpp", - "//third_party/icu/icu4c/source/i18n/scriptset.cpp", - "//third_party/icu/icu4c/source/i18n/fmtable.cpp", - "//third_party/icu/icu4c/source/i18n/regextxt.cpp", - "//third_party/icu/icu4c/source/i18n/bocsu.cpp", - "//third_party/icu/icu4c/source/i18n/olsontz.cpp", - "//third_party/icu/icu4c/source/i18n/utmscale.cpp", - "//third_party/icu/icu4c/source/i18n/ucol.cpp", - "//third_party/icu/icu4c/source/i18n/currfmt.cpp", - "//third_party/icu/icu4c/source/i18n/hebrwcal.cpp", - "//third_party/icu/icu4c/source/i18n/ucol_sit.cpp", - "//third_party/icu/icu4c/source/i18n/rbnf.cpp", - "//third_party/icu/icu4c/source/i18n/decContext.cpp", - "//third_party/icu/icu4c/source/i18n/collationdatawriter.cpp", - "//third_party/icu/icu4c/source/i18n/csr2022.cpp", - "//third_party/icu/icu4c/source/i18n/dtrule.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_validators.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_parsednumber.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-fast-dtoa.cpp", - "//third_party/icu/icu4c/source/i18n/choicfmt.cpp", - "//third_party/icu/icu4c/source/i18n/format.cpp", - "//third_party/icu/icu4c/source/i18n/reldatefmt.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-double-to-string.cpp", - "//third_party/icu/icu4c/source/i18n/rbt_data.cpp", - "//third_party/icu/icu4c/source/i18n/smpdtfmt.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-bignum-dtoa.cpp", - "//third_party/icu/icu4c/source/i18n/number_padding.cpp", - "//third_party/icu/icu4c/source/i18n/vtzone.cpp", - "//third_party/icu/icu4c/source/i18n/region.cpp", - "//third_party/icu/icu4c/source/i18n/coptccal.cpp", - "//third_party/icu/icu4c/source/i18n/datefmt.cpp", - "//third_party/icu/icu4c/source/i18n/formatted_string_builder.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_impl.cpp", - "//third_party/icu/icu4c/source/i18n/plurfmt.cpp", - "//third_party/icu/icu4c/source/i18n/rematch.cpp", - "//third_party/icu/icu4c/source/i18n/simpletz.cpp", - "//third_party/icu/icu4c/source/i18n/search.cpp", - "//third_party/icu/icu4c/source/i18n/number_mapper.cpp", - "//third_party/icu/icu4c/source/i18n/inputext.cpp", - "//third_party/icu/icu4c/source/i18n/dtptngen.cpp", - "//third_party/icu/icu4c/source/i18n/coleitr.cpp", - "//third_party/icu/icu4c/source/i18n/collationweights.cpp", - "//third_party/icu/icu4c/source/i18n/number_modifiers.cpp", - "//third_party/icu/icu4c/source/i18n/scientificnumberformatter.cpp", - "//third_party/icu/icu4c/source/i18n/vzone.cpp", - "//third_party/icu/icu4c/source/i18n/fphdlimp.cpp", - "//third_party/icu/icu4c/source/i18n/udatpg.cpp", - "//third_party/icu/icu4c/source/i18n/collationfcd.cpp", - "//third_party/icu/icu4c/source/i18n/tridpars.cpp", - "//third_party/icu/icu4c/source/i18n/csmatch.cpp", - "//third_party/icu/icu4c/source/i18n/dangical.cpp", - "//third_party/icu/icu4c/source/i18n/ulocdata.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-strtod.cpp", - "//third_party/icu/icu4c/source/i18n/erarules.cpp", - "//third_party/icu/icu4c/source/i18n/numsys.cpp", - "//third_party/icu/icu4c/source/i18n/csdetect.cpp", - "//third_party/icu/icu4c/source/i18n/japancal.cpp", - "//third_party/icu/icu4c/source/i18n/collation.cpp", - "//third_party/icu/icu4c/source/i18n/uregex.cpp", - "//third_party/icu/icu4c/source/i18n/timezone.cpp", - "//third_party/icu/icu4c/source/i18n/strmatch.cpp", - "//third_party/icu/icu4c/source/i18n/decNumber.cpp", - "//third_party/icu/icu4c/source/i18n/nortrans.cpp", - "//third_party/icu/icu4c/source/i18n/sortkey.cpp", - "//third_party/icu/icu4c/source/i18n/ulistformatter.cpp", - "//third_party/icu/icu4c/source/i18n/tzgnames.cpp", - "//third_party/icu/icu4c/source/i18n/number_multiplier.cpp", - "//third_party/icu/icu4c/source/i18n/ztrans.cpp", - "//third_party/icu/icu4c/source/i18n/persncal.cpp", - "//third_party/icu/icu4c/source/i18n/number_utils.cpp", - "//third_party/icu/icu4c/source/i18n/csrmbcs.cpp", - "//third_party/icu/icu4c/source/i18n/taiwncal.cpp", - "//third_party/icu/icu4c/source/i18n/dtitvinf.cpp", - "//third_party/icu/icu4c/source/i18n/astro.cpp", - "//third_party/icu/icu4c/source/i18n/number_patternmodifier.cpp", - "//third_party/icu/icu4c/source/i18n/rulebasedcollator.cpp", - "//third_party/icu/icu4c/source/i18n/msgfmt.cpp", - "//third_party/icu/icu4c/source/i18n/stsearch.cpp", - "//third_party/icu/icu4c/source/i18n/number_affixutils.cpp", - "//third_party/icu/icu4c/source/i18n/quant.cpp", - "//third_party/icu/icu4c/source/i18n/calendar.cpp", - "//third_party/icu/icu4c/source/i18n/collationroot.cpp", - "//third_party/icu/icu4c/source/i18n/rbt_rule.cpp", - "//third_party/icu/icu4c/source/i18n/number_compact.cpp", - "//third_party/icu/icu4c/source/i18n/name2uni.cpp", - "//third_party/icu/icu4c/source/i18n/chnsecal.cpp", - "//third_party/icu/icu4c/source/i18n/csrutf8.cpp", - "//third_party/icu/icu4c/source/i18n/basictz.cpp", - "//third_party/icu/icu4c/source/i18n/reldtfmt.cpp", - "//third_party/icu/icu4c/source/i18n/nultrans.cpp", - "//third_party/icu/icu4c/source/i18n/number_grouping.cpp", - "//third_party/icu/icu4c/source/i18n/number_symbolswrapper.cpp", - "//third_party/icu/icu4c/source/i18n/number_usageprefs.cpp", - "//third_party/icu/icu4c/source/i18n/numrange_capi.cpp", - "//third_party/icu/icu4c/source/i18n/pluralranges.cpp", - "//third_party/icu/icu4c/source/i18n/units_complexconverter.cpp", - "//third_party/icu/icu4c/source/i18n/units_converter.cpp", - "//third_party/icu/icu4c/source/i18n/units_data.cpp", - "//third_party/icu/icu4c/source/i18n/units_router.cpp", - "//third_party/icu/icu4c/source/i18n/rbt_pars.cpp", - "//third_party/icu/icu4c/source/i18n/winnmfmt.cpp", - "//third_party/icu/icu4c/source/i18n/uregexc.cpp", - "//third_party/icu/icu4c/source/i18n/fpositer.cpp", - "//third_party/icu/icu4c/source/i18n/tmutfmt.cpp", - "//third_party/icu/icu4c/source/i18n/compactdecimalformat.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_decimal.cpp", - "//third_party/icu/icu4c/source/i18n/number_notation.cpp", - "//third_party/icu/icu4c/source/i18n/uspoof_conf.cpp", - "//third_party/icu/icu4c/source/i18n/utf16collationiterator.cpp", - "//third_party/icu/icu4c/source/i18n/udat.cpp", - "//third_party/icu/icu4c/source/i18n/number_skeletons.cpp", - "//third_party/icu/icu4c/source/i18n/utrans.cpp", - "//third_party/icu/icu4c/source/i18n/number_rounding.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-bignum.cpp", - "//third_party/icu/icu4c/source/i18n/number_asformat.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-string-to-double.cpp", - "//third_party/icu/icu4c/source/i18n/rbtz.cpp", - "//third_party/icu/icu4c/source/i18n/csrsbcs.cpp", - "//third_party/icu/icu4c/source/i18n/selfmt.cpp", - "//third_party/icu/icu4c/source/i18n/tztrans.cpp", - "//third_party/icu/icu4c/source/i18n/uspoof_impl.cpp", - "//third_party/icu/icu4c/source/i18n/regeximp.cpp", - "//third_party/icu/icu4c/source/i18n/measure.cpp", - "//third_party/icu/icu4c/source/i18n/fmtable_cnv.cpp", - "//third_party/icu/icu4c/source/i18n/uspoof.cpp", - "//third_party/icu/icu4c/source/i18n/gregoimp.cpp", - "//third_party/icu/icu4c/source/i18n/umsg.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_symbols.cpp", - "//third_party/icu/icu4c/source/i18n/numrange_impl.cpp", - "//third_party/icu/icu4c/source/i18n/collationtailoring.cpp", - "//third_party/icu/icu4c/source/i18n/double-conversion-cached-powers.cpp", - "//third_party/icu/icu4c/source/i18n/udateintervalformat.cpp", - "//third_party/icu/icu4c/source/i18n/uni2name.cpp", - "//third_party/icu/icu4c/source/i18n/casetrn.cpp", - "//third_party/icu/icu4c/source/i18n/windtfmt.cpp", - "//third_party/icu/icu4c/source/i18n/listformatter.cpp", - "//third_party/icu/icu4c/source/i18n/uregion.cpp", - "//third_party/icu/icu4c/source/i18n/usearch.cpp", - "//third_party/icu/icu4c/source/i18n/brktrans.cpp", - "//third_party/icu/icu4c/source/i18n/gender.cpp", - "//third_party/icu/icu4c/source/i18n/collationruleparser.cpp", - "//third_party/icu/icu4c/source/i18n/rbt.cpp", - "//third_party/icu/icu4c/source/i18n/tzfmt.cpp", - "//third_party/icu/icu4c/source/i18n/dtfmtsym.cpp", - "//third_party/icu/icu4c/source/i18n/tolowtrn.cpp", - "//third_party/icu/icu4c/source/i18n/collationdatabuilder.cpp", - "//third_party/icu/icu4c/source/i18n/unumsys.cpp", - "//third_party/icu/icu4c/source/i18n/csrecog.cpp", - "//third_party/icu/icu4c/source/i18n/collationfastlatin.cpp", - "//third_party/icu/icu4c/source/i18n/esctrn.cpp", - "//third_party/icu/icu4c/source/i18n/collationdata.cpp", - "//third_party/icu/icu4c/source/i18n/titletrn.cpp", - "//third_party/icu/icu4c/source/i18n/ucal.cpp", - "//third_party/icu/icu4c/source/i18n/regexcmp.cpp", - "//third_party/icu/icu4c/source/i18n/wintzimpl.cpp", - "//third_party/icu/icu4c/source/i18n/decimfmt.cpp", - "//third_party/icu/icu4c/source/i18n/tmunit.cpp", - "//third_party/icu/icu4c/source/i18n/number_integerwidth.cpp", - "//third_party/icu/icu4c/source/i18n/ucsdet.cpp", - "//third_party/icu/icu4c/source/i18n/uspoof_build.cpp", - "//third_party/icu/icu4c/source/i18n/ucln_in.cpp", - "//third_party/icu/icu4c/source/i18n/measfmt.cpp", - "//third_party/icu/icu4c/source/i18n/formattedval_iterimpl.cpp", - "//third_party/icu/icu4c/source/i18n/toupptrn.cpp", - "//third_party/icu/icu4c/source/i18n/translit.cpp", - "//third_party/icu/icu4c/source/i18n/dtitvfmt.cpp", - "//third_party/icu/icu4c/source/i18n/dcfmtsym.cpp", - "//third_party/icu/icu4c/source/i18n/islamcal.cpp", - "//third_party/icu/icu4c/source/i18n/numrange_fluent.cpp", - "//third_party/icu/icu4c/source/i18n/gregocal.cpp", - "//third_party/icu/icu4c/source/i18n/zonemeta.cpp", - "//third_party/icu/icu4c/source/i18n/collationbuilder.cpp", - "//third_party/icu/icu4c/source/i18n/string_segment.cpp", - "//third_party/icu/icu4c/source/i18n/collationkeys.cpp", - "//third_party/icu/icu4c/source/i18n/coll.cpp", - "//third_party/icu/icu4c/source/i18n/uitercollationiterator.cpp", - "//third_party/icu/icu4c/source/i18n/nfsubs.cpp", - "//third_party/icu/icu4c/source/i18n/smpdtfst.cpp", - "//third_party/icu/icu4c/source/i18n/collationsettings.cpp", - "//third_party/icu/icu4c/source/i18n/formattedval_sbimpl.cpp", - "//third_party/icu/icu4c/source/i18n/strrepl.cpp", - "//third_party/icu/icu4c/source/i18n/standardplural.cpp", - "//third_party/icu/icu4c/source/i18n/ucol_res.cpp", - "//third_party/icu/icu4c/source/i18n/repattrn.cpp", - "//third_party/icu/icu4c/source/i18n/tznames_impl.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_compositions.cpp", - "//third_party/icu/icu4c/source/i18n/rbt_set.cpp", - "//third_party/icu/icu4c/source/i18n/currpinf.cpp", - "//third_party/icu/icu4c/source/i18n/collationsets.cpp", - "//third_party/icu/icu4c/source/i18n/cecal.cpp", - "//third_party/icu/icu4c/source/i18n/tzrule.cpp", - "//third_party/icu/icu4c/source/i18n/collationiterator.cpp", - "//third_party/icu/icu4c/source/i18n/numparse_scientific.cpp", - "//third_party/icu/icu4c/source/i18n/number_patternstring.cpp", - "//third_party/icu/icu4c/source/i18n/utf8collationiterator.cpp", - "//third_party/icu/icu4c/source/i18n/sharedbreakiterator.cpp", - "//third_party/icu/icu4c/source/i18n/number_fluent.cpp", - "//third_party/icu/icu4c/source/i18n/measunit.cpp", - "//third_party/icu/icu4c/source/i18n/collationcompare.cpp", - "//third_party/icu/icu4c/source/i18n/number_formatimpl.cpp", - "//third_party/icu/icu4c/source/i18n/number_decimfmtprops.cpp", - "//third_party/icu/icu4c/source/i18n/nfrs.cpp", - "//third_party/icu/icu4c/source/i18n/tznames.cpp", - "//third_party/icu/icu4c/source/i18n/remtrans.cpp", - "//third_party/icu/icu4c/source/i18n/nfrule.cpp", -] - -ohos_shared_library("shared_icuuc") { - ldflags = [ - "-shared", - "-lm", - ] - - configs = [ - ":icu_config", - "$build_root/config/compiler:rtti", - ] - all_dependent_configs = [ ":static_icustubdata_all_deps_config" ] - defines = [ - "U_ATTRIBUTE_DEPRECATED=", - "U_COMMON_IMPLEMENTATION", - "UPRV_BLOCK_MACRO_BEGIN=", - "UPRV_BLOCK_MACRO_END=", - "UCONFIG_USE_WINDOWS_LCID_MAPPING_API=0", - "_REENTRANT", - ] - sources = icu_common_source - deps = [ ":static_icustubdata" ] - cflags_cc = [ - "-O3", - "-W", - "-Wall", - "-pedantic", - "-Wpointer-arith", - "-Wwrite-strings", - "-Wno-error=unused-parameter", - "-Wno-error=unused-const-variable", - "-Wno-error=unneeded-internal-declaration", - "-std=c++11", - "-Wno-ignored-attributes", - "-Wno-unused-but-set-variable", - "-Wno-deprecated-declarations", - ] - - if (is_standard_system || ark_standalone_build) { - part_name = "icu" - subsystem_name = "thirdparty" - } else { - part_name = "i18n" - subsystem_name = "global" - } - - innerapi_tags = [ "platformsdk" ] - install_images = [ system_base_dir ] - relative_install_dir = "platformsdk" - output_name = "hmicuuc" - install_enable = true -} - -ohos_shared_library("shared_icui18n") { - ldflags = [ - "-shared", - "-lm", - ] - if (current_os == "ios") { - ldflags += [ - "-Wl", - "-install_name", - "@rpath/libhmicui18n.framework/libhmicui18n", - ] - } - sources = icu_i18n_source - configs = [ - ":icu_config", - "$build_root/config/compiler:rtti", - ] - deps = [ ":shared_icuuc" ] - defines = [ - "U_ATTRIBUTE_DEPRECATED=", - "U_I18N_IMPLEMENTATION", - "UPRV_BLOCK_MACRO_BEGIN=", - "UPRV_BLOCK_MACRO_END=", - "_REENTRANT", - "PIC", - ] - cflags_cc = [ - "-O3", - "-W", - "-Wall", - "-pedantic", - "-Wpointer-arith", - "-Wno-error=unused-parameter", - "-Wno-error=unused-const-variable", - "-Wno-error=implicit-float-conversion", - "-Wno-error=unneeded-internal-declaration", - "-Wwrite-strings", - "-std=c++11", - "-Wno-ignored-attributes", - "-Wno-unused-but-set-variable", - "-Wno-deprecated-declarations", - ] - if (!is_mingw) { - cflags_cc += [ "-fPIC" ] - ldflags += [ "-ldl" ] - } - - if (is_standard_system || ark_standalone_build) { - part_name = "icu" - subsystem_name = "thirdparty" - } else { - part_name = "i18n" - subsystem_name = "global" - } - - innerapi_tags = [ "platformsdk" ] - install_images = [ system_base_dir ] - relative_install_dir = "platformsdk" - output_name = "hmicui18n" - install_enable = true -} - -if (current_os == "ios") { - ohos_combine_darwin_framework("libhmicui18n") { - deps = [ ":shared_icui18n" ] - subsystem_name = "thirdparty" - part_name = "icu" - } -} - -ohos_source_set("static_icuuc") { - configs = [ - ":icu_config", - "$build_root/config/compiler:rtti", - ] - - if (!(defined(is_arkui_x) && is_arkui_x) || - current_toolchain == host_toolchain) { - deps = [ ":static_icustubdata" ] - } - - defines = [ - "U_ATTRIBUTE_DEPRECATED=", - "U_COMMON_IMPLEMENTATION", - "U_STATIC_IMPLEMENTATION", - "UPRV_BLOCK_MACRO_BEGIN=", - "UPRV_BLOCK_MACRO_END=", - "UCONFIG_USE_WINDOWS_LCID_MAPPING_API=0", - "_REENTRANT", - ] - sources = icu_common_source - cflags_cc = [ - "-W", - "-Wall", - "-pedantic", - "-Wpointer-arith", - "-Wwrite-strings", - "-std=c++11", - "-Wno-error=unused-parameter", - "-Wno-error=unused-const-variable", - "-Wno-error=unneeded-internal-declaration", - "-fvisibility-inlines-hidden", - "-Wno-unused-function", - "-Wno-ignored-attributes", - "-Wno-unused-but-set-variable", - "-Wno-deprecated-declarations", - ] - - cflags = [ - "-fdata-sections", - "-ffunction-sections", - "-Wno-unused-function", - ] - - ldflags = [ - "-static", - "-ldl", - "-lm", - ] - - output_name = "hmicuuc" -} - -ohos_source_set("static_icui18n") { - sources = icu_i18n_source - configs = [ - ":icu_config", - "$build_root/config/compiler:rtti", - ] - deps = [ ":static_icuuc" ] - defines = [ - "U_ATTRIBUTE_DEPRECATED=", - "U_I18N_IMPLEMENTATION", - "U_STATIC_IMPLEMENTATION", - "UPRV_BLOCK_MACRO_BEGIN=", - "UPRV_BLOCK_MACRO_END=", - "_REENTRANT", - "PIC", - ] - - cflags_cc = [ - "-W", - "-Wall", - "-pedantic", - "-Wpointer-arith", - "-Wwrite-strings", - "-Wno-error=unused-parameter", - "-Wno-error=unused-const-variable", - "-Wno-error=implicit-float-conversion", - "-Wno-error=unneeded-internal-declaration", - "-std=c++11", - "-fvisibility-inlines-hidden", - "-fno-exceptions", - "-Wno-ignored-attributes", - "-Wno-unused-but-set-variable", - "-Wno-deprecated-declarations", - ] - - if (is_mingw) { - cflags_cc += [ "-DWINVER=0x0601" ] - } else { - cflags_cc += [ "-fPIC" ] - } - - cflags = [ - "-fdata-sections", - "-ffunction-sections", - ] - - ldflags = [ - "-static", - "-ldl", - "-lm", - ] - output_name = "hmicui18n" -} - -ohos_static_library("static_icu") { - configs = [ - ":icu_config", - "$build_root/config/compiler:rtti", - ] - - defines = [ - "U_ATTRIBUTE_DEPRECATED=", - "U_COMMON_IMPLEMENTATION", - "U_I18N_IMPLEMENTATION", - "U_STATIC_IMPLEMENTATION", - "UPRV_BLOCK_MACRO_BEGIN=", - "UPRV_BLOCK_MACRO_END=", - "UCONFIG_USE_WINDOWS_LCID_MAPPING_API=0", - "_REENTRANT", - ] - sources = icu_common_source - sources += icu_i18n_source - sources += [ "//third_party/icu/ohos_icu4j/data/lite/icudt72l_dat.S" ] - cflags_cc = [ - "-W", - "-Wall", - "-pedantic", - "-Wpointer-arith", - "-Wwrite-strings", - "-std=c++11", - "-Wno-error=unused-parameter", - "-Wno-error=unused-const-variable", - "-Wno-error=unneeded-internal-declaration", - "-fvisibility-inlines-hidden", - "-Wno-unused-function", - "-Wno-ignored-attributes", - "-Wno-unused-but-set-variable", - "-Wno-deprecated-declarations", - ] - - cflags = [ - "-fvisibility=hidden", - "-fdata-sections", - "-ffunction-sections", - "-Wno-unused-function", - ] - - ldflags = [ - "-static", - "-ldl", - "-lm", - ] - - output_name = "hmicu" - if (is_standard_system || ark_standalone_build) { - part_name = "icu" - subsystem_name = "thirdparty" - } else { - part_name = "i18n" - subsystem_name = "global" - } -} diff --git a/build/third_party_gn/json/BUILD.gn b/build/third_party_gn/json/BUILD.gn deleted file mode 100755 index a98b76d0adbb26594e61e913cc8b06b3fc7773b5..0000000000000000000000000000000000000000 --- a/build/third_party_gn/json/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/ark.gni") - -config("nlohmann_json_config") { - include_dirs = [ - "//third_party/json/single_include/", - "//third_party/json/single_include/nlohmann", - ] - - cflags_cc = [ "-fexceptions" ] - cflags_objcc = cflags_cc -} - -ohos_static_library("nlohmann_json_static") { - public_configs = [ ":nlohmann_json_config" ] - part_name = "json" - subsystem_name = "thirdparty" -} diff --git a/build/third_party_gn/json/dummy_bundle.json b/build/third_party_gn/json/dummy_bundle.json deleted file mode 100644 index 9afa11909ebd8dd2156aafa1b6f84b7c87d1ebeb..0000000000000000000000000000000000000000 --- a/build/third_party_gn/json/dummy_bundle.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "header": { - "header_base": "//third_party/json", - "header_files": [] - }, - "name": "//arkcompiler/toolchain/build/third_party_gn/json:nlohmann_json_static" - } - ] - } - } -} \ No newline at end of file diff --git a/build/third_party_gn/libuv/BUILD.gn b/build/third_party_gn/libuv/BUILD.gn deleted file mode 100644 index 5bb82bb0329b9ebb64dce4d017162908d2fb0217..0000000000000000000000000000000000000000 --- a/build/third_party_gn/libuv/BUILD.gn +++ /dev/null @@ -1,226 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/ark.gni") - -common_source = [ - "//third_party/libuv/src/fs-poll.c", - "//third_party/libuv/src/idna.c", - "//third_party/libuv/src/inet.c", - "//third_party/libuv/src/random.c", - "//third_party/libuv/src/strscpy.c", - "//third_party/libuv/src/threadpool.c", - "//third_party/libuv/src/thread-common.c", - "//third_party/libuv/src/timer.c", - "//third_party/libuv/src/uv-common.c", - "//third_party/libuv/src/uv-data-getter-setters.c", - "//third_party/libuv/src/version.c", - "//third_party/libuv/src/strtok.c", -] -if (!is_mingw && !is_win) { - nonwin_srcs = [ - "//third_party/libuv/src/unix/async.c", - "//third_party/libuv/src/unix/core.c", - "//third_party/libuv/src/unix/dl.c", - "//third_party/libuv/src/unix/fs.c", - "//third_party/libuv/src/unix/getaddrinfo.c", - "//third_party/libuv/src/unix/getnameinfo.c", - "//third_party/libuv/src/unix/loop.c", - "//third_party/libuv/src/unix/loop-watcher.c", - "//third_party/libuv/src/unix/pipe.c", - "//third_party/libuv/src/unix/poll.c", - "//third_party/libuv/src/unix/process.c", - "//third_party/libuv/src/unix/random-devurandom.c", - "//third_party/libuv/src/unix/signal.c", - "//third_party/libuv/src/unix/stream.c", - "//third_party/libuv/src/unix/tcp.c", - "//third_party/libuv/src/unix/thread.c", - "//third_party/libuv/src/unix/tty.c", - "//third_party/libuv/src/unix/udp.c", - ] -} - -# This is the configuration needed to use libuv. -config("libuv_config") { - include_dirs = [ - "//third_party/libuv/include", - "//third_party/libuv/src", - "//third_party/libuv/src/unix", - ] - defines = [] - cflags = [ "-Wno-unused-parameter" ] - if (is_linux || is_ohos) { - cflags += [ - "-Wno-incompatible-pointer-types", - "-D_GNU_SOURCE", - "-D_POSIX_C_SOURCE=200112", - ] - - # Adding NDEBUG macro manually to avoid compilation - # error in debug version, FIX ME - # https://gitee.com/openharmony/build/pulls/1206/files - defines += [ "NDEBUG" ] - } else if (is_mingw || is_win) { - cflags += [ - "-Wno-missing-braces", - "-Wno-implicit-function-declaration", - "-Wno-error=return-type", - "-Wno-error=sign-compare", - "-Wno-error=unused-variable", - "-Wno-error=unknown-pragmas", - "-Wno-unused-variable", - ] - defines += [ - "WIN32_LEAN_AND_MEAN", - "_WIN32_WINNT=0x0600", - ] - - # Adding NDEBUG macro manually to avoid compilation - # error in debug version, FIX ME - # https://gitee.com/openharmony/build/pulls/1206/files - defines += [ "NDEBUG" ] - - libs = [ - "psapi", - "user32", - "advapi32", - "iphlpapi", - "userenv", - "ws2_32", - ] - } else if (is_android) { - defines += [ "_GNU_SOURCE" ] - } -} - -# This is the configuration used to build libuv itself. -# It should not be needed outside of this library. -config("libuv_private_config") { - visibility = [ ":*" ] - include_dirs = [ - "//third_party/libuv/include", - "//third_party/libuv/src", - "//third_party/libuv/src/unix", - ] - - # Adding NDEBUG macro manually to avoid compilation - # error in debug version, FIX ME - # https://gitee.com/openharmony/build/pulls/1206/files - defines = [ "NDEBUG" ] -} - -ohos_source_set("libuv_source") { - stack_protector_ret = false - configs = [ ":libuv_config" ] - sources = common_source - external_deps = [] - if (is_mac || (defined(is_ios) && is_ios)) { - sources += nonwin_srcs + [ - "//third_party/libuv/src/unix/bsd-ifaddrs.c", - "//third_party/libuv/src/unix/kqueue.c", - "//third_party/libuv/src/unix/random-getentropy.c", - "//third_party/libuv/src/unix/darwin-proctitle.c", - "//third_party/libuv/src/unix/darwin.c", - "//third_party/libuv/src/unix/fsevents.c", - "//third_party/libuv/src/unix/os390-proctitle.c", - "//third_party/libuv/src/unix/log_unix.c", - "//third_party/libuv/src/unix/trace_unix.c", - ] - } else if (is_mingw || is_win) { - sources += [ - "//third_party/libuv/src/win/async.c", - "//third_party/libuv/src/win/core.c", - "//third_party/libuv/src/win/detect-wakeup.c", - "//third_party/libuv/src/win/dl.c", - "//third_party/libuv/src/win/error.c", - "//third_party/libuv/src/win/fs-event.c", - "//third_party/libuv/src/win/fs.c", - "//third_party/libuv/src/win/getaddrinfo.c", - "//third_party/libuv/src/win/getnameinfo.c", - "//third_party/libuv/src/win/handle.c", - "//third_party/libuv/src/win/log_win.c", - "//third_party/libuv/src/win/loop-watcher.c", - "//third_party/libuv/src/win/pipe.c", - "//third_party/libuv/src/win/poll.c", - "//third_party/libuv/src/win/process-stdio.c", - "//third_party/libuv/src/win/process.c", - "//third_party/libuv/src/win/signal.c", - "//third_party/libuv/src/win/snprintf.c", - "//third_party/libuv/src/win/stream.c", - "//third_party/libuv/src/win/tcp.c", - "//third_party/libuv/src/win/thread.c", - "//third_party/libuv/src/win/trace_win.c", - "//third_party/libuv/src/win/tty.c", - "//third_party/libuv/src/win/udp.c", - "//third_party/libuv/src/win/util.c", - "//third_party/libuv/src/win/winapi.c", - "//third_party/libuv/src/win/winsock.c", - ] - } else if (is_ohos || (defined(is_android) && is_android)) { - sources += nonwin_srcs + [ - "//third_party/libuv/src/unix/linux.c", - "//third_party/libuv/src/unix/procfs-exepath.c", - "//third_party/libuv/src/unix/random-getentropy.c", - "//third_party/libuv/src/unix/random-getrandom.c", - "//third_party/libuv/src/unix/random-sysctl-linux.c", - "//third_party/libuv/src/unix/proctitle.c", - ] - sources += [ - "src/log_ohos.c", - "src/trace_ohos.c", - ] - } else if (is_linux) { - sources += nonwin_srcs + [ - "//third_party/libuv/src/unix/linux.c", - "//third_party/libuv/src/unix/procfs-exepath.c", - "//third_party/libuv/src/unix/random-getrandom.c", - "//third_party/libuv/src/unix/random-sysctl-linux.c", - "//third_party/libuv/src/unix/proctitle.c", - "//third_party/libuv/src/unix/log_unix.c", - "//third_party/libuv/src/unix/trace_unix.c", - ] - } else { - sources += nonwin_srcs + [ - "//third_party/libuv/src/unix/linux.c", - "//third_party/libuv/src/unix/procfs-exepath.c", - "//third_party/libuv/src/unix/random-getrandom.c", - "//third_party/libuv/src/unix/random-sysctl-linux.c", - "//third_party/libuv/src/unix/proctitle.c", - ] - } - subsystem_name = "thirdparty" - part_name = "libuv" -} - -ohos_static_library("uv_static") { - stack_protector_ret = false - deps = [ ":libuv_source" ] - public_configs = [ ":libuv_config" ] - subsystem_name = "thirdparty" - part_name = "libuv" -} - -ohos_shared_library("uv") { - stack_protector_ret = false - deps = [ ":libuv_source" ] - public_configs = [ ":libuv_config" ] - subsystem_name = "thirdparty" - part_name = "libuv" - if (is_ohos) { - output_extension = "so" - } - install_images = [ - "system", - "updater", - ] -} diff --git a/build/third_party_gn/libuv/dummy_bundle.json b/build/third_party_gn/libuv/dummy_bundle.json deleted file mode 100644 index a8b20d74486616ccd429a4cbc3a2efbcc363af4e..0000000000000000000000000000000000000000 --- a/build/third_party_gn/libuv/dummy_bundle.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "name": "//arkcompiler/toolchain/build/third_party_gn/libuv:uv", - "header": { - "header_files": [], - "header_base": "//third_party/libuv/include" - } - } - ] - } - } -} diff --git a/build/third_party_gn/libuv/src/log_ohos.c b/build/third_party_gn/libuv/src/log_ohos.c deleted file mode 100644 index adca6ab08d69d6cb91a7c406eb3862a12bcccf1f..0000000000000000000000000000000000000000 --- a/build/third_party_gn/libuv/src/log_ohos.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "uv_log.h" - -int uv__log_impl(enum uv__log_level level, const char* fmt, ...) -{ - return 0; -} \ No newline at end of file diff --git a/build/third_party_gn/libuv/src/trace_ohos.c b/build/third_party_gn/libuv/src/trace_ohos.c deleted file mode 100644 index d288639d8cb88bf6e3d65609c936eee9366a0e23..0000000000000000000000000000000000000000 --- a/build/third_party_gn/libuv/src/trace_ohos.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include -#define UV_TRACE_TAG (1ULL << 30) - -void uv_start_trace(uint64_t tag, const char* name) {} -void uv_end_trace(uint64_t tag) {} \ No newline at end of file diff --git a/build/third_party_gn/musl/BUILD.gn b/build/third_party_gn/musl/BUILD.gn deleted file mode 100644 index 73729d5e92377a16ae8e6babd52f13a4ce55a8f4..0000000000000000000000000000000000000000 --- a/build/third_party_gn/musl/BUILD.gn +++ /dev/null @@ -1,328 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/third_party_gn/musl/musl_template.gni") - -musl_libs("soft_libs") { -} - -group("musl_headers") { - deps = [ - ":FreeBSD_copy", - ":copy_uapi_file", - ":create_alltypes_h_file", - ":create_syscall_h_file", - ":create_version_h_file", - ":musl_copy_inc_arpa_file", - ":musl_copy_inc_hook_file", - ":musl_copy_inc_net_file", - ":musl_copy_inc_netinet_file", - ":musl_copy_inc_netpacket_file", - ] -} - -action("create_porting_src") { - script = "//third_party/musl/scripts/porting.sh" - - sources_dir = [ "//third_party/musl" ] - - outdir = [ "${target_out_dir}/${musl_ported_dir}" ] - - src_files = musl_src_arch_file - src_files += musl_src_file - src_files += musl_src_ldso - src_files += musl_inc_bits_files - src_files += musl_inc_arpa_files - src_files += musl_inc_net_files - src_files += musl_inc_netinet_files - src_files += musl_inc_netpacket_files - src_files += musl_inc_scsi_files - src_files += musl_inc_sys_files - src_files += musl_inc_fortify_files - src_files += musl_inc_root_files - src_files += musl_inc_info_files - src_files += musl_inc_trace_files - - src_files += [ - "crt/Scrt1.c", - "crt/crt1.c", - "crt/rcrt1.c", - "tools/mkalltypes.sed", - "arch/${musl_arch}/bits/alltypes.h.in", - "arch/${musl_arch}/bits/syscall.h.in", - "include/alltypes.h.in", - "VERSION", - "tools/version.sh", - "tools/install.sh", - "scripts/install.py", - "scripts/create_alltypes.sh", - "scripts/create_vesion.sh", - "scripts/create_syscall.sh", - ] - src_files += [ - "crt/${musl_arch}/crti.s", - "crt/${musl_arch}/crtn.s", - ] - - args = [ "-i" ] + rebase_path(sources_dir) - args += [ "-o" ] + rebase_path(outdir) - args += [ "-p" ] + [ "${musl_target_os}" ] - foreach(i, src_files) { - foreach(s, musl_src_files_ext) { - if (i == s) { - src_files -= [ "${s}" ] - } - } - } - - outputs = [] - foreach(s, src_files) { - outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - - foreach(s, musl_src_files_ext) { - outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - - inputs = [] - foreach(i, src_files) { - foreach(s, musl_src_linux_files) { - if (i == s) { - src_files -= [ "${s}" ] - } - } - } - foreach(s, src_files) { - inputs += [ "${musl_dir}/${s}" ] - } - - foreach(s, musl_src_files_ext) { - inputs += [ "${musl_dir}/${s}" ] - } -} - -action("create_alltypes_h_file") { - script = "${target_out_dir}/${musl_ported_dir}/scripts/create_alltypes.sh" - - sources = [ "${target_out_dir}/${musl_ported_dir}/tools/mkalltypes.sed" ] - - sources += [ - "${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}/bits/alltypes.h.in", - "${target_out_dir}/${musl_ported_dir}/include/alltypes.h.in", - ] - - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/alltypes.h" ] - - args = [ "-o" ] + rebase_path(outputs, root_build_dir) + - rebase_path(sources, root_build_dir) - - deps = [ ":create_porting_src" ] -} - -action("create_version_h_file") { - script = "${target_out_dir}/${musl_ported_dir}/scripts/create_vesion.sh" - - sources = [ - "${target_out_dir}/${musl_ported_dir}/VERSION", - "${target_out_dir}/${musl_ported_dir}/tools/version.sh", - ] - - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/version.h" ] - - args = - rebase_path(sources, root_build_dir) + - [ rebase_path("${target_out_dir}/${musl_inc_out_dir}", root_build_dir) ] - - deps = [ ":create_porting_src" ] -} - -action("create_syscall_h_file") { - script = "${target_out_dir}/${musl_ported_dir}/scripts/create_syscall.sh" - - sources = [ - "${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}/bits/syscall.h.in", - ] - - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/syscall.h" ] - - args = rebase_path(sources, root_build_dir) + - rebase_path(outputs, root_build_dir) - - deps = [ ":create_porting_src" ] -} - -uapi_from = "local" -uapi_full_path = rebase_path(musl_uapi_dir) -arguments_uapi = [ "-c" ] - -# exclude these files because they need special treatment -if (uapi_from == "make") { - exclude_files = "^asm\$|^scsi\$" -} else { - exclude_files = "^asm-arm\$|^asm-arm64\$|^scsi\$" -} - -arguments_uapi += - [ "ls ${uapi_full_path} | grep -Ev " + "\"" + "${exclude_files}" + "\"" ] -uspi_files = exec_script("/bin/sh", arguments_uapi, "list lines") - -# Generate a copy target for each file -foreach(file, uspi_files) { - copy("copy_uapi_${file}") { - sources = [ "${musl_uapi_dir}/${file}" ] - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/${file}" ] - } -} - -group("copy_uapi_scsi") { - deps = [] - sources = [] - outputs = [] - uapi_scsi_dir = rebase_path("${musl_uapi_dir}/scsi") - arguments_scsi = [ "-c" ] - arguments_scsi += [ "ls ${uapi_scsi_dir}" ] - uapi_scsi_files = exec_script("/bin/sh", arguments_scsi, "list lines") - - # Generate a copy target for each file in scsi dir to avoid being influenced by musl_copy_inc_scsi output - foreach(file, uapi_scsi_files) { - copy("copy_uapi_scsi_${file}") { - sources += [ "${musl_uapi_dir}/scsi/${file}" ] - outputs += [ "${target_out_dir}/${musl_inc_out_dir}/scsi/${file}" ] - } - deps += [ ":copy_uapi_scsi_${file}" ] - } -} - -copy("copy_uapi_asm") { - if (uapi_from == "local") { - if ("${musl_arch}" == "arm") { - file_name = "asm-arm" - } else { # aarch64 and x86_64 use same file - file_name = "asm-arm64" - } - sources = [ "${musl_uapi_dir}/${file_name}/asm" ] - } else { - sources = [ "${musl_uapi_dir}/asm" ] - } - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/asm" ] -} - -group("copy_uapi_file") { - deps = [ ":copy_uapi_scsi" ] - - # We need do different processing for asm according to the source of uapi - deps += [ ":copy_uapi_asm" ] - foreach(file, uspi_files) { - deps += [ ":copy_uapi_${file}" ] - } -} - -copy("musl_copy_inc_hook_file") { - sources = musl_inc_hook_files - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/{{source_file_part}}" ] -} - -copy("musl_copy_inc_bits") { - sources = [] - sources_bits = musl_inc_bits_files - foreach(s, sources_bits) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = - [ "${target_out_dir}/${musl_inc_out_dir}/bits/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_fortify") { - sources = [] - sources_fortify = musl_inc_fortify_files - foreach(s, sources_fortify) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = - [ "${target_out_dir}/${musl_inc_out_dir}/fortify/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_root") { - sources = [] - sources_inc_root = musl_inc_root_files - foreach(s, sources_inc_root) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_sys") { - sources = [] - sources_inc_sys = musl_inc_sys_files - foreach(s, sources_inc_sys) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/sys/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_netinet_file") { - sources = [] - sources_netinet_file = musl_inc_netinet_files - foreach(s, sources_netinet_file) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = - [ "${target_out_dir}/${musl_inc_out_dir}/netinet/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_arpa_file") { - sources = [] - sources_arpa_file = musl_inc_arpa_files - foreach(s, sources_arpa_file) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = - [ "${target_out_dir}/${musl_inc_out_dir}/arpa/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_net_file") { - sources = [] - sources_net_file = musl_inc_net_files - foreach(s, sources_net_file) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/net/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -copy("musl_copy_inc_netpacket_file") { - sources = [] - sources_netpacket_file = musl_inc_netpacket_files - foreach(s, sources_netpacket_file) { - sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ] - } - outputs = - [ "${target_out_dir}/${musl_inc_out_dir}/netpacket/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} - -group("FreeBSD_copy") { - deps = [ ":FreeBSD_sys_headers" ] -} - -copy("FreeBSD_sys_headers") { - sources = freebsd_sys_headers - outputs = [ "${target_out_dir}/${musl_inc_out_dir}/sys/{{source_file_part}}" ] - deps = [ ":create_porting_src" ] -} diff --git a/build/third_party_gn/musl/musl_config.gni b/build/third_party_gn/musl/musl_config.gni deleted file mode 100644 index 52814f23281d1df92cb18d28f97a26720d4e9ab8..0000000000000000000000000000000000000000 --- a/build/third_party_gn/musl/musl_config.gni +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -declare_args() { - if (current_cpu == "x86_64" || current_cpu == "x64") { - musl_arch = "x86_64" - } else if (current_cpu == "arm") { - musl_arch = "arm" - } else if (current_cpu == "arm64") { - musl_arch = "aarch64" - } else if (current_cpu == "mipsel") { - musl_arch = "mips" - } -} - -# Musl_arch is named mips in order to obtain the path name of the source file -# in the musl repository,but the actual compilation is mipsel -declare_args() { - musl_target_os = "linux" - if (current_cpu == "mipsel") { - musl_target_triple = "mipsel-linux-ohos" - } else { - musl_target_triple = "${musl_arch}-linux-ohos" - } -} - -declare_args() { - if (!defined(product_path)) { - product_path = "" - } - musl_iterate_and_stats_api = true - musl_secure_level = 1 -} - -declare_args() { - runtime_lib_path = - "//prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/15.0.4/lib" - musl_use_jemalloc = false - musl_ported_dir = "intermidiates/${musl_target_os}/musl_src_ported" - musl_inc_out_dir = "usr/include/${musl_target_triple}" - musl_uapi_dir = "//kernel/linux/patches/linux-5.10/prebuilts/usr/include" - musl_dir = "//third_party/musl" - musl_porting_dir = "//third_party/musl/porting/linux/user" -} diff --git a/build/third_party_gn/musl/musl_src.gni b/build/third_party_gn/musl/musl_src.gni deleted file mode 100644 index aa32f5ccdfeda16c5ba43fd6665ff3d2cbe00860..0000000000000000000000000000000000000000 --- a/build/third_party_gn/musl/musl_src.gni +++ /dev/null @@ -1,2545 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//third_party/FreeBSD/FreeBSD.gni") -import("$build_root/third_party_gn/musl/musl_config.gni") - -OPTRTDIR = "//third_party/optimized-routines/" -if (musl_arch == "arm") { - musl_src_arch_file = [ - "src/exit/arm/__aeabi_atexit.c", - "src/fenv/arm/fenv-hf.S", - "src/fenv/arm/fenv.c", - "src/ldso/arm/dlsym.s", - "src/ldso/arm/dlsym_time64.S", - "src/ldso/arm/find_exidx.c", - "src/ldso/arm/tlsdesc.S", - "src/math/arm/fabs.c", - "src/math/arm/fabsf.c", - "src/math/arm/fma.c", - "src/math/arm/fmaf.c", - "src/math/arm/sqrt.c", - "src/math/arm/sqrtf.c", - "src/process/arm/vfork.s", - "src/setjmp/arm/longjmp.S", - "src/setjmp/arm/setjmp.S", - "src/signal/arm/restore.s", - "src/signal/arm/sigsetjmp.s", - "src/string/arm/__aeabi_memcpy.s", - "src/string/arm/__aeabi_memset.s", - "src/string/arm/memcpy.S", - "src/thread/arm/__aeabi_read_tp.s", - "src/thread/arm/__set_thread_area.c", - "src/thread/arm/__unmapself.s", - "src/thread/arm/atomics.s", - "src/thread/arm/clone.s", - "src/thread/arm/syscall_cp.s", - "src/linux/arm/flock.s", - "compat/time32/adjtime32.c", - "compat/time32/adjtimex_time32.c", - "compat/time32/aio_suspend_time32.c", - "compat/time32/clock_adjtime32.c", - "compat/time32/clock_getres_time32.c", - "compat/time32/clock_gettime32.c", - "compat/time32/clock_nanosleep_time32.c", - "compat/time32/clock_settime32.c", - "compat/time32/cnd_timedwait_time32.c", - "compat/time32/ctime32.c", - "compat/time32/ctime32_r.c", - "compat/time32/difftime32.c", - "compat/time32/fstatat_time32.c", - "compat/time32/fstat_time32.c", - "compat/time32/ftime32.c", - "compat/time32/futimens_time32.c", - "compat/time32/futimesat_time32.c", - "compat/time32/futimes_time32.c", - "compat/time32/getitimer_time32.c", - "compat/time32/getrusage_time32.c", - "compat/time32/gettimeofday_time32.c", - "compat/time32/gmtime32.c", - "compat/time32/gmtime32_r.c", - "compat/time32/localtime32.c", - "compat/time32/localtime32_r.c", - "compat/time32/lstat_time32.c", - "compat/time32/lutimes_time32.c", - "compat/time32/mktime32.c", - "compat/time32/mq_timedreceive_time32.c", - "compat/time32/mq_timedsend_time32.c", - "compat/time32/mtx_timedlock_time32.c", - "compat/time32/nanosleep_time32.c", - "compat/time32/ppoll_time32.c", - "compat/time32/pselect_time32.c", - "compat/time32/pthread_cond_timedwait_time32.c", - "compat/time32/pthread_mutex_timedlock_time32.c", - "compat/time32/pthread_rwlock_timedrdlock_time32.c", - "compat/time32/pthread_rwlock_timedwrlock_time32.c", - "compat/time32/pthread_timedjoin_np_time32.c", - "compat/time32/recvmmsg_time32.c", - "compat/time32/sched_rr_get_interval_time32.c", - "compat/time32/select_time32.c", - "compat/time32/semtimedop_time32.c", - "compat/time32/sem_timedwait_time32.c", - "compat/time32/setitimer_time32.c", - "compat/time32/settimeofday_time32.c", - "compat/time32/sigtimedwait_time32.c", - "compat/time32/stat_time32.c", - "compat/time32/stime32.c", - "compat/time32/thrd_sleep_time32.c", - "compat/time32/time32.c", - "compat/time32/time32gm.c", - "compat/time32/time32.h", - "compat/time32/timerfd_gettime32.c", - "compat/time32/timerfd_settime32.c", - "compat/time32/timer_gettime32.c", - "compat/time32/timer_settime32.c", - "compat/time32/timespec_get_time32.c", - "compat/time32/utimensat_time32.c", - "compat/time32/utimes_time32.c", - "compat/time32/utime_time32.c", - "compat/time32/wait3_time32.c", - "compat/time32/wait4_time32.c", - "compat/time32/__xstat.c", - ] -} else if (musl_arch == "aarch64") { - musl_src_arch_file = [ - "src/fenv/aarch64/fenv.s", - "src/ldso/aarch64/dlsym.s", - "src/ldso/aarch64/tlsdesc.s", - "src/math/aarch64/ceil.c", - "src/math/aarch64/ceilf.c", - "src/math/aarch64/fabs.c", - "src/math/aarch64/fabsf.c", - "src/math/aarch64/floor.c", - "src/math/aarch64/floorf.c", - "src/math/aarch64/fma.c", - "src/math/aarch64/fmaf.c", - "src/math/aarch64/fmax.c", - "src/math/aarch64/fmaxf.c", - "src/math/aarch64/fmin.c", - "src/math/aarch64/fminf.c", - "src/math/aarch64/llrint.c", - "src/math/aarch64/llrintf.c", - "src/math/aarch64/llround.c", - "src/math/aarch64/llroundf.c", - "src/math/aarch64/lrint.c", - "src/math/aarch64/lrintf.c", - "src/math/aarch64/lround.c", - "src/math/aarch64/lroundf.c", - "src/math/aarch64/nearbyint.c", - "src/math/aarch64/nearbyintf.c", - "src/math/aarch64/rint.c", - "src/math/aarch64/rintf.c", - "src/math/aarch64/round.c", - "src/math/aarch64/roundf.c", - "src/math/aarch64/sqrt.c", - "src/math/aarch64/sqrtf.c", - "src/math/aarch64/trunc.c", - "src/math/aarch64/truncf.c", - "src/setjmp/aarch64/longjmp.s", - "src/setjmp/aarch64/setjmp.s", - "src/signal/aarch64/restore.s", - "src/signal/aarch64/sigsetjmp.s", - "src/thread/aarch64/__set_thread_area.s", - "src/thread/aarch64/__unmapself.s", - "src/thread/aarch64/clone.s", - "src/thread/aarch64/syscall_cp.s", - "src/linux/aarch64/flock.s", - ] -} else if (musl_arch == "mips") { - musl_src_arch_file = [ - "src/fenv/mips/fenv-sf.c", - "src/fenv/mips/fenv.S", - "src/ldso/mips/dlsym_time64.S", - "src/ldso/mips/dlsym.s", - "src/math/mips/fabs.c", - "src/math/mips/fabsf.c", - "src/math/mips/sqrt.c", - "src/math/mips/sqrtf.c", - "src/setjmp/mips/longjmp.S", - "src/setjmp/mips/setjmp.S", - "src/signal/mips/sigsetjmp.s", - "src/thread/mips/__unmapself.s", - "src/thread/mips/clone.s", - "src/thread/mips/syscall_cp.s", - "src/unistd/mips/pipe.s", - ] -} else if (musl_arch == "riscv64") { - musl_src_arch_file = [ - "src/fenv/riscv64/fenv-sf.c", - "src/fenv/riscv64/fenv.S", - "src/ldso/riscv64/dlsym.s", - "src/ldso/riscv64/tlsdesc.s", - "src/math/riscv64/copysign.c", - "src/math/riscv64/copysignf.c", - "src/math/riscv64/fabs.c", - "src/math/riscv64/fabsf.c", - "src/math/riscv64/fma.c", - "src/math/riscv64/fmaf.c", - "src/math/riscv64/fmax.c", - "src/math/riscv64/fmaxf.c", - "src/math/riscv64/fmin.c", - "src/math/riscv64/fminf.c", - "src/math/riscv64/sqrt.c", - "src/math/riscv64/sqrtf.c", - "src/setjmp/riscv64/longjmp.S", - "src/setjmp/riscv64/setjmp.S", - "src/signal/riscv64/restore.s", - "src/signal/riscv64/sigsetjmp.s", - "src/thread/riscv64/__set_thread_area.s", - "src/thread/riscv64/__unmapself.s", - "src/thread/riscv64/clone.s", - "src/thread/riscv64/syscall_cp.s", - ] -} else if (musl_arch == "x86_64") { - musl_src_arch_file = [ - "src/fenv/x86_64/fenv.s", - "src/ldso/x86_64/dlsym.s", - "src/ldso/x86_64/tlsdesc.s", - "src/math/x86_64/__invtrigl.s", - "src/math/x86_64/acosl.s", - "src/math/x86_64/asinl.s", - "src/math/x86_64/atan2l.s", - "src/math/x86_64/atanl.s", - "src/math/x86_64/ceill.s", - "src/math/x86_64/exp2l.s", - "src/math/x86_64/expl.s", - "src/math/x86_64/expm1l.s", - "src/math/x86_64/fabs.c", - "src/math/x86_64/fabsf.c", - "src/math/x86_64/fabsl.s", - "src/math/x86_64/floorl.s", - "src/math/x86_64/fma.c", - "src/math/x86_64/fmaf.c", - "src/math/x86_64/fmodl.s", - "src/math/x86_64/llrint.c", - "src/math/x86_64/llrintf.c", - "src/math/x86_64/llrintl.s", - "src/math/x86_64/log1pl.s", - "src/math/x86_64/log2l.s", - "src/math/x86_64/log10l.s", - "src/math/x86_64/logl.s", - "src/math/x86_64/lrint.c", - "src/math/x86_64/lrintf.c", - "src/math/x86_64/lrintl.s", - "src/math/x86_64/remainderl.s", - "src/math/x86_64/rintl.s", - "src/math/x86_64/sqrt.c", - "src/math/x86_64/sqrtf.c", - "src/math/x86_64/sqrtl.s", - "src/math/x86_64/truncl.s", - "src/process/x86_64/vfork.s", - "src/setjmp/x86_64/longjmp.s", - "src/setjmp/x86_64/setjmp.s", - "src/signal/x86_64/restore.s", - "src/signal/x86_64/sigsetjmp.s", - "src/string/x86_64/memcpy.s", - "src/string/x86_64/memmove.s", - "src/thread/x86_64/__set_thread_area.s", - "src/thread/x86_64/__unmapself.s", - "src/thread/x86_64/clone.s", - "src/thread/x86_64/syscall_cp.s", - "src/linux/x86_64/flock.s", - ] -} else if (musl_arch == "loongarch64") { - musl_src_arch_file = [ - "src/fenv/loongarch64/fenv.S", - "src/ldso/loongarch64/dlsym.s", - "src/ldso/loongarch64/tlsdesc.s", - "src/setjmp/loongarch64/longjmp.S", - "src/setjmp/loongarch64/setjmp.S", - "src/signal/loongarch64/restore.s", - "src/signal/loongarch64/sigsetjmp.s", - "src/thread/loongarch64/__set_thread_area.s", - "src/thread/loongarch64/__unmapself.s", - "src/thread/loongarch64/clone.s", - "src/thread/loongarch64/syscall_cp.s", - ] -} - -musl_src_file = [ - "src/internal/pthread_impl.h", - "src/internal/locale_impl.h", - "src/internal/locale_impl.c", - "src/internal/stdio_impl.h", - "src/internal/unsupported_api.h", - "src/internal/syscall_hooks.h", - "src/thread/pthread_rwlock_timedrdlock.c", - "src/thread/pthread_rwlock_timedwrlock.c", - "src/aio/aio.c", - "src/aio/aio_suspend.c", - "src/aio/lio_listio.c", - "src/complex/__cexp.c", - "src/complex/__cexpf.c", - "src/complex/cabs.c", - "src/complex/cabsf.c", - "src/complex/cabsl.c", - "src/complex/cacos.c", - "src/complex/cacosf.c", - "src/complex/cacosh.c", - "src/complex/cacoshf.c", - "src/complex/cacoshl.c", - "src/complex/cacosl.c", - "src/complex/carg.c", - "src/complex/cargf.c", - "src/complex/cargl.c", - "src/complex/casin.c", - "src/complex/casinf.c", - "src/complex/casinh.c", - "src/complex/casinhf.c", - "src/complex/casinhl.c", - "src/complex/casinl.c", - "src/complex/catan.c", - "src/complex/catanf.c", - "src/complex/catanh.c", - "src/complex/catanhf.c", - "src/complex/catanhl.c", - "src/complex/catanl.c", - "src/complex/ccos.c", - "src/complex/ccosf.c", - "src/complex/ccosh.c", - "src/complex/ccoshf.c", - "src/complex/ccoshl.c", - "src/complex/ccosl.c", - "src/complex/cexp.c", - "src/complex/cexpf.c", - "src/complex/cexpl.c", - "src/complex/cimag.c", - "src/complex/cimagf.c", - "src/complex/cimagl.c", - "src/complex/clog.c", - "src/complex/clogf.c", - "src/complex/clogl.c", - "src/complex/conj.c", - "src/complex/conjf.c", - "src/complex/conjl.c", - "src/complex/cpow.c", - "src/complex/cpowf.c", - "src/complex/cpowl.c", - "src/complex/cproj.c", - "src/complex/cprojf.c", - "src/complex/cprojl.c", - "src/complex/creal.c", - "src/complex/crealf.c", - "src/complex/creall.c", - "src/complex/csin.c", - "src/complex/csinf.c", - "src/complex/csinh.c", - "src/complex/csinhf.c", - "src/complex/csinhl.c", - "src/complex/csinl.c", - "src/complex/csqrt.c", - "src/complex/csqrtf.c", - "src/complex/csqrtl.c", - "src/complex/ctan.c", - "src/complex/ctanf.c", - "src/complex/ctanh.c", - "src/complex/ctanhf.c", - "src/complex/ctanhl.c", - "src/complex/ctanl.c", - "src/conf/confstr.c", - "src/conf/fpathconf.c", - "src/conf/legacy.c", - "src/conf/pathconf.c", - "src/conf/sysconf.c", - "src/crypt/crypt.c", - "src/crypt/crypt_blowfish.c", - "src/crypt/crypt_des.c", - "src/crypt/crypt_md5.c", - "src/crypt/crypt_r.c", - "src/crypt/crypt_sha256.c", - "src/crypt/crypt_sha512.c", - "src/crypt/encrypt.c", - "src/ctype/__ctype_b_loc.c", - "src/ctype/__ctype_get_mb_cur_max.c", - "src/ctype/__ctype_tolower_loc.c", - "src/ctype/__ctype_toupper_loc.c", - "src/ctype/isalnum.c", - "src/ctype/isalpha.c", - "src/ctype/isascii.c", - "src/ctype/isblank.c", - "src/ctype/iscntrl.c", - "src/ctype/isdigit.c", - "src/ctype/isgraph.c", - "src/ctype/islower.c", - "src/ctype/isprint.c", - "src/ctype/ispunct.c", - "src/ctype/isspace.c", - "src/ctype/isupper.c", - "src/ctype/iswalnum.c", - "src/ctype/iswalpha.c", - "src/ctype/iswblank.c", - "src/ctype/iswcntrl.c", - "src/ctype/iswctype.c", - "src/ctype/iswdigit.c", - "src/ctype/iswgraph.c", - "src/ctype/iswlower.c", - "src/ctype/iswprint.c", - "src/ctype/iswpunct.c", - "src/ctype/iswspace.c", - "src/ctype/iswupper.c", - "src/ctype/iswxdigit.c", - "src/ctype/isxdigit.c", - "src/ctype/toascii.c", - "src/ctype/tolower.c", - "src/ctype/toupper.c", - "src/ctype/towctrans.c", - "src/ctype/wcswidth.c", - "src/ctype/wctrans.c", - "src/ctype/wcwidth.c", - "src/dirent/alphasort.c", - "src/dirent/closedir.c", - "src/dirent/dirfd.c", - "src/dirent/fdopendir.c", - "src/dirent/opendir.c", - "src/dirent/readdir.c", - "src/dirent/readdir_r.c", - "src/dirent/rewinddir.c", - "src/dirent/scandir.c", - "src/dirent/seekdir.c", - "src/dirent/telldir.c", - "src/dirent/versionsort.c", - "src/env/__environ.c", - "src/env/__init_tls.c", - "src/env/__libc_start_main.c", - "src/env/__reset_tls.c", - "src/env/__stack_chk_fail.c", - "src/env/clearenv.c", - "src/env/getenv.c", - "src/env/putenv.c", - "src/env/secure_getenv.c", - "src/env/setenv.c", - "src/env/unsetenv.c", - "src/errno/__errno_location.c", - "src/errno/strerror.c", - "src/exit/_Exit.c", - "src/exit/abort_lock.c", - "src/exit/abort.c", - "src/exit/assert.c", - "src/exit/at_quick_exit.c", - "src/exit/atexit.c", - "src/exit/exit.c", - "src/exit/cxa_thread_atexit_impl.c", - "src/exit/quick_exit.c", - "src/fcntl/creat.c", - "src/fcntl/fcntl.c", - "src/fcntl/open.c", - "src/fcntl/openat.c", - "src/fcntl/posix_fadvise.c", - "src/fcntl/posix_fallocate.c", - "src/fdsan/fdsan.c", - "src/fenv/__flt_rounds.c", - "src/fenv/fegetexceptflag.c", - "src/fenv/feholdexcept.c", - "src/fenv/fenv.c", - "src/fenv/fesetexceptflag.c", - "src/fenv/fesetround.c", - "src/fenv/feupdateenv.c", - "src/fortify/fortify.c", - "src/gwp_asan/gwp_asan.c", - "src/gwp_asan/gwp_asan.h", - "src/internal/defsysinfo.c", - "src/internal/floatscan.c", - "src/internal/intscan.c", - "src/internal/libc.c", - "src/internal/procfdname.c", - "src/internal/shgetc.c", - "src/internal/syscall_ret.c", - "src/internal/version.c", - "src/hilog/hilog_adapter.c", - "src/hilog/vsnprintf_s_p.c", - "src/ipc/ftok.c", - "src/ipc/msgctl.c", - "src/ipc/msgget.c", - "src/ipc/msgrcv.c", - "src/ipc/msgsnd.c", - "src/ipc/semctl.c", - "src/ipc/semget.c", - "src/ipc/semop.c", - "src/ipc/semtimedop.c", - "src/ipc/shmat.c", - "src/ipc/shmctl.c", - "src/ipc/shmdt.c", - "src/ipc/shmget.c", - "src/ldso/__dlsym.c", - "src/ldso/dl_iterate_phdr.c", - "src/ldso/dladdr.c", - "src/ldso/dlclose.c", - "src/ldso/dlerror.c", - "src/ldso/dlinfo.c", - "src/ldso/dlopen.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/legacy/cuserid.c", - "src/legacy/daemon.c", - "src/legacy/err.c", - "src/legacy/euidaccess.c", - "src/legacy/ftw.c", - "src/legacy/futimes.c", - "src/legacy/getdtablesize.c", - "src/legacy/getloadavg.c", - "src/legacy/getpagesize.c", - "src/legacy/getpass.c", - "src/legacy/getusershell.c", - "src/legacy/isastream.c", - "src/legacy/lutimes.c", - "src/legacy/ulimit.c", - "src/legacy/utmpx.c", - "src/legacy/valloc.c", - "src/linux/adjtime.c", - "src/linux/adjtimex.c", - "src/linux/arch_prctl.c", - "src/linux/brk.c", - "src/linux/cache.c", - "src/linux/cap.c", - "src/linux/chroot.c", - "src/linux/clock_adjtime.c", - "src/linux/clone.c", - "src/linux/getprocpid.c", - "src/linux/copy_file_range.c", - "src/linux/epoll.c", - "src/linux/eventfd.c", - "src/linux/fallocate.c", - "src/linux/fanotify.c", - "src/linux/flock.c", - "src/linux/getdents.c", - "src/linux/getrandom.c", - "src/linux/gettid.c", - "src/linux/inotify.c", - "src/linux/ioperm.c", - "src/linux/iopl.c", - "src/linux/klogctl.c", - "src/linux/membarrier.c", - "src/linux/memfd_create.c", - "src/linux/mlock2.c", - "src/linux/module.c", - "src/linux/mount.c", - "src/linux/name_to_handle_at.c", - "src/linux/open_by_handle_at.c", - "src/linux/personality.c", - "src/linux/pivot_root.c", - "src/linux/prctl.c", - "src/linux/preadv2.c", - "src/linux/prlimit.c", - "src/linux/process_vm.c", - "src/linux/ptrace.c", - "src/linux/quotactl.c", - "src/linux/readahead.c", - "src/linux/reboot.c", - "src/linux/remap_file_pages.c", - "src/linux/sbrk.c", - "src/linux/sendfile.c", - "src/linux/setfsgid.c", - "src/linux/setfsuid.c", - "src/linux/setgroups.c", - "src/linux/sethostname.c", - "src/linux/setns.c", - "src/linux/settimeofday.c", - "src/linux/signalfd.c", - "src/linux/splice.c", - "src/linux/statx.c", - "src/linux/stime.c", - "src/linux/swap.c", - "src/linux/sync_file_range.c", - "src/linux/syncfs.c", - "src/linux/sysinfo.c", - "src/linux/tee.c", - "src/linux/timerfd.c", - "src/linux/unshare.c", - "src/linux/utimes.c", - "src/linux/vhangup.c", - "src/linux/vmsplice.c", - "src/linux/wait3.c", - "src/linux/wait4.c", - "src/linux/pwritev2.c", - "src/linux/xattr.c", - "src/locale/__lctrans.c", - "src/locale/__mo_lookup.c", - "src/locale/bind_textdomain_codeset.c", - "src/locale/c_locale.c", - "src/locale/catclose.c", - "src/locale/catgets.c", - "src/locale/catopen.c", - "src/locale/dcngettext.c", - "src/locale/duplocale.c", - "src/locale/freelocale.c", - "src/locale/iconv.c", - "src/locale/iconv_close.c", - "src/locale/langinfo.c", - "src/locale/locale_map.c", - "src/locale/localeconv.c", - "src/locale/newlocale.c", - "src/locale/pleval.c", - "src/locale/setlocale.c", - "src/locale/strcoll.c", - "src/locale/strtod_l.c", - "src/locale/wcstod_l.c", - "src/locale/strfmon.c", - "src/locale/strxfrm.c", - "src/locale/textdomain.c", - "src/locale/uselocale.c", - "src/locale/wcscoll.c", - "src/locale/wcsxfrm.c", - "src/malloc/mallocng/aligned_alloc.c", - "src/malloc/mallocng/donate.c", - "src/malloc/mallocng/free.c", - "src/malloc/mallocng/glue.h", - "src/malloc/mallocng/malloc_usable_size.c", - "src/malloc/mallocng/malloc.c", - "src/malloc/mallocng/meta.h", - "src/malloc/mallocng/realloc.c", - "src/malloc/free.c", - "src/malloc/libc_calloc.c", - "src/malloc/lite_malloc.c", - "src/malloc/memalign.c", - "src/malloc/posix_memalign.c", - "src/malloc/realloc.c", - "src/malloc/reallocarray.c", - "src/malloc/replaced.c", - "src/math/__cos.c", - "src/math/__cosdf.c", - "src/math/__cosl.c", - "src/math/__expo2.c", - "src/math/__expo2f.c", - "src/math/__fpclassify.c", - "src/math/__fpclassifyf.c", - "src/math/__fpclassifyl.c", - "src/math/__invtrigl.c", - "src/math/__math_divzero.c", - "src/math/__math_divzerof.c", - "src/math/__math_invalid.c", - "src/math/__math_invalidl.c", - "src/math/__math_invalidf.c", - "src/math/__math_oflow.c", - "src/math/__math_oflowf.c", - "src/math/__math_uflow.c", - "src/math/__math_uflowf.c", - "src/math/__math_xflow.c", - "src/math/__math_xflowf.c", - "src/math/__polevll.c", - "src/math/__rem_pio2.c", - "src/math/__rem_pio2_large.c", - "src/math/__rem_pio2f.c", - "src/math/__rem_pio2l.c", - "src/math/__signbit.c", - "src/math/__signbitf.c", - "src/math/__signbitl.c", - "src/math/__sin.c", - "src/math/__sindf.c", - "src/math/__sinl.c", - "src/math/__tan.c", - "src/math/__tandf.c", - "src/math/__tanl.c", - "src/math/acos.c", - "src/math/acosf.c", - "src/math/acosh.c", - "src/math/acoshf.c", - "src/math/acoshl.c", - "src/math/acosl.c", - "src/math/asin.c", - "src/math/asinf.c", - "src/math/asinh.c", - "src/math/asinhf.c", - "src/math/asinhl.c", - "src/math/asinl.c", - "src/math/atan.c", - "src/math/atan2.c", - "src/math/atan2f.c", - "src/math/atan2l.c", - "src/math/atanf.c", - "src/math/atanh.c", - "src/math/atanhf.c", - "src/math/atanhl.c", - "src/math/atanl.c", - "src/math/cbrt.c", - "src/math/cbrtf.c", - "src/math/cbrtl.c", - "src/math/ceil.c", - "src/math/ceilf.c", - "src/math/ceill.c", - "src/math/copysign.c", - "src/math/copysignf.c", - "src/math/copysignl.c", - "src/math/cos.c", - "src/math/cosf.c", - "src/math/cosh.c", - "src/math/coshf.c", - "src/math/coshl.c", - "src/math/cosl.c", - "src/math/erf.c", - "src/math/erff.c", - "src/math/erfl.c", - "src/math/exp.c", - "src/math/exp10.c", - "src/math/exp10f.c", - "src/math/exp10l.c", - "src/math/exp2.c", - "src/math/exp2f.c", - "src/math/exp2f_data.c", - "src/math/exp2l.c", - "src/math/exp_data.c", - "src/math/expf.c", - "src/math/expl.c", - "src/math/expm1.c", - "src/math/expm1f.c", - "src/math/expm1l.c", - "src/math/fabs.c", - "src/math/fabsf.c", - "src/math/fabsl.c", - "src/math/fdim.c", - "src/math/fdimf.c", - "src/math/fdiml.c", - "src/math/finite.c", - "src/math/finitef.c", - "src/math/floor.c", - "src/math/floorf.c", - "src/math/floorl.c", - "src/math/fma.c", - "src/math/fmaf.c", - "src/math/fmal.c", - "src/math/fmax.c", - "src/math/fmaxf.c", - "src/math/fmaxl.c", - "src/math/fmin.c", - "src/math/fminf.c", - "src/math/fminl.c", - "src/math/fmod.c", - "src/math/fmodf.c", - "src/math/fmodl.c", - "src/math/frexp.c", - "src/math/frexpf.c", - "src/math/frexpl.c", - "src/math/hypot.c", - "src/math/hypotf.c", - "src/math/hypotl.c", - "src/math/ilogb.c", - "src/math/ilogbf.c", - "src/math/ilogbl.c", - "src/math/j0.c", - "src/math/j0f.c", - "src/math/j1.c", - "src/math/j1f.c", - "src/math/jn.c", - "src/math/jnf.c", - "src/math/ldexp.c", - "src/math/ldexpf.c", - "src/math/ldexpl.c", - "src/math/lgamma.c", - "src/math/lgamma_r.c", - "src/math/lgammaf.c", - "src/math/lgammaf_r.c", - "src/math/lgammal.c", - "src/math/llrint.c", - "src/math/llrintf.c", - "src/math/llrintl.c", - "src/math/llround.c", - "src/math/llroundf.c", - "src/math/llroundl.c", - "src/math/log.c", - "src/math/log10.c", - "src/math/log10f.c", - "src/math/log10l.c", - "src/math/log1p.c", - "src/math/log1pf.c", - "src/math/log1pl.c", - "src/math/log2.c", - "src/math/log2_data.c", - "src/math/log2f.c", - "src/math/log2f_data.c", - "src/math/log2l.c", - "src/math/log_data.c", - "src/math/logb.c", - "src/math/logbf.c", - "src/math/logbl.c", - "src/math/logf.c", - "src/math/logf_data.c", - "src/math/logl.c", - "src/math/lrint.c", - "src/math/lrintf.c", - "src/math/lrintl.c", - "src/math/lround.c", - "src/math/lroundf.c", - "src/math/lroundl.c", - "src/math/modf.c", - "src/math/modff.c", - "src/math/modfl.c", - "src/math/nan.c", - "src/math/nanf.c", - "src/math/nanl.c", - "src/math/nearbyint.c", - "src/math/nearbyintf.c", - "src/math/nearbyintl.c", - "src/math/nextafter.c", - "src/math/nextafterf.c", - "src/math/nextafterl.c", - "src/math/nexttoward.c", - "src/math/nexttowardf.c", - "src/math/nexttowardl.c", - "src/math/pow.c", - "src/math/pow_data.c", - "src/math/powf.c", - "src/math/powf_data.c", - "src/math/powl.c", - "src/math/remainder.c", - "src/math/remainderf.c", - "src/math/remainderl.c", - "src/math/remquo.c", - "src/math/remquof.c", - "src/math/remquol.c", - "src/math/rint.c", - "src/math/rintf.c", - "src/math/rintl.c", - "src/math/round.c", - "src/math/roundf.c", - "src/math/roundl.c", - "src/math/scalb.c", - "src/math/scalbf.c", - "src/math/scalbln.c", - "src/math/scalblnf.c", - "src/math/scalblnl.c", - "src/math/scalbn.c", - "src/math/scalbnf.c", - "src/math/scalbnl.c", - "src/math/signgam.c", - "src/math/significand.c", - "src/math/significandf.c", - "src/math/sin.c", - "src/math/sincos.c", - "src/math/sincosf.c", - "src/math/sincosl.c", - "src/math/sinf.c", - "src/math/sinh.c", - "src/math/sinhf.c", - "src/math/sinhl.c", - "src/math/sinl.c", - "src/math/sqrt_data.c", - "src/math/sqrt.c", - "src/math/sqrtf.c", - "src/math/sqrtl.c", - "src/math/tan.c", - "src/math/tanf.c", - "src/math/tanh.c", - "src/math/tanhf.c", - "src/math/tanhl.c", - "src/math/tanl.c", - "src/math/tgamma.c", - "src/math/tgammaf.c", - "src/math/tgammal.c", - "src/math/trunc.c", - "src/math/truncf.c", - "src/math/truncl.c", - "src/misc/a64l.c", - "src/misc/basename.c", - "src/misc/dirname.c", - "src/misc/ffs.c", - "src/misc/ffsl.c", - "src/misc/ffsll.c", - "src/misc/fmtmsg.c", - "src/misc/forkpty.c", - "src/misc/get_current_dir_name.c", - "src/misc/getauxval.c", - "src/misc/getdomainname.c", - "src/misc/getentropy.c", - "src/misc/gethostid.c", - "src/misc/getopt.c", - "src/misc/getopt_long.c", - "src/misc/getpriority.c", - "src/misc/getresgid.c", - "src/misc/getresuid.c", - "src/misc/getrlimit.c", - "src/misc/getrusage.c", - "src/misc/getsubopt.c", - "src/misc/initgroups.c", - "src/misc/ioctl.c", - "src/misc/issetugid.c", - "src/misc/lockf.c", - "src/misc/login_tty.c", - "src/misc/mntent.c", - "src/misc/nftw.c", - "src/misc/openpty.c", - "src/misc/ptsname.c", - "src/misc/pty.c", - "src/misc/realpath.c", - "src/misc/setdomainname.c", - "src/misc/setpriority.c", - "src/misc/setrlimit.c", - "src/misc/syscall.c", - "src/misc/syslog.c", - "src/misc/uname.c", - "src/misc/wordexp.c", - "src/mman/madvise.c", - "src/mman/mincore.c", - "src/mman/mlock.c", - "src/mman/mlockall.c", - "src/mman/mmap.c", - "src/mman/mprotect.c", - "src/mman/mremap.c", - "src/mman/msync.c", - "src/mman/munlock.c", - "src/mman/munlockall.c", - "src/mman/munmap.c", - "src/mman/posix_madvise.c", - "src/mman/shm_open.c", - "src/mq/mq_close.c", - "src/mq/mq_getattr.c", - "src/mq/mq_notify.c", - "src/mq/mq_open.c", - "src/mq/mq_receive.c", - "src/mq/mq_send.c", - "src/mq/mq_setattr.c", - "src/mq/mq_timedreceive.c", - "src/mq/mq_timedsend.c", - "src/mq/mq_unlink.c", - "src/multibyte/btowc.c", - "src/multibyte/c16rtomb.c", - "src/multibyte/c32rtomb.c", - "src/multibyte/internal.c", - "src/multibyte/mblen.c", - "src/multibyte/mbrlen.c", - "src/multibyte/mbrtoc16.c", - "src/multibyte/mbrtoc32.c", - "src/multibyte/mbrtowc.c", - "src/multibyte/mbsinit.c", - "src/multibyte/mbsnrtowcs.c", - "src/multibyte/mbsrtowcs.c", - "src/multibyte/mbstowcs.c", - "src/multibyte/mbtowc.c", - "src/multibyte/wcrtomb.c", - "src/multibyte/wcsnrtombs.c", - "src/multibyte/wcsrtombs.c", - "src/multibyte/wcstombs.c", - "src/multibyte/wctob.c", - "src/multibyte/wctomb.c", - "src/network/accept.c", - "src/network/accept4.c", - "src/network/bind.c", - "src/network/connect.c", - "src/network/dn_comp.c", - "src/network/dn_expand.c", - "src/network/dn_skipname.c", - "src/network/dns_parse.c", - "src/network/ent.c", - "src/network/ether.c", - "src/network/freeaddrinfo.c", - "src/network/gai_strerror.c", - "src/network/getaddrinfo.c", - "src/network/gethostbyaddr.c", - "src/network/gethostbyaddr_r.c", - "src/network/gethostbyname.c", - "src/network/gethostbyname2.c", - "src/network/gethostbyname2_r.c", - "src/network/gethostbyname_r.c", - "src/network/getifaddrs.c", - "src/network/getnameinfo.c", - "src/network/getpeername.c", - "src/network/getservbyname.c", - "src/network/getservbyname_r.c", - "src/network/getservbyport.c", - "src/network/getservbyport_r.c", - "src/network/getsockname.c", - "src/network/getsockopt.c", - "src/network/h_errno.c", - "src/network/herror.c", - "src/network/hstrerror.c", - "src/network/htonl.c", - "src/network/htons.c", - "src/network/if_freenameindex.c", - "src/network/if_indextoname.c", - "src/network/if_nameindex.c", - "src/network/if_nametoindex.c", - "src/network/in6addr_any.c", - "src/network/in6addr_loopback.c", - "src/network/inet_addr.c", - "src/network/inet_aton.c", - "src/network/inet_legacy.c", - "src/network/inet_ntoa.c", - "src/network/inet_ntop.c", - "src/network/inet_pton.c", - "src/network/listen.c", - "src/network/lookup_ipliteral.c", - "src/network/lookup_name.c", - "src/network/lookup_serv.c", - "src/network/netlink.c", - "src/network/netname.c", - "src/network/ns_parse.c", - "src/network/ntohl.c", - "src/network/ntohs.c", - "src/network/proto.c", - "src/network/recv.c", - "src/network/recvfrom.c", - "src/network/recvmmsg.c", - "src/network/recvmsg.c", - "src/network/res_cache.c", - "src/network/res_init.c", - "src/network/res_mkquery.c", - "src/network/res_msend.c", - "src/network/res_query.c", - "src/network/res_querydomain.c", - "src/network/res_send.c", - "src/network/res_state.c", - "src/network/resolvconf.c", - "src/network/send.c", - "src/network/sendmmsg.c", - "src/network/sendmsg.c", - "src/network/sendto.c", - "src/network/serv.c", - "src/network/setsockopt.c", - "src/network/shutdown.c", - "src/network/sockatmark.c", - "src/network/socket.c", - "src/network/socketpair.c", - "src/passwd/fgetgrent.c", - "src/passwd/fgetpwent.c", - "src/passwd/fgetspent.c", - "src/passwd/getgr_a.c", - "src/passwd/getgr_r.c", - "src/passwd/getgrent.c", - "src/passwd/getgrent_a.c", - "src/passwd/getgrouplist.c", - "src/passwd/getpw_a.c", - "src/passwd/getpw_r.c", - "src/passwd/getpwent.c", - "src/passwd/getpwent_a.c", - "src/passwd/getspent.c", - "src/passwd/getspnam.c", - "src/passwd/getspnam_r.c", - "src/passwd/lckpwdf.c", - "src/passwd/nscd_query.c", - "src/passwd/putgrent.c", - "src/passwd/putpwent.c", - "src/passwd/putspent.c", - "src/prng/__rand48_step.c", - "src/prng/__seed48.c", - "src/prng/drand48.c", - "src/prng/lcong48.c", - "src/prng/lrand48.c", - "src/prng/mrand48.c", - "src/prng/rand.c", - "src/prng/rand_r.c", - "src/prng/random.c", - "src/prng/seed48.c", - "src/prng/srand48.c", - "src/process/execl.c", - "src/process/execle.c", - "src/process/execlp.c", - "src/process/execv.c", - "src/process/execve.c", - "src/process/execvp.c", - "src/process/fexecve.c", - "src/process/fork.c", - "src/process/_Fork.c", - "src/process/posix_spawn.c", - "src/process/posix_spawn_file_actions_addchdir.c", - "src/process/posix_spawn_file_actions_addclose.c", - "src/process/posix_spawn_file_actions_adddup2.c", - "src/process/posix_spawn_file_actions_addfchdir.c", - "src/process/posix_spawn_file_actions_addopen.c", - "src/process/posix_spawn_file_actions_destroy.c", - "src/process/posix_spawn_file_actions_init.c", - "src/process/posix_spawnattr_destroy.c", - "src/process/posix_spawnattr_getflags.c", - "src/process/posix_spawnattr_getpgroup.c", - "src/process/posix_spawnattr_getsigdefault.c", - "src/process/posix_spawnattr_getsigmask.c", - "src/process/posix_spawnattr_init.c", - "src/process/posix_spawnattr_sched.c", - "src/process/posix_spawnattr_setflags.c", - "src/process/posix_spawnattr_setpgroup.c", - "src/process/posix_spawnattr_setsigdefault.c", - "src/process/posix_spawnattr_setsigmask.c", - "src/process/posix_spawnp.c", - "src/process/system.c", - "src/process/vfork.c", - "src/process/wait.c", - "src/process/waitid.c", - "src/process/waitpid.c", - "src/regex/fnmatch.c", - "src/regex/glob.c", - "src/regex/regcomp.c", - "src/regex/regerror.c", - "src/regex/regexec.c", - "src/regex/tre-mem.c", - "src/syscall_hooks/syscall_hooks.c", - "src/sched/sched_cpualloc.c", - "src/sched/affinity.c", - "src/sched/sched_cpucount.c", - "src/sched/sched_get_priority_max.c", - "src/sched/sched_getcpu.c", - "src/sched/sched_getparam.c", - "src/sched/sched_getscheduler.c", - "src/sched/sched_rr_get_interval.c", - "src/sched/sched_setparam.c", - "src/sched/sched_setscheduler.c", - "src/sched/sched_yield.c", - "src/search/hsearch.c", - "src/search/insque.c", - "src/search/lsearch.c", - "src/search/tdelete.c", - "src/search/tdestroy.c", - "src/search/tfind.c", - "src/search/tsearch.c", - "src/search/twalk.c", - "src/select/poll.c", - "src/select/ppoll.c", - "src/select/pselect.c", - "src/select/select.c", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/block.c", - "src/signal/getitimer.c", - "src/signal/kill.c", - "src/signal/killpg.c", - "src/signal/psiginfo.c", - "src/signal/psignal.c", - "src/signal/raise.c", - "src/signal/restore.c", - "src/signal/setitimer.c", - "src/signal/sigaction.c", - "src/signal/sigaddset.c", - "src/signal/sigaltstack.c", - "src/signal/sigandset.c", - "src/signal/sigdelset.c", - "src/signal/sigemptyset.c", - "src/signal/sigfillset.c", - "src/signal/sighold.c", - "src/signal/sigignore.c", - "src/signal/siginterrupt.c", - "src/signal/sigisemptyset.c", - "src/signal/sigismember.c", - "src/signal/siglongjmp.c", - "src/signal/signal.c", - "src/signal/sigorset.c", - "src/signal/sigpause.c", - "src/signal/sigpending.c", - "src/signal/sigprocmask.c", - "src/signal/sigqueue.c", - "src/signal/sigrelse.c", - "src/signal/sigrtmax.c", - "src/signal/sigrtmin.c", - "src/signal/sigset.c", - "src/signal/sigsetjmp.c", - "src/signal/sigsetjmp_tail.c", - "src/signal/sigsuspend.c", - "src/signal/sigtimedwait.c", - "src/signal/sigwait.c", - "src/signal/sigwaitinfo.c", - "src/stat/__xstat.c", - "src/stat/chmod.c", - "src/stat/fchmod.c", - "src/stat/fchmodat.c", - "src/stat/fstat.c", - "src/stat/fstatat.c", - "src/stat/futimens.c", - "src/stat/futimesat.c", - "src/stat/lchmod.c", - "src/stat/lstat.c", - "src/stat/mkdir.c", - "src/stat/mkdirat.c", - "src/stat/mkfifo.c", - "src/stat/mkfifoat.c", - "src/stat/mknod.c", - "src/stat/mknodat.c", - "src/stat/stat.c", - "src/stat/statvfs.c", - "src/stat/umask.c", - "src/stat/utimensat.c", - "src/stdio/__fclose_ca.c", - "src/stdio/__fdopen.c", - "src/stdio/__fmodeflags.c", - "src/stdio/__fopen_rb_ca.c", - "src/stdio/__lockfile.c", - "src/stdio/__overflow.c", - "src/stdio/__stdio_close.c", - "src/stdio/__stdio_exit.c", - "src/stdio/__stdio_read.c", - "src/stdio/__stdio_seek.c", - "src/stdio/__stdio_write.c", - "src/stdio/__stdout_write.c", - "src/stdio/__toread.c", - "src/stdio/__towrite.c", - "src/stdio/__uflow.c", - "src/stdio/asprintf.c", - "src/stdio/clearerr.c", - "src/stdio/dprintf.c", - "src/stdio/ext.c", - "src/stdio/ext2.c", - "src/stdio/fclose.c", - "src/stdio/feof.c", - "src/stdio/ferror.c", - "src/stdio/fflush.c", - "src/stdio/fgetc.c", - "src/stdio/fgetln.c", - "src/stdio/fgetpos.c", - "src/stdio/fgets.c", - "src/stdio/fgetwc.c", - "src/stdio/fgetws.c", - "src/stdio/fileno.c", - "src/stdio/flockfile.c", - "src/stdio/fmemopen.c", - "src/stdio/fopen.c", - "src/stdio/fopencookie.c", - "src/stdio/fprintf.c", - "src/stdio/fputc.c", - "src/stdio/fputs.c", - "src/stdio/fputwc.c", - "src/stdio/fputws.c", - "src/stdio/fread.c", - "src/stdio/freopen.c", - "src/stdio/fscanf.c", - "src/stdio/fseek.c", - "src/stdio/fsetpos.c", - "src/stdio/ftell.c", - "src/stdio/ftrylockfile.c", - "src/stdio/funlockfile.c", - "src/stdio/fwide.c", - "src/stdio/fwprintf.c", - "src/stdio/fwrite.c", - "src/stdio/fwscanf.c", - "src/stdio/getc.c", - "src/stdio/getc_unlocked.c", - "src/stdio/getchar.c", - "src/stdio/getchar_unlocked.c", - "src/stdio/getdelim.c", - "src/stdio/getline.c", - "src/stdio/gets.c", - "src/stdio/getw.c", - "src/stdio/getwc.c", - "src/stdio/getwchar.c", - "src/stdio/ofl.c", - "src/stdio/ofl_add.c", - "src/stdio/open_memstream.c", - "src/stdio/open_wmemstream.c", - "src/stdio/pclose.c", - "src/stdio/perror.c", - "src/stdio/popen.c", - "src/stdio/printf.c", - "src/stdio/putc.c", - "src/stdio/putc_unlocked.c", - "src/stdio/putchar.c", - "src/stdio/putchar_unlocked.c", - "src/stdio/puts.c", - "src/stdio/putw.c", - "src/stdio/putwc.c", - "src/stdio/putwchar.c", - "src/stdio/remove.c", - "src/stdio/rename.c", - "src/stdio/rewind.c", - "src/stdio/scanf.c", - "src/stdio/setbuf.c", - "src/stdio/setbuffer.c", - "src/stdio/setlinebuf.c", - "src/stdio/setvbuf.c", - "src/stdio/snprintf.c", - "src/stdio/sprintf.c", - "src/stdio/sscanf.c", - "src/stdio/stderr.c", - "src/stdio/stdin.c", - "src/stdio/stdout.c", - "src/stdio/swprintf.c", - "src/stdio/swscanf.c", - "src/stdio/tempnam.c", - "src/stdio/tmpfile.c", - "src/stdio/tmpnam.c", - "src/stdio/ungetc.c", - "src/stdio/ungetwc.c", - "src/stdio/vasprintf.c", - "src/stdio/vdprintf.c", - "src/stdio/vfprintf.c", - "src/stdio/vfscanf.c", - "src/stdio/vfwprintf.c", - "src/stdio/vfwscanf.c", - "src/stdio/vprintf.c", - "src/stdio/vscanf.c", - "src/stdio/vsnprintf.c", - "src/stdio/vsprintf.c", - "src/stdio/vsscanf.c", - "src/stdio/vswprintf.c", - "src/stdio/vswscanf.c", - "src/stdio/vwprintf.c", - "src/stdio/vwscanf.c", - "src/stdio/wprintf.c", - "src/stdio/wscanf.c", - "src/stdlib/abs.c", - "src/stdlib/atof.c", - "src/stdlib/atoi.c", - "src/stdlib/atol.c", - "src/stdlib/atoll.c", - "src/stdlib/bsearch.c", - "src/stdlib/div.c", - "src/stdlib/ecvt.c", - "src/stdlib/fcvt.c", - "src/stdlib/gcvt.c", - "src/stdlib/imaxabs.c", - "src/stdlib/imaxdiv.c", - "src/stdlib/labs.c", - "src/stdlib/ldiv.c", - "src/stdlib/llabs.c", - "src/stdlib/lldiv.c", - "src/stdlib/qsort.c", - "src/stdlib/qsort_nr.c", - "src/stdlib/strtod.c", - "src/stdlib/strtol.c", - "src/stdlib/wcstod.c", - "src/stdlib/wcstol.c", - "src/string/strcspn.c", - "src/string/bcmp.c", - "src/string/bcopy.c", - "src/string/bzero.c", - "src/string/explicit_bzero.c", - "src/string/index.c", - "src/string/memccpy.c", - "src/string/memchr.c", - "src/string/memcmp.c", - "src/string/memcpy.c", - "src/string/memmem.c", - "src/string/memmove.c", - "src/string/mempcpy.c", - "src/string/memrchr.c", - "src/string/memset.c", - "src/string/rindex.c", - "src/string/stpcpy.c", - "src/string/stpncpy.c", - "src/string/strcasecmp.c", - "src/string/strcat.c", - "src/string/strchr.c", - "src/string/strchrnul.c", - "src/string/strcmp.c", - "src/string/strcpy.c", - "src/string/strdup.c", - "src/string/strerror_r.c", - "src/string/strlcat.c", - "src/string/strlcpy.c", - "src/string/strlen.c", - "src/string/strncasecmp.c", - "src/string/strncat.c", - "src/string/strncmp.c", - "src/string/strncpy.c", - "src/string/strndup.c", - "src/string/strnlen.c", - "src/string/strpbrk.c", - "src/string/strrchr.c", - "src/string/strsep.c", - "src/string/strsignal.c", - "src/string/strspn.c", - "src/string/strstr.c", - "src/string/strtok.c", - "src/string/strtok_r.c", - "src/string/strverscmp.c", - "src/string/swab.c", - "src/string/wcpcpy.c", - "src/string/wcpncpy.c", - "src/string/wcscasecmp.c", - "src/string/wcscasecmp_l.c", - "src/string/wcscat.c", - "src/string/wcschr.c", - "src/string/wcscmp.c", - "src/string/wcscpy.c", - "src/string/wcscspn.c", - "src/string/wcsdup.c", - "src/string/wcslen.c", - "src/string/wcsncasecmp.c", - "src/string/wcsncasecmp_l.c", - "src/string/wcsncat.c", - "src/string/wcsncmp.c", - "src/string/wcsncpy.c", - "src/string/wcsnlen.c", - "src/string/wcspbrk.c", - "src/string/wcsrchr.c", - "src/string/wcsspn.c", - "src/string/wcsstr.c", - "src/string/wcstok.c", - "src/string/wcswcs.c", - "src/string/wmemchr.c", - "src/string/wmemcmp.c", - "src/string/wmemcpy.c", - "src/string/wmemmove.c", - "src/string/wmemset.c", - "src/temp/__randname.c", - "src/temp/mkdtemp.c", - "src/temp/mkostemp.c", - "src/temp/mkostemps.c", - "src/temp/mkstemp.c", - "src/temp/mkstemps.c", - "src/temp/mktemp.c", - "src/termios/cfgetospeed.c", - "src/termios/cfmakeraw.c", - "src/termios/cfsetospeed.c", - "src/termios/tcdrain.c", - "src/termios/tcflow.c", - "src/termios/tcflush.c", - "src/termios/tcgetattr.c", - "src/termios/tcgetsid.c", - "src/termios/tcgetwinsize.c", - "src/termios/tcsendbreak.c", - "src/termios/tcsetattr.c", - "src/termios/tcsetwinsize.c", - "src/thread/__lock.c", - "src/thread/__set_thread_area.c", - "src/thread/__syscall_cp.c", - "src/thread/__timedwait.c", - "src/thread/__tls_get_addr.c", - "src/thread/__unmapself.c", - "src/thread/__wait.c", - "src/thread/call_once.c", - "src/thread/clone.c", - "src/thread/cnd_broadcast.c", - "src/thread/cnd_destroy.c", - "src/thread/cnd_init.c", - "src/thread/cnd_signal.c", - "src/thread/cnd_timedwait.c", - "src/thread/cnd_wait.c", - "src/thread/default_attr.c", - "src/thread/lock_ptc.c", - "src/thread/mtx_destroy.c", - "src/thread/mtx_init.c", - "src/thread/mtx_lock.c", - "src/thread/mtx_timedlock.c", - "src/thread/mtx_trylock.c", - "src/thread/mtx_unlock.c", - "src/thread/pthread_atfork.c", - "src/thread/pthread_attr_destroy.c", - "src/thread/pthread_attr_get.c", - "src/thread/pthread_attr_init.c", - "src/thread/pthread_attr_setdetachstate.c", - "src/thread/pthread_attr_setguardsize.c", - "src/thread/pthread_attr_setinheritsched.c", - "src/thread/pthread_attr_setschedparam.c", - "src/thread/pthread_attr_setschedpolicy.c", - "src/thread/pthread_attr_setscope.c", - "src/thread/pthread_attr_setstack.c", - "src/thread/pthread_attr_setstacksize.c", - "src/thread/pthread_barrier_destroy.c", - "src/thread/pthread_barrier_init.c", - "src/thread/pthread_barrier_wait.c", - "src/thread/pthread_barrierattr_destroy.c", - "src/thread/pthread_barrierattr_init.c", - "src/thread/pthread_barrierattr_setpshared.c", - "src/thread/pthread_cancel.c", - "src/thread/pthread_cleanup_push.c", - "src/thread/pthread_cond_broadcast.c", - "src/thread/pthread_cond_destroy.c", - "src/thread/pthread_cond_init.c", - "src/thread/pthread_cond_signal.c", - "src/thread/pthread_cond_timedwait.c", - "src/thread/pthread_cond_wait.c", - "src/thread/pthread_condattr_destroy.c", - "src/thread/pthread_condattr_init.c", - "src/thread/pthread_condattr_setclock.c", - "src/thread/pthread_condattr_setpshared.c", - "src/thread/pthread_create.c", - "src/thread/pthread_detach.c", - "src/thread/pthread_equal.c", - "src/thread/pthread_getattr_np.c", - "src/thread/pthread_getconcurrency.c", - "src/thread/pthread_getcpuclockid.c", - "src/thread/pthread_getname_np.c", - "src/thread/pthread_getschedparam.c", - "src/thread/pthread_getspecific.c", - "src/thread/pthread_join.c", - "src/thread/pthread_key_create.c", - "src/thread/pthread_kill.c", - "src/thread/pthread_mutex_consistent.c", - "src/thread/pthread_mutex_destroy.c", - "src/thread/pthread_mutex_getprioceiling.c", - "src/thread/pthread_mutex_init.c", - "src/thread/pthread_mutex_lock.c", - "src/thread/pthread_mutex_setprioceiling.c", - "src/thread/pthread_mutex_timedlock.c", - "src/thread/pthread_mutex_trylock.c", - "src/thread/pthread_mutex_unlock.c", - "src/thread/pthread_mutexattr_destroy.c", - "src/thread/pthread_mutexattr_init.c", - "src/thread/pthread_mutexattr_setprotocol.c", - "src/thread/pthread_mutexattr_setpshared.c", - "src/thread/pthread_mutexattr_setrobust.c", - "src/thread/pthread_mutexattr_settype.c", - "src/thread/pthread_once.c", - "src/thread/pthread_rwlock_destroy.c", - "src/thread/pthread_rwlock_init.c", - "src/thread/pthread_rwlock_rdlock.c", - "src/thread/pthread_rwlock_tryrdlock.c", - "src/thread/pthread_rwlock_trywrlock.c", - "src/thread/pthread_rwlock_unlock.c", - "src/thread/pthread_rwlock_wrlock.c", - "src/thread/pthread_rwlockattr_destroy.c", - "src/thread/pthread_rwlockattr_init.c", - "src/thread/pthread_rwlockattr_setpshared.c", - "src/thread/pthread_self.c", - "src/thread/pthread_setattr_default_np.c", - "src/thread/pthread_setcancelstate.c", - "src/thread/pthread_setcanceltype.c", - "src/thread/pthread_setconcurrency.c", - "src/thread/pthread_setname_np.c", - "src/thread/pthread_setschedparam.c", - "src/thread/pthread_setschedprio.c", - "src/thread/pthread_setspecific.c", - "src/thread/pthread_sigmask.c", - "src/thread/pthread_spin_destroy.c", - "src/thread/pthread_spin_init.c", - "src/thread/pthread_spin_lock.c", - "src/thread/pthread_spin_trylock.c", - "src/thread/pthread_spin_unlock.c", - "src/thread/pthread_testcancel.c", - "src/thread/sem_destroy.c", - "src/thread/sem_getvalue.c", - "src/thread/sem_init.c", - "src/thread/sem_open.c", - "src/thread/sem_post.c", - "src/thread/sem_timedwait.c", - "src/thread/sem_trywait.c", - "src/thread/sem_unlink.c", - "src/thread/sem_wait.c", - "src/thread/synccall.c", - "src/thread/syscall_cp.c", - "src/thread/thrd_create.c", - "src/thread/thrd_exit.c", - "src/thread/thrd_join.c", - "src/thread/thrd_sleep.c", - "src/thread/thrd_yield.c", - "src/thread/tls.c", - "src/thread/tss_create.c", - "src/thread/tss_delete.c", - "src/thread/tss_set.c", - "src/thread/vmlock.c", - "src/time/__map_file.c", - "src/time/__month_to_secs.c", - "src/time/__secs_to_tm.c", - "src/time/__tm_to_secs.c", - "src/time/__tz.c", - "src/time/__year_to_secs.c", - "src/time/asctime.c", - "src/time/asctime_r.c", - "src/time/clock.c", - "src/time/clock_getcpuclockid.c", - "src/time/clock_getres.c", - "src/time/clock_gettime.c", - "src/time/clock_nanosleep.c", - "src/time/clock_settime.c", - "src/time/ctime.c", - "src/time/ctime_r.c", - "src/time/difftime.c", - "src/time/ftime.c", - "src/time/getdate.c", - "src/time/gettimeofday.c", - "src/time/gmtime.c", - "src/time/gmtime_r.c", - "src/time/localtime.c", - "src/time/localtime_r.c", - "src/time/mktime.c", - "src/time/nanosleep.c", - "src/time/strftime.c", - "src/time/strptime.c", - "src/time/time.c", - "src/time/timegm.c", - "src/time/timer_create.c", - "src/time/timer_delete.c", - "src/time/timer_getoverrun.c", - "src/time/timer_gettime.c", - "src/time/timer_settime.c", - "src/time/times.c", - "src/time/timespec_get.c", - "src/time/utime.c", - "src/time/wcsftime.c", - "src/unistd/_exit.c", - "src/unistd/access.c", - "src/unistd/acct.c", - "src/unistd/alarm.c", - "src/unistd/chdir.c", - "src/unistd/chown.c", - "src/unistd/close.c", - "src/unistd/ctermid.c", - "src/unistd/dup.c", - "src/unistd/dup2.c", - "src/unistd/dup3.c", - "src/unistd/faccessat.c", - "src/unistd/fchdir.c", - "src/unistd/fchown.c", - "src/unistd/fchownat.c", - "src/unistd/fdatasync.c", - "src/unistd/fsync.c", - "src/unistd/ftruncate.c", - "src/unistd/getcwd.c", - "src/unistd/getegid.c", - "src/unistd/geteuid.c", - "src/unistd/getgid.c", - "src/unistd/getgroups.c", - "src/unistd/gethostname.c", - "src/unistd/getlogin.c", - "src/unistd/getlogin_r.c", - "src/unistd/getpgid.c", - "src/unistd/getpgrp.c", - "src/unistd/getpid.c", - "src/unistd/getppid.c", - "src/unistd/getsid.c", - "src/unistd/getuid.c", - "src/unistd/isatty.c", - "src/unistd/lchown.c", - "src/unistd/link.c", - "src/unistd/linkat.c", - "src/unistd/lseek.c", - "src/unistd/nice.c", - "src/unistd/pause.c", - "src/unistd/pipe.c", - "src/unistd/pipe2.c", - "src/unistd/posix_close.c", - "src/unistd/pread.c", - "src/unistd/preadv.c", - "src/unistd/pwrite.c", - "src/unistd/pwritev.c", - "src/unistd/read.c", - "src/unistd/readlink.c", - "src/unistd/readlinkat.c", - "src/unistd/readv.c", - "src/unistd/renameat.c", - "src/unistd/rmdir.c", - "src/unistd/setegid.c", - "src/unistd/seteuid.c", - "src/unistd/setgid.c", - "src/unistd/setpgid.c", - "src/unistd/setpgrp.c", - "src/unistd/setregid.c", - "src/unistd/setresgid.c", - "src/unistd/setresuid.c", - "src/unistd/setreuid.c", - "src/unistd/setsid.c", - "src/unistd/setuid.c", - "src/unistd/setxid.c", - "src/unistd/sleep.c", - "src/unistd/symlink.c", - "src/unistd/symlinkat.c", - "src/unistd/sync.c", - "src/unistd/tcgetpgrp.c", - "src/unistd/tcsetpgrp.c", - "src/unistd/truncate.c", - "src/unistd/ttyname.c", - "src/unistd/ttyname_r.c", - "src/unistd/ualarm.c", - "src/unistd/unlink.c", - "src/unistd/unlinkat.c", - "src/unistd/usleep.c", - "src/unistd/write.c", - "src/unistd/writev.c", - "src/trace/trace_marker.c", - "src/info/application_target_sdk_version.c", - "src/info/device_api_version.c", - "src/info/fatal_message.c", - "arch/generic/crtbrand.s", - "crt/crtplus.c", - "ldso/namespace.h", - "ldso/ns_config.h", - "ldso/strops.h", - "ldso/cfi.h", - "ldso/ld_log.h", - "ldso/dynlink_rand.h", - "src/internal/vdso.c", - "src/internal/emulate_wait4.c", - "src/internal/malloc_config.h", - "src/internal/malloc_random.h", - "src/internal/hilog_adapter.h", - "src/internal/musl_log.h", - "src/internal/musl_log.c", - "src/internal/network_conf_function.c", - "src/internal/network_conf_function.h", - "src/internal/services.h", - "src/internal/proc_xid_impl.h", - "src/linux/tgkill.c", - "src/malloc/calloc.c", - "src/malloc/stats.c", - "src/sigchain/sigchain.c", - "src/thread/pthread_cond_clockwait.c", - "src/thread/pthread_cond_timedwait_monotonic_np.c", - "src/thread/pthread_cond_timeout_np.c", - "src/thread/pthread_mutex_clocklock.c", - "src/thread/pthread_mutex_timedlock_monotonic_np.c", - "src/thread/pthread_mutex_lock_timeout_np.c", - "src/thread/pthread_rwlock_clockrdlock.c", - "src/thread/pthread_rwlock_timedrdlock_monotonic_np.c", - "src/thread/pthread_rwlock_clockwrlock.c", - "src/thread/pthread_rwlock_timedwrlock_monotonic_np.c", -] - -if (musl_arch == "arm") { - musl_src_filterout = [ - "src/fenv/fenv.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/math/fabs.c", - "src/math/fabsf.c", - "src/math/fma.c", - "src/math/fmaf.c", - "src/math/sqrt.c", - "src/math/sqrtf.c", - "src/process/arm/vfork.s", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/restore.c", - "src/signal/sigsetjmp.c", - "src/string/memcpy.c", - "src/thread/__set_thread_area.c", - "src/thread/__unmapself.c", - "src/thread/clone.c", - "src/thread/syscall_cp.c", - ] -} else if (musl_arch == "aarch64") { - musl_src_filterout = [ - "src/fenv/fenv.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/math/ceil.c", - "src/math/ceilf.c", - "src/math/fabs.c", - "src/math/fabsf.c", - "src/math/floor.c", - "src/math/floorf.c", - "src/math/fma.c", - "src/math/fmaf.c", - "src/math/fmax.c", - "src/math/fmaxf.c", - "src/math/fmin.c", - "src/math/fminf.c", - "src/math/llrint.c", - "src/math/llrintf.c", - "src/math/llround.c", - "src/math/llroundf.c", - "src/math/lrint.c", - "src/math/lrintf.c", - "src/math/lround.c", - "src/math/lroundf.c", - "src/math/nearbyint.c", - "src/math/nearbyintf.c", - "src/math/rint.c", - "src/math/rintf.c", - "src/math/round.c", - "src/math/roundf.c", - "src/math/sqrt.c", - "src/math/sqrtf.c", - "src/math/trunc.c", - "src/math/truncf.c", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/restore.c", - "src/signal/sigsetjmp.c", - "src/thread/__set_thread_area.c", - "src/thread/__unmapself.c", - "src/thread/clone.c", - "src/thread/syscall_cp.c", - "src/misc/syscall.c", - ] -} else if (musl_arch == "x86_64") { - musl_src_filterout = [ - "src/fenv/fenv.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/math/__invtrigl.c", - "src/math/acosl.c", - "src/math/asinl.c", - "src/math/atan2l.c", - "src/math/atanl.c", - "src/math/ceill.c", - "src/math/exp2l.c", - "src/math/expl.c", - "src/math/expm1l.c", - "src/math/fabs.c", - "src/math/fabsf.c", - "src/math/fabsl.c", - "src/math/floorl.c", - "src/math/fma.c", - "src/math/fmaf.c", - "src/math/fmodl.c", - "src/math/llrint.c", - "src/math/llrintf.c", - "src/math/llrintl.c", - "src/math/log1pl.c", - "src/math/log2l.c", - "src/math/log10l.c", - "src/math/logl.c", - "src/math/lrint.c", - "src/math/lrintf.c", - "src/math/lrintl.c", - "src/math/remainderl.c", - "src/math/rintl.c", - "src/math/sqrt.c", - "src/math/sqrtf.c", - "src/math/sqrtl.c", - "src/math/truncl.c", - "src/process/x86_64/vfork.s", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/restore.c", - "src/signal/sigsetjmp.c", - "src/string/memcpy.c", - "src/string/memmove.c", - "src/thread/__set_thread_area.c", - "src/thread/__unmapself.c", - "src/thread/clone.c", - "src/thread/syscall_cp.c", - ] -} else if (musl_arch == "mips") { - musl_src_filterout = [ - "src/fenv/fenv.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/math/fabs.c", - "src/math/fabsf.c", - "src/math/sqrt.c", - "src/math/sqrtf.c", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/restore.c", - "src/signal/sigsetjmp.c", - "src/thread/__unmapself.c", - "src/thread/clone.c", - "src/thread/syscall_cp.c", - "src/unistd/pipe.c", - ] -} else if (musl_arch == "riscv64") { - musl_src_filterout = [ - "src/fenv/fenv.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/math/fabs.c", - "src/math/fabsf.c", - "src/math/fma.c", - "src/math/fmaf.c", - "src/math/fmax.c", - "src/math/fmaxf.c", - "src/math/fmin.c", - "src/math/fminf.c", - "src/math/sqrt.c", - "src/math/sqrtf.c", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/restore.c", - "src/signal/sigsetjmp.c", - "src/thread/__set_thread_area.c", - "src/thread/__unmapself.c", - "src/thread/clone.c", - "src/thread/syscall_cp.c", - ] -} else if (musl_arch == "loongarch64") { - musl_src_filterout = [ - "src/fenv/fenv.c", - "src/ldso/dlsym.c", - "src/ldso/tlsdesc.c", - "src/setjmp/longjmp.c", - "src/setjmp/setjmp.c", - "src/signal/restore.c", - "src/signal/sigsetjmp.c", - "src/thread/__set_thread_area.c", - "src/thread/__unmapself.c", - "src/thread/clone.c", - "src/thread/syscall_cp.c", - ] -} - -musl_src_ldso = [ - "ldso/dlstart.c", - "ldso/dynlink.c", - "ldso/namespace.c", - "ldso/ns_config.c", - "ldso/strops.c", - "ldso/dynlink_rand.c", - "ldso/cfi.c", - "ldso/ld_log.c", -] - -if (musl_arch == "arm") { - musl_inc_bits_files = [ - "arch/arm/bits/fcntl.h", - "arch/arm/bits/fenv.h", - "arch/arm/bits/float.h", - "arch/arm/bits/hwcap.h", - "arch/arm/bits/ioctl_fix.h", - "arch/arm/bits/ipcstat.h", - "arch/arm/bits/msg.h", - "arch/arm/bits/posix.h", - "arch/arm/bits/ptrace.h", - "arch/arm/bits/reg.h", - "arch/arm/bits/sem.h", - "arch/arm/bits/setjmp.h", - "arch/arm/bits/shm.h", - "arch/arm/bits/signal.h", - "arch/arm/bits/stat.h", - "arch/arm/bits/stdint.h", - "arch/arm/bits/user.h", - - "arch/generic/bits/dirent.h", - "arch/generic/bits/errno.h", - "arch/generic/bits/ioctl.h", - "arch/generic/bits/io.h", - "arch/generic/bits/ipc.h", - "arch/generic/bits/kd.h", - "arch/generic/bits/limits.h", - "arch/generic/bits/link.h", - "arch/generic/bits/mman.h", - "arch/generic/bits/poll.h", - "arch/generic/bits/resource.h", - "arch/generic/bits/socket.h", - "arch/generic/bits/soundcard.h", - "arch/generic/bits/statfs.h", - "arch/generic/bits/termios.h", - "arch/generic/bits/vt.h", - ] -} else if (musl_arch == "aarch64") { - musl_inc_bits_files = [ - "arch/aarch64/bits/fcntl.h", - "arch/aarch64/bits/fenv.h", - "arch/aarch64/bits/float.h", - "arch/aarch64/bits/hwcap.h", - "arch/aarch64/bits/posix.h", - "arch/aarch64/bits/reg.h", - "arch/aarch64/bits/setjmp.h", - "arch/aarch64/bits/signal.h", - "arch/aarch64/bits/stat.h", - "arch/aarch64/bits/stdint.h", - "arch/aarch64/bits/user.h", - - "arch/generic/bits/dirent.h", - "arch/generic/bits/errno.h", - "arch/generic/bits/ioctl_fix.h", - "arch/generic/bits/ioctl.h", - "arch/generic/bits/io.h", - "arch/generic/bits/ipc.h", - "arch/generic/bits/ipcstat.h", - "arch/generic/bits/kd.h", - "arch/generic/bits/limits.h", - "arch/generic/bits/link.h", - "arch/generic/bits/mman.h", - "arch/generic/bits/msg.h", - "arch/generic/bits/poll.h", - "arch/generic/bits/ptrace.h", - "arch/generic/bits/resource.h", - "arch/generic/bits/sem.h", - "arch/generic/bits/shm.h", - "arch/generic/bits/socket.h", - "arch/generic/bits/soundcard.h", - "arch/generic/bits/statfs.h", - "arch/generic/bits/termios.h", - "arch/generic/bits/vt.h", - ] -} else if (musl_arch == "x86_64") { - musl_inc_bits_files = [ - "arch/generic/bits/fcntl.h", - "arch/x86_64/bits/fenv.h", - "arch/x86_64/bits/float.h", - "arch/x86_64/bits/posix.h", - "arch/x86_64/bits/reg.h", - "arch/x86_64/bits/setjmp.h", - "arch/x86_64/bits/signal.h", - "arch/x86_64/bits/stat.h", - "arch/x86_64/bits/stdint.h", - "arch/x86_64/bits/user.h", - "arch/generic/bits/dirent.h", - "arch/generic/bits/errno.h", - "arch/generic/bits/hwcap.h", - "arch/generic/bits/ioctl_fix.h", - "arch/generic/bits/ioctl.h", - "arch/generic/bits/io.h", - "arch/generic/bits/ipc.h", - "arch/generic/bits/ipcstat.h", - "arch/generic/bits/kd.h", - "arch/generic/bits/limits.h", - "arch/generic/bits/link.h", - "arch/generic/bits/mman.h", - "arch/generic/bits/msg.h", - "arch/generic/bits/poll.h", - "arch/generic/bits/ptrace.h", - "arch/generic/bits/resource.h", - "arch/generic/bits/sem.h", - "arch/generic/bits/shm.h", - "arch/generic/bits/socket.h", - "arch/generic/bits/soundcard.h", - "arch/generic/bits/statfs.h", - "arch/generic/bits/termios.h", - "arch/generic/bits/vt.h", - ] -} else if (musl_arch == "mips") { - musl_inc_bits_files = [ - "arch/generic/bits/fcntl.h", - "arch/mips/bits/fenv.h", - "arch/mips/bits/float.h", - "arch/mips/bits/posix.h", - "arch/mips/bits/reg.h", - "arch/mips/bits/setjmp.h", - "arch/mips/bits/signal.h", - "arch/mips/bits/stat.h", - "arch/mips/bits/stdint.h", - "arch/mips/bits/user.h", - - "arch/generic/bits/dirent.h", - "arch/generic/bits/errno.h", - "arch/generic/bits/hwcap.h", - "arch/generic/bits/ioctl_fix.h", - "arch/generic/bits/ioctl.h", - "arch/generic/bits/io.h", - "arch/generic/bits/ipc.h", - "arch/generic/bits/ipcstat.h", - "arch/generic/bits/kd.h", - "arch/generic/bits/limits.h", - "arch/generic/bits/link.h", - "arch/generic/bits/mman.h", - "arch/generic/bits/msg.h", - "arch/generic/bits/poll.h", - "arch/generic/bits/ptrace.h", - "arch/generic/bits/resource.h", - "arch/generic/bits/sem.h", - "arch/generic/bits/shm.h", - "arch/generic/bits/socket.h", - "arch/generic/bits/soundcard.h", - "arch/generic/bits/statfs.h", - "arch/generic/bits/termios.h", - "arch/generic/bits/vt.h", - ] -} else if (musl_arch == "riscv64") { - musl_inc_bits_files = [ - "arch/generic/bits/fcntl.h", - "arch/riscv64/bits/fenv.h", - "arch/riscv64/bits/float.h", - "arch/riscv64/bits/posix.h", - "arch/riscv64/bits/reg.h", - "arch/riscv64/bits/setjmp.h", - "arch/riscv64/bits/signal.h", - "arch/riscv64/bits/stat.h", - "arch/riscv64/bits/stdint.h", - "arch/riscv64/bits/user.h", - - "arch/generic/bits/dirent.h", - "arch/generic/bits/errno.h", - "arch/generic/bits/hwcap.h", - "arch/generic/bits/ioctl_fix.h", - "arch/generic/bits/ioctl.h", - "arch/generic/bits/io.h", - "arch/generic/bits/ipc.h", - "arch/generic/bits/ipcstat.h", - "arch/generic/bits/kd.h", - "arch/generic/bits/limits.h", - "arch/generic/bits/link.h", - "arch/generic/bits/mman.h", - "arch/generic/bits/msg.h", - "arch/generic/bits/poll.h", - "arch/generic/bits/ptrace.h", - "arch/generic/bits/resource.h", - "arch/generic/bits/sem.h", - "arch/generic/bits/shm.h", - "arch/generic/bits/socket.h", - "arch/generic/bits/soundcard.h", - "arch/generic/bits/statfs.h", - "arch/generic/bits/termios.h", - "arch/generic/bits/vt.h", - ] -} else if (musl_arch == "loongarch64") { - musl_inc_bits_files = [ - "arch/loongarch64/bits/fenv.h", - "arch/loongarch64/bits/float.h", - "arch/loongarch64/bits/posix.h", - "arch/loongarch64/bits/reg.h", - "arch/loongarch64/bits/setjmp.h", - "arch/loongarch64/bits/signal.h", - "arch/loongarch64/bits/stat.h", - "arch/loongarch64/bits/stdint.h", - "arch/loongarch64/bits/user.h", - - "arch/generic/bits/dirent.h", - "arch/generic/bits/errno.h", - "arch/generic/bits/hwcap.h", - "arch/generic/bits/ioctl_fix.h", - "arch/generic/bits/ioctl.h", - "arch/generic/bits/io.h", - "arch/generic/bits/ipc.h", - "arch/generic/bits/ipcstat.h", - "arch/generic/bits/kd.h", - "arch/generic/bits/link.h", - "arch/generic/bits/mman.h", - "arch/generic/bits/msg.h", - "arch/generic/bits/poll.h", - "arch/generic/bits/sem.h", - "arch/generic/bits/shm.h", - "arch/generic/bits/socket.h", - "arch/generic/bits/soundcard.h", - "arch/generic/bits/termios.h", - "arch/generic/bits/vt.h", - "arch/generic/bits/statfs.h", - "arch/generic/bits/ptrace.h", - "arch/generic/bits/resource.h", - "arch/generic/bits/fcntl.h", - "arch/generic/bits/limits.h", - ] -} - -musl_inc_arpa_files = [ - "include/arpa/ftp.h", - "include/arpa/inet.h", - "include/arpa/nameser_compat.h", - "include/arpa/nameser.h", - "include/arpa/telnet.h", - "include/arpa/tftp.h", -] - -musl_inc_net_files = [ - "include/net/ethernet.h", - "include/net/if_arp.h", - "include/net/if.h", - "include/net/route.h", -] - -musl_inc_netinet_files = [ - "include/netinet/ether.h", - "include/netinet/icmp6.h", - "include/netinet/if_ether.h", - "include/netinet/igmp.h", - "include/netinet/in.h", - "include/netinet/in_systm.h", - "include/netinet/ip6.h", - "include/netinet/ip.h", - "include/netinet/ip_icmp.h", - "include/netinet/tcp.h", - "include/netinet/udp.h", -] - -musl_inc_netpacket_files = [ "include/netpacket/packet.h" ] - -musl_inc_scsi_files = [ - "include/scsi/scsi.h", - "include/scsi/scsi_ioctl.h", - "include/scsi/sg.h", -] - -musl_inc_sys_files = [ - "include/sys/acct.h", - "include/sys/auxv.h", - "include/sys/cachectl.h", - "include/sys/capability.h", - "include/sys/dir.h", - "include/sys/epoll.h", - "include/sys/errno.h", - "include/sys/eventfd.h", - "include/sys/fanotify.h", - "include/sys/fcntl.h", - "include/sys/file.h", - "include/sys/fsuid.h", - "include/sys/inotify.h", - "include/sys/ioctl.h", - "include/sys/io.h", - "include/sys/ipc.h", - "include/sys/kd.h", - "include/sys/klog.h", - "include/sys/membarrier.h", - "include/sys/mman.h", - "include/sys/mount.h", - "include/sys/msg.h", - "include/sys/mtio.h", - "include/sys/param.h", - "include/sys/personality.h", - "include/sys/poll.h", - "include/sys/prctl.h", - "include/sys/procfs.h", - "include/sys/ptrace.h", - "include/sys/quota.h", - "include/sys/random.h", - "include/sys/reboot.h", - "include/sys/tgkill.h", - "include/sys/reg.h", - "include/sys/resource.h", - "include/sys/select.h", - "include/sys/sem.h", - "include/sys/sendfile.h", - "include/sys/shm.h", - "include/sys/signalfd.h", - "include/sys/signal.h", - "include/sys/socket.h", - "include/sys/soundcard.h", - "include/sys/sspret.h", - "include/sys/statfs.h", - "include/sys/stat.h", - "include/sys/statvfs.h", - "include/sys/stropts.h", - "include/sys/swap.h", - "include/sys/syscall.h", - "include/sys/sysinfo.h", - "include/sys/syslog.h", - "include/sys/sysmacros.h", - "include/sys/termios.h", - "include/sys/timeb.h", - "include/sys/time.h", - "include/sys/timerfd.h", - "include/sys/times.h", - "include/sys/timex.h", - "include/sys/ttydefaults.h", - "include/sys/types.h", - "include/sys/ucontext.h", - "include/sys/uio.h", - "include/sys/un.h", - "include/sys/user.h", - "include/sys/utsname.h", - "include/sys/vfs.h", - "include/sys/vt.h", - "include/sys/wait.h", - "include/sys/xattr.h", - "include/sys/cdefs.h", -] - -musl_inc_trace_files = [ "include/trace/trace_marker.h" ] - -musl_inc_info_files = [ - "include/info/application_target_sdk_version.h", - "include/info/device_api_version.h", - "include/info/fatal_message.h", -] - -musl_inc_fortify_files = [ - "include/fortify/fcntl.h", - "include/fortify/fortify.h", - "include/fortify/poll.h", - "include/fortify/socket.h", - "include/fortify/stat.h", - "include/fortify/stdlib.h", - "include/fortify/string.h", - "include/fortify/unistd.h", - "include/fortify/stdio.h", -] - -musl_inc_root_files = [ - "include/aio.h", - "include/alloca.h", - "include/ar.h", - "include/assert.h", - "include/byteswap.h", - "include/complex.h", - "include/cpio.h", - "include/crypt.h", - "include/ctype.h", - "include/dirent.h", - "include/dlfcn.h", - "include/dlfcn_ext.h", - "include/elf.h", - "include/endian.h", - "include/err.h", - "include/errno.h", - "include/fcntl.h", - "include/features.h", - "include/fenv.h", - "include/float.h", - "include/fmtmsg.h", - "include/fnmatch.h", - "include/ftw.h", - "include/getopt.h", - "include/glob.h", - "include/grp.h", - "include/iconv.h", - "include/ifaddrs.h", - "include/inttypes.h", - "include/iso646.h", - "include/langinfo.h", - "include/lastlog.h", - "include/libgen.h", - "include/libintl.h", - "include/limits.h", - "include/link.h", - "include/locale.h", - "include/malloc.h", - "include/math.h", - "include/memory.h", - "include/mntent.h", - "include/monetary.h", - "include/mqueue.h", - "include/netdb.h", - "include/nl_types.h", - "include/paths.h", - "include/poll.h", - "include/pthread.h", - "include/pty.h", - "include/pwd.h", - "include/regex.h", - "include/resolv.h", - "include/sched.h", - "include/search.h", - "include/semaphore.h", - "include/setjmp.h", - "include/shadow.h", - "include/signal.h", - "include/sigchain.h", - "include/spawn.h", - "include/stdalign.h", - "include/stdarg.h", - "include/stdbool.h", - "include/stdc-predef.h", - "include/stddef.h", - "include/stdint.h", - "include/stdio_ext.h", - "include/stdio.h", - "include/stdlib.h", - "include/stdnoreturn.h", - "include/string.h", - "include/strings.h", - "include/stropts.h", - "include/syscall.h", - "include/sysexits.h", - "include/syslog.h", - "include/tar.h", - "include/termios.h", - "include/tgmath.h", - "include/threads.h", - "include/time.h", - "include/uchar.h", - "include/ucontext.h", - "include/ulimit.h", - "include/unistd.h", - "include/utime.h", - "include/utmp.h", - "include/utmpx.h", - "include/values.h", - "include/wait.h", - "include/wchar.h", - "include/wctype.h", - "include/wordexp.h", - "include/syscall_hooks.h", - "include/pthread_ffrt.h", -] - -musl_src_files_ext = [ - "src/internal/linux/musl_log.c", - "src/internal/linux/vdso.c", - "src/hook/linux/malloc_common.c", - "src/hook/linux/musl_preinit.c", - "src/hook/linux/musl_socket_preinit.c", - "src/hook/linux/socket_common.c", - "src/hook/linux/memory_trace.c", - "src/hook/linux/musl_fdtrack.c", - "src/hook/linux/musl_fdtrack_load.c", - "src/hook/linux/musl_preinit_common.c", - "src/hook/linux/musl_socket_preinit_common.c", - "crt/linux/crtplus.c", - "src/linux/arm/linux/flock.s", - "src/linux/aarch64/linux/flock.s", - "src/linux/x86_64/linux/flock.s", - "src/exit/linux/assert.c", - "src/exit/linux/atexit.c", - "src/fdsan/linux/fdsan.c", - "src/fortify/linux/fortify.c", - "src/gwp_asan/linux/gwp_asan.c", - "src/gwp_asan/linux/gwp_asan.h", - "src/hilog/linux/hilog_adapter.c", - "src/hilog/linux/hilog_common.h", - "src/hilog/linux/output_p.inl", - "src/hilog/linux/vsnprintf_s_p.c", - "src/hilog/linux/vsnprintf_s_p.h", - "src/linux/linux/clone.c", - "src/linux/linux/getprocpid.c", - "src/network/linux/getaddrinfo.c", - "src/syscall_hooks/linux/syscall_hooks.c", - "src/signal/linux/sigaction.c", - "src/thread/linux/pthread_create.c", - "src/trace/linux/trace_marker.c", - "include/trace/linux/trace_marker.h", - "src/info/linux/application_target_sdk_version.c", - "src/info/linux/device_api_version.c", - "src/info/linux/fatal_message.c", - "ldso/linux/cfi.c", - "ldso/linux/dynlink.c", - "ldso/linux/dynlink_rand.h", - "ldso/linux/ld_log.h", - "ldso/linux/namespace.h", - "ldso/linux/ns_config.h", - "ldso/linux/strops.c", - "ldso/linux/zip_archive.h", - "ldso/linux/cfi.h", - "ldso/linux/dynlink_rand.c", - "ldso/linux/ld_log.c", - "ldso/linux/namespace.c", - "ldso/linux/ns_config.c", - "ldso/linux/strops.h", - "include/sys/linux/capability.h", - "include/sys/linux/cdefs.h", - "include/sys/linux/sspret.h", - "include/info/linux/application_target_sdk_version.h", - "include/info/linux/device_api_version.h", - "include/info/linux/fatal_message.h", - "include/fortify/linux/fcntl.h", - "include/fortify/linux/poll.h", - "include/fortify/linux/stat.h", - "include/fortify/linux/stdlib.h", - "include/fortify/linux/unistd.h", - "include/fortify/linux/fortify.h", - "include/fortify/linux/socket.h", - "include/fortify/linux/stdio.h", - "include/fortify/linux/string.h", - "include/linux/dlfcn_ext.h", - "include/linux/sigchain.h", - "include/linux/syscall_hooks.h", - "src/ldso/arm/linux/dlvsym.s", - "src/ldso/aarch64/linux/dlvsym.s", - "src/ldso/x86_64/linux/dlvsym.s", - "src/misc/aarch64/linux/fstat.s", - "src/misc/aarch64/linux/syscall.s", - "src/malloc/linux/calloc.c", - "src/malloc/linux/stats.c", - "src/sigchain/linux/sigchain.c", - "src/internal/linux/malloc_config.h", - "src/internal/linux/proc_xid_impl.h", - "src/internal/linux/malloc_random.h", - "src/internal/linux/musl_log.h", - "src/internal/linux/syscall_hooks.h", - "src/hook/linux/common_def.h", - "src/hook/linux/musl_fdtrack.h", - "src/hook/linux/musl_fdtrack_hook.h", - "src/hook/linux/musl_malloc_dispatch.h", - "src/hook/linux/musl_malloc_dispatch_table.h", - "src/hook/linux/musl_preinit_common.h", - "src/hook/linux/musl_malloc.h", - "src/hook/linux/musl_socket_dispatch.h", - "src/hook/linux/musl_socket_preinit_common.h", - "src/hook/linux/memory_trace.h", - "src/hook/linux/musl_socket.h", -] - -musl_src_linux_files = [ - "src/internal/malloc_config.h", - "src/internal/proc_xid_impl.h", - "src/internal/malloc_random.h", - "src/internal/musl_log.h", - "src/internal/syscall_hooks.h", - "src/hook/common_def.h", - "src/hook/musl_fdtrack.h", - "src/hook/musl_fdtrack_hook.h", - "src/hook/musl_malloc_dispatch.h", - "src/hook/musl_malloc_dispatch_table.h", - "src/hook/musl_preinit_common.h", - "src/hook/musl_malloc.h", - "src/hook/musl_socket_dispatch.h", - "src/hook/musl_socket_preinit_common.h", - "src/hook/memory_trace.h", - "src/hook/musl_socket.h", - "src/internal/musl_log.c", - "src/internal/vdso.c", - "src/hook/malloc_common.c", - "src/hook/musl_preinit.c", - "src/hook/musl_socket_preinit.c", - "src/hook/socket_common.c", - "src/hook/memory_trace.c", - "src/hook/musl_fdtrack.c", - "src/hook/musl_fdtrack_load.c", - "src/hook/musl_preinit_common.c", - "src/hook/musl_socket_preinit_common.c", - "crt/crtplus.c", - "src/linux/arm/flock.s", - "src/linux/aarch64/flock.s", - "src/linux/x86_64/flock.s", - "src/exit/assert.c", - "src/exit/atexit.c", - "src/fdsan/fdsan.c", - "src/fortify/fortify.c", - "src/gwp_asan/gwp_asan.c", - "src/gwp_asan/gwp_asan.h", - "src/hilog/hilog_adapter.c", - "src/hilog/hilog_common.h", - "src/hilog/output_p.inl", - "src/hilog/vsnprintf_s_p.c", - "src/hilog/vsnprintf_s_p.h", - "src/linux/clone.c", - "src/linux/getprocpid.c", - "src/network/getaddrinfo.c", - "src/syscall_hooks/syscall_hooks.c", - "src/signal/sigaction.c", - "src/thread/pthread_create.c", - "src/trace/trace_marker.c", - "include/trace/trace_marker.h", - "src/info/application_target_sdk_version.c", - "src/info/device_api_version.c", - "src/info/fatal_message.c", - "ldso/cfi.c", - "ldso/dynlink.c", - "ldso/dynlink_rand.h", - "ldso/ld_log.h", - "ldso/namespace.h", - "ldso/ns_config.h", - "ldso/strops.c", - "ldso/zip_archive.h", - "ldso/cfi.h", - "ldso/dynlink_rand.c", - "ldso/ld_log.c", - "ldso/namespace.c", - "ldso/ns_config.c", - "ldso/strops.h", - "include/sys/capability.h", - "include/sys/cdefs.h", - "include/sys/sspret.h", - "include/info/application_target_sdk_version.h", - "include/info/device_api_version.h", - "include/info/fatal_message.h", - "include/fortify/fcntl.h", - "include/fortify/poll.h", - "include/fortify/stat.h", - "include/fortify/stdlib.h", - "include/fortify/unistd.h", - "include/fortify/fortify.h", - "include/fortify/socket.h", - "include/fortify/stdio.h", - "include/fortify/string.h", - "include/dlfcn_ext.h", - "include/sigchain.h", - "include/syscall_hooks.h", - "src/ldso/arm/dlvsym.s", - "src/ldso/aarch64/dlvsym.s", - "src/ldso/x86_64/dlvsym.s", - "src/misc/aarch64/fstat.s", - "src/misc/aarch64/syscall.s", - "src/malloc/calloc.c", - "src/malloc/stats.c", - "src/sigchain/sigchain.c", -] - -if (musl_arch == "arm") { - musl_src_file += [ - "src/process/arm/__vfork.s", - "src/ldso/arm/dlvsym.s", - ] -} else if (musl_arch == "aarch64") { - musl_src_file += [ - "arch/aarch64/syscall_arch.h", - "src/misc/aarch64/fstat.s", - "src/misc/aarch64/syscall.s", - "src/ldso/aarch64/dlvsym.s", - ] -} else if (musl_arch == "loongarch64") { - musl_src_file += [ "arch/loongarch64/syscall_arch.h" ] -} else if (musl_arch == "x86_64") { - musl_src_file += [ - "src/process/x86_64/__vfork.s", - "src/ldso/x86_64/dlvsym.s", - ] -} - -musl_inc_hook_files = [ - "//third_party/musl/src/internal/hilog_adapter.h", - "//third_party/musl/src/internal/linux/musl_log.h", - "//third_party/musl/src/hook/linux/memory_trace.h", - "//third_party/musl/src/hook/linux/musl_fdtrack.h", - "//third_party/musl/src/hook/linux/musl_fdtrack_hook.h", - "//third_party/musl/src/hook/linux/musl_malloc_dispatch_table.h", - "//third_party/musl/src/hook/linux/musl_malloc_dispatch.h", - "//third_party/musl/src/hook/linux/musl_preinit_common.h", - "//third_party/musl/src/hook/linux/musl_socket_dispatch.h", -] - -added_freebsd_files = [ - "$FREEBSD_DIR/contrib/tcp_wrappers/strcasecmp.c", - "$FREEBSD_DIR/lib/libc/gen/arc4random.c", - "$FREEBSD_DIR/lib/libc/gen/arc4random_uniform.c", - "$FREEBSD_DIR/lib/libc/stdlib/qsort.c", - "$FREEBSD_DIR/lib/libc/stdlib/strtoimax.c", - "$FREEBSD_DIR/lib/libc/stdlib/strtoul.c", - "$FREEBSD_DIR/lib/libc/stdlib/strtoumax.c", -] - -freebsd_headers = [ "$FREEBSD_DIR/contrib/libexecinfo/execinfo.h" ] - -freebsd_sys_headers = [ "$FREEBSD_DIR/sys/sys/queue.h" ] diff --git a/build/third_party_gn/musl/musl_template.gni b/build/third_party_gn/musl/musl_template.gni deleted file mode 100644 index c62f882fa666d5916e7a52046c09ac0d5266cd17..0000000000000000000000000000000000000000 --- a/build/third_party_gn/musl/musl_template.gni +++ /dev/null @@ -1,1010 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//third_party/FreeBSD/FreeBSD.gni") -import("//third_party/optimized-routines/optimized-routines.gni") -import("$build_root/ark.gni") -import("$build_root/config/clang/clang.gni") -import("$build_root/third_party_gn/musl/musl_src.gni") - -_libs_path_prefix = "." -if (is_asan) { - asan = "-asan" -} else { - asan = "" -} -musl_linker_so_out_dir = - "${root_out_dir}/common/common/libc/${_libs_path_prefix}" -musl_linker_so_out_path = - "${musl_linker_so_out_dir}/ld-musl-${musl_arch}${asan}.so.1" -musl_linker_so_out_dir_for_qemu = "${root_out_dir}/${so_dir_for_qemu}/lib" -musl_linker_so_out_path_for_qemu = - "${musl_linker_so_out_dir_for_qemu}/ld-musl-${musl_arch}${asan}.so.1" - -template("musl_libs") { - no_default_deps = true - - forward_variables_from(invoker, [ "*" ]) - musl_ported_root = "${target_out_dir}/${musl_ported_dir}" - _libs_out_dir = "usr/lib/${musl_target_triple}" - - porting_deps = [ - "$build_root/third_party_gn/musl:create_alltypes_h_file", - "$build_root/third_party_gn/musl:create_porting_src", - "$build_root/third_party_gn/musl:create_syscall_h_file", - "$build_root/third_party_gn/musl:create_version_h_file", - ] - - group(target_name) { - deps = [ - ":soft_create_linker", - ":soft_libc_musl_shared", - ":soft_libc_musl_static", - ":soft_musl_crt_libs", - ] - } - - group("soft_shared_libs") { - deps = [ - ":musl_headers", - ":soft_libc_musl_shared", - ":soft_libcrypt", - ":soft_libdl", - ":soft_libm", - ":soft_libpthread", - ":soft_libresolv", - ":soft_librt", - ":soft_libutil", - ":soft_libxnet", - ":soft_musl_crt_libs", - ] - } - - group("soft_static_libs") { - deps = [ - ":musl_headers", - ":soft_libc_musl_static", - ":soft_libcrypt", - ":soft_libdl", - ":soft_libm", - ":soft_libpthread", - ":soft_libresolv", - ":soft_librt", - ":soft_libutil", - ":soft_libxnet", - ":soft_musl_crt_libs", - ] - } - - group("soft_musl_crt_libs") { - deps = [ ":soft_musl_crt_install_action" ] - } - - # part of default_compiler_configs from build/config/BUILDCONFIG.gn - musl_inherited_configs = [ - "$build_root/config/compiler:compiler", - "$build_root/config/compiler:ark_code", - "$build_root/config/compiler:default_include_dirs", - "$build_root/config/compiler:default_optimization", - "$build_root/config/compiler:runtime_config", - ] - - config("soft_musl_config") { - configs = [ "$build_root/config/compiler:compiler_cpu_abi" ] - - include_dirs = [ - "$musl_ported_root/arch/generic", - "$musl_ported_root/arch/${musl_arch}", - "$musl_ported_root/src/include", - "$musl_ported_root/src/internal", - "$musl_ported_root/include", - "${target_out_dir}/${musl_inc_out_dir}", - ] - - cflags_basic = [ - "-Wl,-z,relro,-z,now,-z,noexecstack", - "-Wall", - "--target=${musl_target_triple}", - ] - - if (musl_arch == "arm") { - cflags_basic += [ "-mtp=cp15" ] - } else if (musl_arch == "aarch64") { - } - - cflags_auto = [ - "-Qunused-arguments", - "-Werror=pointer-arith", - "-Werror=pointer-sign", - "-Werror=implicit-int", - "-fno-omit-frame-pointer", - "-Werror=implicit-function-declaration", - "-fdata-sections", - "-ffunction-sections", - "-fasynchronous-unwind-tables", - "-funwind-tables", - "-pipe", - "-g", - "-D_XOPEN_SOURCE=700", - "-Wno-int-conversion", - ] - - if (!is_asan) { - cflags_auto += [ - "-DHOOK_ENABLE", - "-DOHOS_SOCKET_HOOK_ENABLE", - ] - } - - cflags_auto += [ "-DRESERVE_SIGNAL_STACK" ] - cflags_auto += [ "-DDFX_SIGNAL_LIBC" ] - - cflags_c99fse = [ - "-std=c99", - "-nostdinc", - "-Wa,--noexecstack", - ] - - cflags_all = cflags_basic + cflags_c99fse + cflags_auto - - cflags = cflags_all - - defines = [ "BROKEN_VFP_ASM" ] - defines += [ "FEATURE_ATEXIT_CB_PROTECT" ] - - if (is_standard_system) { - defines += [ - "OHOS_DNS_PROXY_BY_NETSYS=1", - "OHOS_PERMISSION_INTERNET=1", - "OHOS_DISABLE_IPV6=0", - ] - } - - if (!is_standard_system && defined(musl_enable_musl_log)) { - if (musl_enable_musl_log) { - defines += [ "ENABLE_MUSL_LOG" ] - } - } - - dynamic_list = rebase_path("$musl_ported_root/dynamic.list") - - ldflags = cflags_all - ldflags += [ - "-Wl,--dynamic-list=${dynamic_list}", - "-Wl,--exclude-libs=ALL", - "-Wl,--no-undefined", - "-Wl,--gc-sections", - "-Wl,--sort-common", - "-Wl,--sort-section,alignment", - "-fuse-ld=lld", - "--target=${musl_target_triple}", - ] - if (current_cpu == "arm" || current_cpu == "arm64") { - ldflags += [ "-Wl,--hash-style=both" ] - } else { - ldflags += [ "-Wl,--hash-style=sysv" ] - } - asmflags = cflags - } - - config("soft_hook") { - defines = [] - configs = [] - - if (is_posix) { - configs += [ "$build_root/config/posix:runtime_config" ] - } - - cflags_cc = [] - - defines = [ - "__GNU_SOURCE=1", # Necessary for clone(). - "CHROMIUM_CXX_TWEAK_INLINES", # Saves binary size. - ] - - defines += [ - "__MUSL__", - "_LIBCPP_HAS_MUSL_LIBC", - "__BUILD_LINUX_WITH_CLANG", - ] - - if (!is_asan) { - defines += [ - "HOOK_ENABLE", - "OHOS_SOCKET_HOOK_ENABLE", - ] - } - ldflags = [ "-nostdlib" ] - - libs = [] - - if (is_component_build) { - defines += [ "COMPONENT_BUILD" ] - } - } - - config("soft_jemalloc") { - configs = [] - - include_dirs = [ - "$musl_ported_root/arch/${musl_arch}", - "$musl_ported_root/arch/generic", - "$musl_ported_root/src/internal", - "$musl_ported_root/src/include", - "$musl_ported_root/include", - "${target_out_dir}/${musl_inc_out_dir}", - "${clang_base_path}/lib/clang/${clang_version}/include", - ] - - cflags = [ - "--target=${musl_target_triple}", - "-D_GNU_SOURCE", - "-D_REENTRANT", - "-Wall", - "-Wshorten-64-to-32", - "-Wsign-compare", - "-Wundef", - "-Wno-format-zero-length", - "-pipe", - "-g3", - "-fvisibility=hidden", - "-O3", - "-funroll-loops", - "-funwind-tables", - - # The following flags are for avoiding errors when compiling. - "-Wno-unused-parameter", - "-Wno-unused-function", - "-Wno-missing-field-initializers", - - "-U_FORTIFY_SOURCE", - - "-DOHOS_ENABLE_TCACHE", # For jemalloc 5.X - "-DJEMALLOC_TCACHE", # For jemalloc 4.X - "-DOHOS_LG_TCACHE_MAXCLASS_DEFAULT=16", - "-DOHOS_NUM_ARENAS=2", # For jemalloc 5.X - "-DOHOS_MAX_ARENAS=2", # For jemalloc 4.X - "-DOHOS_TCACHE_NSLOTS_SMALL_MAX=8", - "-DOHOS_TCACHE_NSLOTS_LARGE=16", - ] - - if (is_debug || musl_secure_level > 1) { - cflags += [ "-DOHOS_TCACHE_NSLOTS_RANDOM" ] - } - - if (musl_arch == "arm") { - cflags += [ - "-march=armv7-a", - "-DOHOS_LG_CHUNK_DEFAULT=19", # For jemalloc 4.X - ] - } else if (musl_arch == "aarch64") { - cflags += [ - "-march=armv8", - "-DOHOS_LG_CHUNK_DEFAULT=19", # For jemalloc 4.X - ] - } else if (musl_arch == "x86_64") { - cflags += [ "-march=x86-64" ] - } - - include_dirs += [ - "//third_party", - "//third_party/musl/src/include/", - "//third_party/jemalloc/include/", - "//third_party/jemalloc/include/jemalloc/internal", - "//third_party/jemalloc/include/jemalloc", - "//third_party/FreeBSD/contrib/libexecinfo", - ] - } - - source_set("soft_musl_crt") { - sources = [ - "$musl_ported_root/crt/${musl_arch}/crti.s", - "$musl_ported_root/crt/${musl_arch}/crtn.s", - "$musl_ported_root/crt/Scrt1.c", - "$musl_ported_root/crt/crt1.c", - "$musl_ported_root/crt/crtplus.c", - "$musl_ported_root/crt/rcrt1.c", - ] - - defines = [ "CRT" ] - - configs -= musl_inherited_configs - configs += [ ":soft_musl_config" ] - cflags = [ - "-fPIC", - "-fno-stack-protector", - "-ffreestanding", - ] - - deps = porting_deps - - asmflags = cflags - } - - source_set("soft_musl_src") { - sources_orig = [] - sources = [] - include_dirs = [] - sources_orig = musl_src_arch_file + musl_src_file - sources_orig -= musl_src_filterout - sources_orig -= [ - "src/string/mempcpy.c", - "src/string/memset.c", - "src/env/__init_tls.c", - "src/env/__libc_start_main.c", - "src/env/__stack_chk_fail.c", - "src/stdlib/qsort.c", - "src/stdlib/qsort_nr.c", - "src/string/strncpy.c", - ] - - freebsd_files = [ - "//third_party/FreeBSD/contrib/gdtoa/strtod.c", - "//third_party/FreeBSD/contrib/gdtoa/gethex.c", - "//third_party/FreeBSD/contrib/gdtoa/smisc.c", - "//third_party/FreeBSD/contrib/gdtoa/misc.c", - "//third_party/FreeBSD/contrib/gdtoa/strtord.c", - "//third_party/FreeBSD/contrib/gdtoa/hexnan.c", - "//third_party/FreeBSD/contrib/gdtoa/gmisc.c", - "//third_party/FreeBSD/contrib/gdtoa/hd_init.c", - "//third_party/FreeBSD/contrib/gdtoa/strtodg.c", - "//third_party/FreeBSD/contrib/gdtoa/ulp.c", - "//third_party/FreeBSD/contrib/gdtoa/strtof.c", - "//third_party/FreeBSD/contrib/gdtoa/sum.c", - "//third_party/FreeBSD/lib/libc/gdtoa/glue.c", - "//third_party/FreeBSD/lib/libc/stdio/parsefloat.c", - "//third_party/FreeBSD/contrib/tcp_wrappers/strcasecmp.c", - "//third_party/FreeBSD/lib/libc/gen/arc4random.c", - "//third_party/FreeBSD/lib/libc/gen/arc4random_uniform.c", - "//third_party/FreeBSD/lib/libc/stdlib/qsort.c", - "//third_party/FreeBSD/lib/libc/stdlib/strtoimax.c", - "//third_party/FreeBSD/lib/libc/stdlib/strtoul.c", - "//third_party/FreeBSD/lib/libc/stdlib/strtoumax.c", - "//third_party/musl/third_party/openbsd/lib/libc/string/strncpy.c", - ] - - if (musl_arch == "arm") { - sources_orig -= [ - "src/thread/${musl_arch}/__set_thread_area.c", - "src/string/arm/memcpy.S", - "src/string/memchr.c", - "src/string/strcmp.c", - "src/string/strlen.c", - "src/math/sincosf.c", - "src/math/expf.c", - "src/math/exp2f.c", - "src/math/exp2l.c", - "src/math/exp2.c", - "src/math/log.c", - "src/math/logl.c", - "src/math/log2.c", - "src/math/log2f.c", - "src/math/log2l.c", - "src/math/logf.c", - "src/math/log_data.c", - "src/math/logf_data.c", - "src/math/log2_data.c", - "src/math/log2f_data.c", - "src/math/exp2f_data.c", - "src/math/pow.c", - "src/math/powf.c", - "src/math/powl.c", - "src/math/sinf.c", - "src/math/cosf.c", - "src/linux/flock.c", - ] - } else if (musl_arch == "aarch64") { - sources_orig -= [ - "src/thread/${musl_arch}/__set_thread_area.s", - "src/string/memcpy.c", - "src/string/memmove.c", - "src/string/memchr.c", - "src/string/memcmp.c", - "src/string/strcpy.c", - "src/string/strcmp.c", - "src/string/strlen.c", - "src/string/stpcpy.c", - "src/string/strchr.c", - "src/string/strrchr.c", - "src/string/strnlen.c", - "src/string/strncmp.c", - "src/math/sincosf.c", - "src/math/sinf.c", - "src/math/cosf.c", - "src/math/cos.c", - "src/math/exp.c", - "src/math/exp2.c", - "src/math/exp2f.c", - "src/math/expf.c", - "src/math/log.c", - "src/math/log10.c", - "src/math/log2.c", - "src/math/log2f.c", - "src/math/logb.c", - "src/math/logf.c", - "src/math/sin.c", - "src/math/sincos.c", - "src/math/pow.c", - "src/math/powf.c", - "src/linux/flock.c", - ] - } else if (musl_arch == "x86_64") { - sources_orig -= [ - "src/thread/${musl_arch}/__set_thread_area.s", - "src/linux/flock.c", - ] - } - - defines = [] - defines += [ "FEATURE_ICU_LOCALE" ] - - # There are two ways to implement cxa_thread_atexit_impl: - # - CXA_THREAD_USE_TSD(default): use pthread_key_xxx to implement cxa_thread_atexit_impl. - # - CXA_THREAD_USE_TLS: put dtors in pthread to implement cxa_thread_atexit_impl. - defines += [ "CXA_THREAD_USE_TSD" ] - - if (musl_arch == "arm") { - defines += [ "MUSL_ARM_ARCH" ] - } - if (musl_arch == "aarch64") { - defines += [ "MUSL_AARCH64_ARCH" ] - } - if (musl_arch == "x86_64") { - defines += [ "MUSL_X86_64_ARCH" ] - } - if (musl_secure_level > 0) { - defines += [ "MALLOC_FREELIST_HARDENED" ] - } - if (musl_secure_level > 1) { - defines += [ "MALLOC_FREELIST_QUARANTINE" ] - } - if (musl_secure_level > 2) { - defines += [ "MALLOC_RED_ZONE" ] - } - if (is_debug || musl_secure_level >= 3) { - defines += [ "MALLOC_SECURE_ALL" ] - } - - if (musl_iterate_and_stats_api) { - defines += [ "MUSL_ITERATE_AND_STATS_API" ] - } - - foreach(s, sources_orig) { - sources += [ "$musl_ported_root/${s}" ] - } - if (musl_arch == "arm") { - sources += [ - "$OPTRTDIR/math/cosf.c", - "$OPTRTDIR/math/exp2.c", - "$OPTRTDIR/math/exp2f.c", - "$OPTRTDIR/math/exp2f_data.c", - "$OPTRTDIR/math/expf.c", - "$OPTRTDIR/math/log.c", - "$OPTRTDIR/math/log2.c", - "$OPTRTDIR/math/log2_data.c", - "$OPTRTDIR/math/log2f.c", - "$OPTRTDIR/math/log2f_data.c", - "$OPTRTDIR/math/log_data.c", - "$OPTRTDIR/math/logf.c", - "$OPTRTDIR/math/logf_data.c", - "$OPTRTDIR/math/pow.c", - "$OPTRTDIR/math/powf.c", - "$OPTRTDIR/math/sincosf.c", - "$OPTRTDIR/math/sincosf_data.c", - "$OPTRTDIR/math/sinf.c", - "$OPTRTDIR/string/arm/memchr.S", - "$OPTRTDIR/string/arm/memcpy.S", - "$OPTRTDIR/string/arm/memset.S", - "$OPTRTDIR/string/arm/strcmp.S", - "$OPTRTDIR/string/arm/strlen-armv6t2.S", - ] - sources += freebsd_files - asmflags = [ - "-D__memcpy_arm = memcpy", - "-D__memchr_arm = memchr", - "-D__memset_arm = memset", - "-D__strcmp_arm = strcmp", - "-D__strlen_armv6t2 = strlen", - ] - } else if (musl_arch == "aarch64") { - sources += freebsd_files - if (defined(ARM_FEATURE_SVE)) { - sources += [ - "$OPTRTDIR/string/aarch64/memchr-sve.S", - "$OPTRTDIR/string/aarch64/memcmp-sve.S", - "$OPTRTDIR/string/aarch64/memcpy.S", - "$OPTRTDIR/string/aarch64/memset.S", - "$OPTRTDIR/string/aarch64/stpcpy-sve.S", - "$OPTRTDIR/string/aarch64/strchr-sve.S", - "$OPTRTDIR/string/aarch64/strchrnul-sve.S", - "$OPTRTDIR/string/aarch64/strcmp-sve.S", - "$OPTRTDIR/string/aarch64/strcpy-sve.S", - "$OPTRTDIR/string/aarch64/strlen-sve.S", - "$OPTRTDIR/string/aarch64/strncmp-sve.S", - "$OPTRTDIR/string/aarch64/strnlen-sve.S", - "$OPTRTDIR/string/aarch64/strrchr-sve.S", - ] - asmflags = [ - "-D__memcpy_aarch64 = memcpy", - "-D__memset_aarch64 = memset", - "-D__memcmp_aarch64_sve = memcmp", - "-D__memchr_aarch64_sve = memchr", - "-D__strcmp_aarch64_sve = strcmp", - "-D__strlen_aarch64_sve = strlen", - "-D__strcpy_aarch64_sve = strcpy", - "-D__stpcpy_aarch64_sve = stpcpy", - "-D__strchr_aarch64_sve = strchr", - "-D__strrchr_aarch64_sve = strrchr", - "-D__strchrnul_aarch64_sve = strchrnul", - "-D__strnlen_aarch64_sve = strnlen", - "-D__strncmp_aarch64_sve = strncmp", - ] - } else if (defined(ARM_FEATURE_MTE)) { - sources += [ - "$OPTRTDIR/string/aarch64/memchr-mte.S", - "$OPTRTDIR/string/aarch64/memcmp.S", - "$OPTRTDIR/string/aarch64/memcpy.S", - "$OPTRTDIR/string/aarch64/memset.S", - "$OPTRTDIR/string/aarch64/stpcpy-mte.S", - "$OPTRTDIR/string/aarch64/strchr-mte.S", - "$OPTRTDIR/string/aarch64/strchrnul-mte.S", - "$OPTRTDIR/string/aarch64/strcmp-mte.S", - "$OPTRTDIR/string/aarch64/strcpy-mte.S", - "$OPTRTDIR/string/aarch64/strlen-mte.S", - "$OPTRTDIR/string/aarch64/strncmp-mte.S", - "$OPTRTDIR/string/aarch64/strnlen.S", - "$OPTRTDIR/string/aarch64/strrchr-mte.S", - ] - asmflags = [ - "-D__memcpy_aarch64 = memcpy", - "-D__memset_aarch64 = memset", - "-D__memcmp_aarch64 = memcmp", - "-D__memchr_aarch64_mte = memchr", - "-D__strcmp_aarch64_mte = strcmp", - "-D__strlen_aarch64_mte = strlen", - "-D__strcpy_aarch64_mte = strcpy", - "-D__stpcpy_aarch64_mte = stpcpy", - "-D__strchr_aarch64_mte = strchr", - "-D__strrchr_aarch64_mte = strrchr", - "-D__strchrnul_aarch64_mte = strchrnul", - "-D__strnlen_aarch64 = strnlen", - "-D__strncmp_aarch64_mte = strncmp", - ] - } else { - sources += [ - "$OPTRTDIR/string/aarch64/memchr.S", - "$OPTRTDIR/string/aarch64/memcmp.S", - "$OPTRTDIR/string/aarch64/memcpy.S", - "$OPTRTDIR/string/aarch64/memset.S", - "$OPTRTDIR/string/aarch64/stpcpy.S", - "$OPTRTDIR/string/aarch64/strchr.S", - "$OPTRTDIR/string/aarch64/strchrnul.S", - "$OPTRTDIR/string/aarch64/strcmp.S", - "$OPTRTDIR/string/aarch64/strcpy.S", - "$OPTRTDIR/string/aarch64/strlen.S", - "$OPTRTDIR/string/aarch64/strncmp.S", - "$OPTRTDIR/string/aarch64/strnlen.S", - "$OPTRTDIR/string/aarch64/strrchr.S", - ] - asmflags = [ - "-D__memmove_aarch64 = memmove", - "-D__memcpy_aarch64 = memcpy", - "-D__memchr_aarch64 = memchr", - "-D__memset_aarch64 = memset", - "-D__memcmp_aarch64 = memcmp", - "-D__strcmp_aarch64 = strcmp", - "-D__strlen_aarch64 = strlen", - "-D__strcpy_aarch64 = strcpy", - "-D__stpcpy_aarch64 = stpcpy", - "-D__strchr_aarch64 = strchr", - "-D__strrchr_aarch64 = strrchr", - "-D__strchrnul_aarch64 = strchrnul", - "-D__strnlen_aarch64 = strnlen", - "-D__strncmp_aarch64 = strncmp", - ] - } - } - - cflags = [ - "-O3", - "-fPIC", - "-fstack-protector-strong", - ] - - configs -= musl_inherited_configs - configs += [ ":soft_musl_config" ] - if (musl_arch == "aarch64") { - include_dirs += [ "//third_party/FreeBSD/lib/libc/aarch64" ] - } else if (musl_arch == "arm") { - include_dirs += [ "//third_party/FreeBSD/lib/libc/arm" ] - } - include_dirs += [ "//third_party/FreeBSD/lib/libc/include" ] - include_dirs += [ "//third_party/FreeBSD/contrib/libexecinfo" ] - include_dirs += [ "//third_party/FreeBSD/crypto/openssh/openbsd-compat" ] - - if (!defined(defines)) { - defines = [] - } - if (musl_target_os == "linux" && product_path != "" && - product_path != rebase_path("//productdefine/common/products")) { - _product_config = read_file("${product_path}/config.json", "json") - if (defined(_product_config.device_stack_size)) { - defines += [ "TARGET_STACK_SIZE=${_product_config.device_stack_size}" ] - } - if (defined(_product_config.device_guard_size)) { - defines += [ "TARGET_GUARD_SIZE=${_product_config.device_guard_size}" ] - } - } - external_deps = [] - external_deps += [ "FreeBSD:libc_static" ] - deps = porting_deps - } - - source_set("soft_musl_src_optimize") { - sources = [] - sources_orig = [] - - if (musl_arch == "aarch64") { - sources_orig += [ - "src/math/cos.c", - "src/math/exp.c", - "src/math/exp2.c", - "src/math/exp2f.c", - "src/math/expf.c", - "src/math/log.c", - "src/math/log10.c", - "src/math/log2.c", - "src/math/log2f.c", - "src/math/logb.c", - "src/math/logf.c", - "src/math/sin.c", - "src/math/sincos.c", - "src/math/pow.c", - "src/math/powf.c", - ] - } - - foreach(s, sources_orig) { - sources += [ "$musl_ported_root/${s}" ] - } - - if (musl_arch == "aarch64") { - sources += [ - "$OPTRTDIR/math/cosf.c", - "$OPTRTDIR/math/sincosf.c", - "$OPTRTDIR/math/sincosf_data.c", - "$OPTRTDIR/math/sinf.c", - ] - } - - configs -= musl_inherited_configs - configs += [ ":soft_musl_config" ] - cflags = [ - "-mllvm", - "-instcombine-max-iterations=0", - "-O3", - "-ffp-contract=fast", - "-fPIC", - "-fstack-protector-strong", - ] - - deps = porting_deps - } - - source_set("soft_musl_src_nossp") { - sources = [] - sources_orig = [ - "src/env/__init_tls.c", - "src/env/__libc_start_main.c", - "src/env/__stack_chk_fail.c", - "src/string/mempcpy.c", - ] - - defines = [] - if (musl_iterate_and_stats_api) { - defines += [ "MUSL_ITERATE_AND_STATS_API" ] - } - - if (musl_arch == "arm") { - sources_orig += [ "src/thread/${musl_arch}/__set_thread_area.c" ] - } else if (musl_arch == "aarch64") { - sources_orig += [ "src/thread/${musl_arch}/__set_thread_area.s" ] - } else if (musl_arch == "x86_64") { - sources_orig += [ - "src/string/memset.c", - "src/thread/${musl_arch}/__set_thread_area.s", - ] - } - - foreach(s, sources_orig) { - sources += [ "$musl_ported_root/${s}" ] - } - - configs -= musl_inherited_configs - configs += [ ":soft_musl_config" ] - cflags = [ - "-O3", - "-fno-stack-protector", - "-ffreestanding", - "-fPIC", - ] - - deps = porting_deps - } - - source_set("soft_musl_ldso") { - sources = [] - sources_orig = musl_src_ldso - - foreach(s, sources_orig) { - sources += [ "$musl_ported_root/${s}" ] - } - - configs -= musl_inherited_configs - configs += [ ":soft_musl_config" ] - cflags = [ - "-fno-stack-protector", - "-ffreestanding", - "-fPIC", - "-O3", - ] - if (is_asan) { - defines = [ - "NSLIST_DEFAULT_SIZE=1600", - "DSOLIST_DEFAULT_SIZE=1600", - "INHERIT_DEFAULT_SIZE=1600", - ] - } else { - defines = [ - "HANDLE_RANDOMIZATION", - "LOAD_ORDER_RANDOMIZATION", - ] - } - - deps = porting_deps - } - - source_set("soft_musl_hook") { - sources = [ - "//third_party/musl/porting/linux/user/src/hook/malloc_common.c", - "//third_party/musl/porting/linux/user/src/hook/memory_trace.c", - "//third_party/musl/porting/linux/user/src/hook/musl_preinit.c", - "//third_party/musl/porting/linux/user/src/hook/musl_preinit_common.c", - "//third_party/musl/porting/linux/user/src/hook/musl_socket_preinit.c", - "//third_party/musl/porting/linux/user/src/hook/musl_socket_preinit_common.c", - "//third_party/musl/porting/linux/user/src/hook/socket_common.c", - ] - - deps = [ - "$build_root/third_party_gn/musl:create_alltypes_h_file", - "$build_root/third_party_gn/musl:create_porting_src", - "$build_root/third_party_gn/musl:create_syscall_h_file", - "$build_root/third_party_gn/musl:create_version_h_file", - "$build_root/third_party_gn/musl:musl_copy_inc_bits", - "$build_root/third_party_gn/musl:musl_copy_inc_fortify", - "$build_root/third_party_gn/musl:musl_copy_inc_root", - "$build_root/third_party_gn/musl:musl_copy_inc_sys", - ] - - configs -= musl_inherited_configs - - configs += [ - "$build_root/config/compiler:compiler", - ":soft_hook", - ] - cflags = [ - "-mllvm", - "--instcombine-max-iterations=0", - "-ffp-contract=fast", - "-O3", - "-Wno-int-conversion", - ] - } - - source_set("soft_musl_jemalloc") { - sources = [ "./porting/linux/user/src/malloc/jemalloc/jemalloc.c" ] - - deps = [ - "$build_root/third_party_gn/musl:create_alltypes_h_file", - "$build_root/third_party_gn/musl:create_porting_src", - "$build_root/third_party_gn/musl:create_syscall_h_file", - "$build_root/third_party_gn/musl:create_version_h_file", - "$build_root/third_party_gn/musl:musl_copy_inc_bits", - "$build_root/third_party_gn/musl:musl_copy_inc_root", - "$build_root/third_party_gn/musl:musl_copy_inc_sys", - ] - - configs -= musl_inherited_configs - - configs += [ ":soft_jemalloc" ] - } - - static_library("soft_libc_musl_static") { - configs -= musl_inherited_configs - - output_dir = "${target_out_dir}/${_libs_out_dir}" - deps = [ - ":soft_musl_hook", - ":soft_musl_ldso", - ":soft_musl_src", - ":soft_musl_src_nossp", - ":soft_musl_src_optimize", - ] - external_deps = [] - external_deps = [ "FreeBSD:libc_static" ] - output_name = "libc" - complete_static_lib = true - } - - static_library("soft_libm") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libm" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_librt") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "librt" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_libpthread") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libpthread" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_libcrypt") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libcrypt" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_libutil") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libutil" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_libresolv") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libresolv" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_libxnet") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libxnet" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - static_library("soft_libdl") { - complete_static_lib = true - configs -= musl_inherited_configs - output_name = "libdl" - output_dir = "${target_out_dir}/${_libs_out_dir}" - } - - shared_library("soft_libc_musl_shared") { - deps = [] - output_dir = "${target_out_dir}/${_libs_out_dir}" - - musl_lib_path = rebase_path("$output_dir") - - libclang_rt_path = rebase_path( - "${runtime_lib_path}/${musl_target_triple}/${_libs_path_prefix}") - - libc_map_path = rebase_path("$musl_ported_root/libc.map.txt") - - if (current_cpu == "mipsel") { - libs = [ "atomic" ] - deps += [ ":mipsel_atomic_linker" ] - } - ldflags = [ - "-Wl,--version-script=${libc_map_path}", - "-lpthread", - "-ldl", - "-L${musl_lib_path}", - "-lunwind", - "-lclang_rt.builtins", - "-L${libclang_rt_path}", - "-Wl,-e,_dlstart", - "-nostdlib", - ] - - configs -= [ "$build_root/config:default_libs" ] - configs -= musl_inherited_configs - configs += [ ":soft_musl_config" ] - - deps += [ - ":soft_libdl", - ":soft_libpthread", - ":soft_musl_crt_install_action", - ":soft_musl_hook", - ":soft_musl_ldso", - ":soft_musl_src", - ":soft_musl_src_nossp", - ":soft_musl_src_optimize", - ] - - output_name = "libc" - output_extension = "so" - } - - action_foreach("soft_musl_crt_install_action") { - redir = "${root_out_dir}/obj" - script = "$musl_ported_root/scripts/install.py" - sources = [ - "${redir}/$musl_ported_root/crt/${musl_arch}/soft_musl_crt/crti.o", - "${redir}/$musl_ported_root/crt/${musl_arch}/soft_musl_crt/crtn.o", - "${redir}/$musl_ported_root/crt/soft_musl_crt/Scrt1.o", - "${redir}/$musl_ported_root/crt/soft_musl_crt/crt1.o", - "${redir}/$musl_ported_root/crt/soft_musl_crt/rcrt1.o", - ] - - outputs = [ "${root_build_dir}/obj/arkcompiler/toolchain/build/third_party_gn/musl/${_libs_out_dir}/{{source_file_part}}" ] - - ldpath = [] - if (is_mac) { - ldpath += [ "${clang_base_path}/bin/ld64.lld" ] - } else if (is_win) { - ldpath += [ "${clang_base_path}/bin/lld-link.exe" ] - } else { - ldpath += [ "${clang_base_path}/bin/ld.lld" ] - } - - args = [ - "--input", - "{{source}}", - ] - args += [ "--output" ] + rebase_path(outputs, root_build_dir) - args += [ "--ldpath" ] + rebase_path(ldpath, root_build_dir) - args += [ "--crtplus" ] + rebase_path( - [ "${redir}/$musl_ported_root/crt/soft_musl_crt/crtplus.o" ], - root_build_dir) - - deps = [ ":soft_musl_crt" ] - } - - copy("soft_create_linker") { - deps = [ ":soft_libc_musl_shared" ] - - # _libc_shared_outputs = get_target_outputs(":soft_libc_musl_shared") - _libc_shared_so = "${target_out_dir}/${_libs_out_dir}/libc.so" - sources = [ _libc_shared_so ] - outputs = [ musl_linker_so_out_path ] - } - - copy("soft_create_linker_for_qemu") { - deps = [ ":soft_create_linker" ] - - sources = [ musl_linker_so_out_path ] - outputs = [ musl_linker_so_out_path_for_qemu ] - } - - copy("mipsel_atomic_linker") { - # need install libatomic1-mipsel-cross first - atomic_shared_so = "/usr/mipsel-linux-gnu/lib/libatomic.so.1.2.0" - sources = [ atomic_shared_so ] - - atomic_linker_so = "${target_out_dir}/${_libs_out_dir}/libatomic.so" - outputs = [ atomic_linker_so ] - } -} diff --git a/build/third_party_gn/openssl/BUILD.gn b/build/third_party_gn/openssl/BUILD.gn deleted file mode 100644 index cae0e8ea69d4ef5c96eb868b3671c7ee6ae3b524..0000000000000000000000000000000000000000 --- a/build/third_party_gn/openssl/BUILD.gn +++ /dev/null @@ -1,1909 +0,0 @@ -# Copyright (c) 2020-2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/ark.gni") - -print("openssl detecting os now...") -print("current_cpu = ${current_cpu}") -print("current_os = ${current_os}") -print("host_os = ${host_os}") -openssl_selected_platform = "" -print("is_mingw = ${is_mingw}") -if (current_cpu == "arm" && !(current_os == "linux" || host_os == "mac")) { - print("openssl selected linux-armv4") - openssl_selected_platform = "linux-armv4" -} else if (current_cpu == "arm64" && - (!(current_os == "linux" || host_os == "mac") || - current_os == "ohos")) { - print("openssl selected linux-aarch64") - openssl_selected_platform = "linux-aarch64" -} else if ((current_cpu == "x64" || current_cpu == "x86_64") && - (current_os == "mac" || current_os == "ios")) { - # compilation for ios depends the platform - print("openssl selected darwin64-x86_64-cc") - openssl_selected_platform = "darwin64-x86_64-cc" -} else if (current_cpu == "arm64" && - (current_os == "mac" || current_os == "ios")) { - # ios and macos both use the platform - print("openssl selected darwin64-arm64-cc") - openssl_selected_platform = "darwin64-arm64-cc" -} else if ((current_cpu == "x64" || current_cpu == "x86_64") && - current_os != "mingw") { - print("openssl selected linux-x86_64") - openssl_selected_platform = "linux-x86_64" -} else if (is_mingw) { - print("openssl selected mingw64") - openssl_selected_platform = "mingw64" -} else if (current_cpu == "arm" && current_os == "android") { - print("openssl selected linux-armv4") - openssl_selected_platform = "linux-armv4" -} else if (current_cpu == "arm64" && current_os == "android") { - print("openssl selected linux-aarch64") - openssl_selected_platform = "linux-aarch64" -} -print( - "openssl detecting os done. openssl_selected_platform = ${openssl_selected_platform}") - -openssl_selected_platform_full_path = - "${target_out_dir}/build_all_generated/${openssl_selected_platform}" - -# 升级修改适配检查点1 libcrypto 不同平台汇编代码 -libcrypto_build_all_generated_linux_armv4_sources = [ - "${openssl_selected_platform_full_path}/crypto/aes/aes-armv4.S", - "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S", - "${openssl_selected_platform_full_path}/crypto/aes/bsaes-armv7.S", - "${openssl_selected_platform_full_path}/crypto/armv4cpuid.S", - "${openssl_selected_platform_full_path}/crypto/bn/armv4-gf2m.S", - "${openssl_selected_platform_full_path}/crypto/bn/armv4-mont.S", - "${openssl_selected_platform_full_path}/crypto/chacha/chacha-armv4.S", - "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-armv4.S", - "${openssl_selected_platform_full_path}/crypto/modes/ghash-armv4.S", - "${openssl_selected_platform_full_path}/crypto/modes/ghashv8-armx.S", - "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-armv4.S", - "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-armv4.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-armv4-large.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-armv4.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha512-armv4.S", -] - -# 升级修改适配检查点2 libcrypto 不同平台汇编代码 -libcrypto_build_all_generated_linux_aarch64_sources = [ - "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S", - "${openssl_selected_platform_full_path}/crypto/aes/vpaes-armv8.S", - "${openssl_selected_platform_full_path}/crypto/arm64cpuid.S", - "${openssl_selected_platform_full_path}/crypto/bn/armv8-mont.S", - "${openssl_selected_platform_full_path}/crypto/chacha/chacha-armv8.S", - "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-armv8.S", - "${openssl_selected_platform_full_path}/crypto/modes/aes-gcm-armv8_64.S", - "${openssl_selected_platform_full_path}/crypto/modes/ghashv8-armx.S", - "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha512-armv8.S", -] - -# 升级修改适配检查点3 libcrypto 不同平台汇编代码 -libcrypto_build_all_generated_darwin64_x86_64_cc_sources = [ - "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha1-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/bsaes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/vpaes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx2.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx512.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-gf2m.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont5.s", - "${openssl_selected_platform_full_path}/crypto/camellia/cmll-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/chacha/chacha-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/ec/x25519-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/md5/md5-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/modes/aesni-gcm-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/modes/ghash-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/rc4/rc4-md5-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/rc4/rc4-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s", - "${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s", -] - -# 升级修改适配检查点4 libcrypto 不同平台汇编代码 -libcrypto_build_all_generated_darwin64_arm64_cc_sources = [ - "${openssl_selected_platform_full_path}/crypto/aes/aesv8-armx.S", - "${openssl_selected_platform_full_path}/crypto/aes/vpaes-armv8.S", - "${openssl_selected_platform_full_path}/crypto/arm64cpuid.S", - "${openssl_selected_platform_full_path}/crypto/bn/armv8-mont.S", - "${openssl_selected_platform_full_path}/crypto/chacha/chacha-armv8.S", - "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-armv8.S", - "${openssl_selected_platform_full_path}/crypto/modes/aes-gcm-armv8_64.S", - "${openssl_selected_platform_full_path}/crypto/modes/ghashv8-armx.S", - "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-armv8.S", - "${openssl_selected_platform_full_path}/crypto/sha/sha512-armv8.S", -] - -# 升级修改适配检查点5 libcrypto 不同平台汇编代码 -libcrypto_build_all_generated_linux_x86_64_sources = [ - "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha1-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/bsaes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/vpaes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx2.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx512.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-gf2m.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont5.s", - "${openssl_selected_platform_full_path}/crypto/camellia/cmll-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/chacha/chacha-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/ec/x25519-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/md5/md5-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/modes/aesni-gcm-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/modes/ghash-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/rc4/rc4-md5-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/rc4/rc4-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s", - "${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s", -] - -# 升级修改适配检查点6 libcrypto 不同平台汇编代码 -libcrypto_build_all_generated_mingw64_sources = [ - "${openssl_selected_platform_full_path}/crypto/aes/aes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha1-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-sha256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/aesni-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/bsaes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/aes/vpaes-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx2.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-avx512.s", - "${openssl_selected_platform_full_path}/crypto/bn/rsaz-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-gf2m.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont.s", - "${openssl_selected_platform_full_path}/crypto/bn/x86_64-mont5.s", - "${openssl_selected_platform_full_path}/crypto/camellia/cmll-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/chacha/chacha-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/ec/ecp_nistz256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/ec/x25519-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/md5/md5-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/modes/aesni-gcm-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/modes/ghash-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/poly1305/poly1305-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/rc4/rc4-md5-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/rc4/rc4-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/keccak1600-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha1-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-mb-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha256-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/sha/sha512-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/whrlpool/wp-x86_64.s", - "${openssl_selected_platform_full_path}/crypto/x86_64cpuid.s", - "${openssl_selected_platform_full_path}/engines/e_padlock-x86_64.s", -] - -libcrypto_build_all_generated_selected_platform_sources = [] -if (openssl_selected_platform == "linux-armv4") { - libcrypto_build_all_generated_selected_platform_sources += - libcrypto_build_all_generated_linux_armv4_sources -} else if (openssl_selected_platform == "linux-aarch64") { - libcrypto_build_all_generated_selected_platform_sources += - libcrypto_build_all_generated_linux_aarch64_sources -} else if (openssl_selected_platform == "darwin64-x86_64-cc") { - libcrypto_build_all_generated_selected_platform_sources += - libcrypto_build_all_generated_darwin64_x86_64_cc_sources -} else if (openssl_selected_platform == "darwin64-arm64-cc") { - libcrypto_build_all_generated_selected_platform_sources += - libcrypto_build_all_generated_darwin64_arm64_cc_sources -} else if (openssl_selected_platform == "linux-x86_64") { - libcrypto_build_all_generated_selected_platform_sources += - libcrypto_build_all_generated_linux_x86_64_sources -} else if (openssl_selected_platform == "mingw64") { - libcrypto_build_all_generated_selected_platform_sources += - libcrypto_build_all_generated_mingw64_sources -} - -# 升级修改适配检查点7 libcommon 生成的源码列表 -libcommon_build_all_generated_selected_platform_sources = [ - "${openssl_selected_platform_full_path}/providers/common/der/der_digests_gen.c", - "${openssl_selected_platform_full_path}/providers/common/der/der_dsa_gen.c", - "${openssl_selected_platform_full_path}/providers/common/der/der_ec_gen.c", - "${openssl_selected_platform_full_path}/providers/common/der/der_ecx_gen.c", - "${openssl_selected_platform_full_path}/providers/common/der/der_rsa_gen.c", - "${openssl_selected_platform_full_path}/providers/common/der/der_wrap_gen.c", -] - -# 升级修改适配检查点8 libdefault 生成的源码列表 -libdefault_build_all_generated_selected_platform_sources = [ - "${openssl_selected_platform_full_path}/providers/common/der/der_sm2_gen.c", -] - -# We make use of both exec_script and action to build openssl build_all_generated items. -# -# Some modules use openssl in an incorrect way, leading to the confusing building sequences, -# so the user modules building fail because openssl headers have not been generated at the building time. -# The exec_script in the global area will be executed before ninja command, -# and it ensures that the headers is generated properly before the building of any modules. -# -# Openssl generate some assembly codes before it is building. -# The sources list in BUILD.gn include the assembly codes. -# The gn build system requires that all items in sources list should be the output of another build item. -# So we use an empty action to generate the assembly codes. -# Actually we generate the assembly codes in exec_script, not in action. -# -# The gn build system requires the script in exec_script and action should be python script, -# so we invoke the shell script in python script -print(exec_script( - rebase_path("//third_party/openssl/run_command.py"), - [ - rebase_path( - "//third_party/openssl/make_openssl_build_all_generated.sh"), - rebase_path("//third_party/openssl"), - rebase_path("${target_out_dir}/build_all_generated"), - openssl_selected_platform, - ], - "string", - [])) -action("openssl_build_all_generated") { - script = rebase_path("//third_party/openssl/empty.py") - outputs = [] - outputs += libcommon_build_all_generated_selected_platform_sources - outputs += libdefault_build_all_generated_selected_platform_sources - outputs += libcrypto_build_all_generated_selected_platform_sources - outputs += [ "${openssl_selected_platform_full_path}/apps/progs.c" ] - if (openssl_selected_platform == "mingw64") { - outputs += [ "${openssl_selected_platform_full_path}/apps/openssl.rc" ] - } -} - -openssl_internal_cflags = [ - "-Wall", - - # ../../third_party/openssl/crypto/o_str.c:309:9: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Werror,-Wint-conversion] - # err = strerror_r(errnum, buf, buflen); - # ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - "-Wno-error=int-conversion", - - # ../../third_party/openssl/crypto/bn/bn_conv.c:92:34: error: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 10000000000000000000 to 2313682944 [-Werror,-Wconstant-conversion] - # *lp = BN_div_word(t, BN_DEC_CONV); - # ~~~~~~~~~~~ ^~~~~~~~~~~ - "-Wno-error=constant-conversion", - - # ../../third_party/openssl/crypto/bn/bn_exp.c:382:38: error: shift count >= width of type [-Werror,-Wshift-count-overflow] - # if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) { - # ^ ~~~~~~~~~~~~~~ - "-Wno-error=shift-count-overflow", - - # ../../third_party/openssl/crypto/conf/conf_def.c:31:11: error: 'stat' macro redefined [-Werror,-Wmacro-redefined] - # # define stat _stat - # ^ - # ../../prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/include/sys/stat.h:279:9: note: previous definition is here - # #define stat _stat64 - # ^ - # 1 error generated. - "-Wno-error=macro-redefined", - - "-Wno-error=implicit-fallthrough", - "-Wno-error=sign-compare", - - # Fix llvm-15 build error - "-Wno-unused-but-set-variable", -] - -# 升级修改适配检查点9 内部公共头文件目录列表 -crypto_config_common_private_include_dirs = [ - "//third_party/openssl/", - "//third_party/openssl/apps/include", - "//third_party/openssl/crypto", - "//third_party/openssl/crypto/bn", - "//third_party/openssl/crypto/ec", - "//third_party/openssl/crypto/ec/curve448", - "//third_party/openssl/crypto/modes", - "//third_party/openssl/crypto/rsa", - "//third_party/openssl/include", - "//third_party/openssl/providers/common/include", - "//third_party/openssl/providers/common/include/prov", - "//third_party/openssl/providers/implementations/include", - "${openssl_selected_platform_full_path}/apps", - "${openssl_selected_platform_full_path}/crypto", - "${openssl_selected_platform_full_path}/include", - "${openssl_selected_platform_full_path}/include/crypto", - "${openssl_selected_platform_full_path}/include/openssl", - "${openssl_selected_platform_full_path}/providers/common/include", - "${openssl_selected_platform_full_path}/providers/common/include/prov", -] -crypto_config_common_public_include_dirs = [ - "//third_party/openssl/include", - "${openssl_selected_platform_full_path}/include", -] - -# located at /system/etc/ -ohos_prebuilt_etc("openssl.cnf") { - source = "//third_party/openssl/open_harmony_openssl_config/openssl.cnf" - subsystem_name = "thirdparty" - part_name = "openssl" -} - -# 升级修改适配检查点10 内部公共编译选项宏列表 -crypto_config_common_cflags = [ - "-Wa,--noexecstack", - "-DNDEBUG", - "-DOPENSSL_BUILDING_OPENSSL", - "-DOPENSSL_CPUID_OBJ", - "-DOPENSSL_PIC", - - # use `openssl version -a` cmd to see runtime OPENSSLDIR, ENGINESDIR, MODULESDIR value - - # the origin value generated by Configure - # linux-armv4, linux-aarch64, darwin64-x86_64-cc, darwin64-arm64-cc - # /usr/local/lib/engines-3 - # linux-x86_64, mingw64 - # /usr/local/lib64/engines-3 - "-DENGINESDIR=\"\"", - - # the origin value generated by Configure - # linux-armv4, linux-aarch64, darwin64-x86_64-cc, darwin64-arm64-cc - # /usr/local/lib/ossl-modules - # linux-x86_64, mingw64 - # /usr/local/lib64/ossl-modules - "-DMODULESDIR=\"\"", - - # the origin value generated by Configure - # /usr/local/ssl - # we set the variable as the following to locate openssl.cnf - "-DOPENSSLDIR=\"/system/etc\"", - - "-DSTATIC_LEGACY", -] - -# 升级修改适配检查点11 内部不同平台编译选项列表 -crypto_config_linux_armv4_cflags = [ - "-DOPENSSL_USE_NODELETE", - "-fPIC", - "-pthread", - - "-DAES_ASM", - "-DBSAES_ASM", - "-DECP_NISTZ256_ASM", - "-DGHASH_ASM", - "-DKECCAK1600_ASM", - "-DOPENSSL_BN_ASM_GF2m", - "-DOPENSSL_BN_ASM_MONT", - "-DPOLY1305_ASM", - "-DSHA1_ASM", - "-DSHA256_ASM", - "-DSHA512_ASM", -] - -# 升级修改适配检查点12 内部不同平台编译选项列表 -crypto_config_linux_aarch64_cflags = [ - "-DOPENSSL_USE_NODELETE", - "-fPIC", - "-pthread", - - "-DECP_NISTZ256_ASM", - "-DKECCAK1600_ASM", - "-DOPENSSL_BN_ASM_MONT", - "-DPOLY1305_ASM", - "-DSHA1_ASM", - "-DSHA256_ASM", - "-DSHA512_ASM", - "-DVPAES_ASM", -] - -# 升级修改适配检查点13 内部不同平台编译选项列表 -crypto_config_darwin64_x86_64_cc_cflags = [ - "-fPIC", - "-DL_ENDIAN", - "-D_REENTRANT", - "-DOPENSSL_IA32_SSE2", - - "-DAES_ASM", - "-DBSAES_ASM", - "-DCMLL_ASM", - "-DECP_NISTZ256_ASM", - "-DGHASH_ASM", - "-DKECCAK1600_ASM", - "-DMD5_ASM", - "-DOPENSSL_BN_ASM_GF2m", - "-DOPENSSL_BN_ASM_MONT", - "-DOPENSSL_BN_ASM_MONT5", - "-DPADLOCK_ASM", - "-DPOLY1305_ASM", - "-DSHA1_ASM", - "-DSHA256_ASM", - "-DSHA512_ASM", - "-DVPAES_ASM", - "-DWHIRLPOOL_ASM", - "-DX25519_ASM", -] - -# 升级修改适配检查点14 内部不同平台编译选项列表 -crypto_config_darwin64_arm64_cc_cflags = [ - "-DL_ENDIAN", - "-D_REENTRANT", - "-fPIC", - - "-DECP_NISTZ256_ASM", - "-DKECCAK1600_ASM", - "-DOPENSSL_BN_ASM_MONT", - "-DPOLY1305_ASM", - "-DSHA1_ASM", - "-DSHA256_ASM", - "-DSHA512_ASM", - "-DVPAES_ASM", -] - -# 升级修改适配检查点15 内部不同平台编译选项列表 -crypto_config_linux_x86_64_cflags = [ - "-DL_ENDIAN", - "-DOPENSSL_IA32_SSE2", - "-DOPENSSL_USE_NODELETE", - "-fPIC", - "-m64", - "-pthread", - - "-DAES_ASM", - "-DBSAES_ASM", - "-DCMLL_ASM", - "-DECP_NISTZ256_ASM", - "-DGHASH_ASM", - "-DKECCAK1600_ASM", - "-DMD5_ASM", - "-DOPENSSL_BN_ASM_GF2m", - "-DOPENSSL_BN_ASM_MONT", - "-DOPENSSL_BN_ASM_MONT5", - "-DPADLOCK_ASM", - "-DPOLY1305_ASM", - "-DSHA1_ASM", - "-DSHA256_ASM", - "-DSHA512_ASM", - "-DVPAES_ASM", - "-DWHIRLPOOL_ASM", - "-DX25519_ASM", -] - -# 升级修改适配检查点16 内部不同平台编译选项列表 -crypto_config_mingw64_cflags = [ - "-D_MT", - "-D_UNICODE", - "-DL_ENDIAN", - "-DOPENSSL_IA32_SSE2", - "-DUNICODE", - "-DWIN32_LEAN_AND_MEAN", - "-m64", - - "-DAES_ASM", - "-DBSAES_ASM", - "-DCMLL_ASM", - "-DECP_NISTZ256_ASM", - "-DGHASH_ASM", - "-DKECCAK1600_ASM", - "-DMD5_ASM", - "-DOPENSSL_BN_ASM_GF2m", - "-DOPENSSL_BN_ASM_MONT", - "-DOPENSSL_BN_ASM_MONT5", - "-DPADLOCK_ASM", - "-DPOLY1305_ASM", - "-DSHA1_ASM", - "-DSHA256_ASM", - "-DSHA512_ASM", - "-DVPAES_ASM", - "-DWHIRLPOOL_ASM", - "-DX25519_ASM", -] - -crypto_config_current_platform_cflags = [] -if (openssl_selected_platform == "linux-armv4") { - crypto_config_current_platform_cflags += crypto_config_linux_armv4_cflags -} else if (openssl_selected_platform == "linux-aarch64") { - crypto_config_current_platform_cflags += crypto_config_linux_aarch64_cflags -} else if (openssl_selected_platform == "darwin64-x86_64-cc") { - crypto_config_current_platform_cflags += - crypto_config_darwin64_x86_64_cc_cflags -} else if (openssl_selected_platform == "darwin64-arm64-cc") { - crypto_config_current_platform_cflags += - crypto_config_darwin64_arm64_cc_cflags -} else if (openssl_selected_platform == "linux-x86_64") { - crypto_config_current_platform_cflags += crypto_config_linux_x86_64_cflags -} else if (openssl_selected_platform == "mingw64") { - crypto_config_current_platform_cflags += crypto_config_mingw64_cflags -} - -mingw32_libs_path = [] -mingw32_libs = [] -if (is_mingw || is_win) { - mingw32_libs_path += [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib" ] - mingw32_libs += [ - "ws2_32", - "crypt32", - ] -} - -config("crypto_config_private") { - include_dirs = crypto_config_common_private_include_dirs - cflags = crypto_config_common_cflags + crypto_config_current_platform_cflags + - openssl_internal_cflags - lib_dirs = mingw32_libs_path - libs = mingw32_libs -} - -config("crypto_config_public") { - include_dirs = crypto_config_common_public_include_dirs - libs = mingw32_libs -} - -# 升级修改适配检查点17 libcommon 原目录源码列表 -libcommon_common_sources = [ - "//third_party/openssl/providers/common/der/der_dsa_key.c", - "//third_party/openssl/providers/common/der/der_dsa_sig.c", - "//third_party/openssl/providers/common/der/der_ec_key.c", - "//third_party/openssl/providers/common/der/der_ec_sig.c", - "//third_party/openssl/providers/common/der/der_ecx_key.c", - "//third_party/openssl/providers/common/der/der_rsa_key.c", - "//third_party/openssl/providers/common/provider_ctx.c", - "//third_party/openssl/providers/common/provider_err.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon_block.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon_ccm.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon_ccm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon_gcm.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon_gcm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/ciphercommon_hw.c", - "//third_party/openssl/providers/implementations/digests/digestcommon.c", - "//third_party/openssl/ssl/record/tls_pad.c", -] - -# 升级修改适配检查点18 libdefault 原目录源码列表 -libdefault_common_sources = [ - "//third_party/openssl/providers/common/bio_prov.c", - "//third_party/openssl/providers/common/capabilities.c", - "//third_party/openssl/providers/common/der/der_rsa_sig.c", - "//third_party/openssl/providers/common/der/der_sm2_key.c", - "//third_party/openssl/providers/common/der/der_sm2_sig.c", - "//third_party/openssl/providers/common/digest_to_nid.c", - "//third_party/openssl/providers/common/provider_seeding.c", - "//third_party/openssl/providers/common/provider_util.c", - "//third_party/openssl/providers/common/securitycheck.c", - "//third_party/openssl/providers/common/securitycheck_default.c", - "//third_party/openssl/providers/implementations/asymciphers/rsa_enc.c", - "//third_party/openssl/providers/implementations/asymciphers/sm2_enc.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_ccm.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_ccm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_gcm.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_ocb.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_ocb_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_siv.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_siv_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_wrp.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_xts.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_xts_fips.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aes_xts_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aria.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aria_ccm.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aria_ccm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aria_gcm.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aria_gcm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_aria_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_camellia.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_camellia_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_chacha20.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_chacha20_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_cts.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_null.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_sm4.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_sm4_ccm.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_sm4_gcm.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_sm4_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_common.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_default.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_default_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_wrap.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_tdes_wrap_hw.c", - "//third_party/openssl/providers/implementations/digests/blake2_prov.c", - "//third_party/openssl/providers/implementations/digests/blake2b_prov.c", - "//third_party/openssl/providers/implementations/digests/blake2s_prov.c", - "//third_party/openssl/providers/implementations/digests/md5_prov.c", - "//third_party/openssl/providers/implementations/digests/md5_sha1_prov.c", - "//third_party/openssl/providers/implementations/digests/null_prov.c", - "//third_party/openssl/providers/implementations/digests/ripemd_prov.c", - "//third_party/openssl/providers/implementations/digests/sha2_prov.c", - "//third_party/openssl/providers/implementations/digests/sha3_prov.c", - "//third_party/openssl/providers/implementations/digests/sm3_prov.c", - "//third_party/openssl/providers/implementations/encode_decode/decode_der2key.c", - "//third_party/openssl/providers/implementations/encode_decode/decode_epki2pki.c", - "//third_party/openssl/providers/implementations/encode_decode/decode_msblob2key.c", - "//third_party/openssl/providers/implementations/encode_decode/decode_pem2der.c", - "//third_party/openssl/providers/implementations/encode_decode/decode_pvk2key.c", - "//third_party/openssl/providers/implementations/encode_decode/decode_spki2typespki.c", - "//third_party/openssl/providers/implementations/encode_decode/encode_key2any.c", - "//third_party/openssl/providers/implementations/encode_decode/encode_key2blob.c", - "//third_party/openssl/providers/implementations/encode_decode/encode_key2ms.c", - "//third_party/openssl/providers/implementations/encode_decode/encode_key2text.c", - "//third_party/openssl/providers/implementations/encode_decode/endecoder_common.c", - "//third_party/openssl/providers/implementations/exchange/dh_exch.c", - "//third_party/openssl/providers/implementations/exchange/ecdh_exch.c", - "//third_party/openssl/providers/implementations/exchange/ecx_exch.c", - "//third_party/openssl/providers/implementations/exchange/kdf_exch.c", - "//third_party/openssl/providers/implementations/kdfs/hkdf.c", - "//third_party/openssl/providers/implementations/kdfs/kbkdf.c", - "//third_party/openssl/providers/implementations/kdfs/krb5kdf.c", - "//third_party/openssl/providers/implementations/kdfs/pbkdf2.c", - "//third_party/openssl/providers/implementations/kdfs/pbkdf2_fips.c", - "//third_party/openssl/providers/implementations/kdfs/pkcs12kdf.c", - "//third_party/openssl/providers/implementations/kdfs/scrypt.c", - "//third_party/openssl/providers/implementations/kdfs/sshkdf.c", - "//third_party/openssl/providers/implementations/kdfs/sskdf.c", - "//third_party/openssl/providers/implementations/kdfs/tls1_prf.c", - "//third_party/openssl/providers/implementations/kdfs/x942kdf.c", - "//third_party/openssl/providers/implementations/kem/rsa_kem.c", - "//third_party/openssl/providers/implementations/keymgmt/dh_kmgmt.c", - "//third_party/openssl/providers/implementations/keymgmt/dsa_kmgmt.c", - "//third_party/openssl/providers/implementations/keymgmt/ec_kmgmt.c", - "//third_party/openssl/providers/implementations/keymgmt/ecx_kmgmt.c", - "//third_party/openssl/providers/implementations/keymgmt/kdf_legacy_kmgmt.c", - "//third_party/openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.c", - "//third_party/openssl/providers/implementations/keymgmt/rsa_kmgmt.c", - "//third_party/openssl/providers/implementations/macs/blake2b_mac.c", - "//third_party/openssl/providers/implementations/macs/blake2s_mac.c", - "//third_party/openssl/providers/implementations/macs/cmac_prov.c", - "//third_party/openssl/providers/implementations/macs/gmac_prov.c", - "//third_party/openssl/providers/implementations/macs/hmac_prov.c", - "//third_party/openssl/providers/implementations/macs/kmac_prov.c", - "//third_party/openssl/providers/implementations/macs/poly1305_prov.c", - "//third_party/openssl/providers/implementations/macs/siphash_prov.c", - "//third_party/openssl/providers/implementations/rands/crngt.c", - "//third_party/openssl/providers/implementations/rands/drbg.c", - "//third_party/openssl/providers/implementations/rands/drbg_ctr.c", - "//third_party/openssl/providers/implementations/rands/drbg_hash.c", - "//third_party/openssl/providers/implementations/rands/drbg_hmac.c", - "//third_party/openssl/providers/implementations/rands/seed_src.c", - "//third_party/openssl/providers/implementations/rands/seeding/rand_cpu_x86.c", - "//third_party/openssl/providers/implementations/rands/seeding/rand_tsc.c", - "//third_party/openssl/providers/implementations/rands/seeding/rand_unix.c", - "//third_party/openssl/providers/implementations/rands/seeding/rand_win.c", - "//third_party/openssl/providers/implementations/rands/test_rng.c", - "//third_party/openssl/providers/implementations/signature/dsa_sig.c", - "//third_party/openssl/providers/implementations/signature/ecdsa_sig.c", - "//third_party/openssl/providers/implementations/signature/eddsa_sig.c", - "//third_party/openssl/providers/implementations/signature/mac_legacy_sig.c", - "//third_party/openssl/providers/implementations/signature/rsa_sig.c", - "//third_party/openssl/providers/implementations/signature/sm2_sig.c", - "//third_party/openssl/providers/implementations/storemgmt/file_store.c", - "//third_party/openssl/providers/implementations/storemgmt/file_store_any2obj.c", - "//third_party/openssl/ssl/s3_cbc.c", -] - -# 升级修改适配检查点19 liblegacy 源码列表 -liblegacy_sources = [ - "//third_party/openssl/providers/implementations/ciphers/cipher_blowfish.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_blowfish_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_cast5.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_cast5_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_des.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_des_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_desx.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_desx_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_idea.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_idea_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_rc2.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_rc2_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_rc4.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_rc4_hw.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_seed.c", - "//third_party/openssl/providers/implementations/ciphers/cipher_seed_hw.c", - "//third_party/openssl/providers/implementations/digests/md4_prov.c", - "//third_party/openssl/providers/implementations/digests/mdc2_prov.c", - "//third_party/openssl/providers/implementations/digests/wp_prov.c", - "//third_party/openssl/providers/implementations/kdfs/pbkdf1.c", -] - -ohos_source_set("crypto_source") { - subsystem_name = "thirdparty" - part_name = "openssl" - - # 升级修改适配检查点20 libcrypto 原目录源码列表 - sources = [ - "//third_party/openssl/crypto/aes/aes_cfb.c", - "//third_party/openssl/crypto/aes/aes_ecb.c", - "//third_party/openssl/crypto/aes/aes_ige.c", - "//third_party/openssl/crypto/aes/aes_misc.c", - "//third_party/openssl/crypto/aes/aes_ofb.c", - "//third_party/openssl/crypto/aes/aes_wrap.c", - "//third_party/openssl/crypto/aria/aria.c", - "//third_party/openssl/crypto/asn1/a_bitstr.c", - "//third_party/openssl/crypto/asn1/a_d2i_fp.c", - "//third_party/openssl/crypto/asn1/a_digest.c", - "//third_party/openssl/crypto/asn1/a_dup.c", - "//third_party/openssl/crypto/asn1/a_gentm.c", - "//third_party/openssl/crypto/asn1/a_i2d_fp.c", - "//third_party/openssl/crypto/asn1/a_int.c", - "//third_party/openssl/crypto/asn1/a_mbstr.c", - "//third_party/openssl/crypto/asn1/a_object.c", - "//third_party/openssl/crypto/asn1/a_octet.c", - "//third_party/openssl/crypto/asn1/a_print.c", - "//third_party/openssl/crypto/asn1/a_sign.c", - "//third_party/openssl/crypto/asn1/a_strex.c", - "//third_party/openssl/crypto/asn1/a_strnid.c", - "//third_party/openssl/crypto/asn1/a_time.c", - "//third_party/openssl/crypto/asn1/a_type.c", - "//third_party/openssl/crypto/asn1/a_utctm.c", - "//third_party/openssl/crypto/asn1/a_utf8.c", - "//third_party/openssl/crypto/asn1/a_verify.c", - "//third_party/openssl/crypto/asn1/ameth_lib.c", - "//third_party/openssl/crypto/asn1/asn1_err.c", - "//third_party/openssl/crypto/asn1/asn1_gen.c", - "//third_party/openssl/crypto/asn1/asn1_item_list.c", - "//third_party/openssl/crypto/asn1/asn1_lib.c", - "//third_party/openssl/crypto/asn1/asn1_parse.c", - "//third_party/openssl/crypto/asn1/asn_mime.c", - "//third_party/openssl/crypto/asn1/asn_moid.c", - "//third_party/openssl/crypto/asn1/asn_mstbl.c", - "//third_party/openssl/crypto/asn1/asn_pack.c", - "//third_party/openssl/crypto/asn1/bio_asn1.c", - "//third_party/openssl/crypto/asn1/bio_ndef.c", - "//third_party/openssl/crypto/asn1/d2i_param.c", - "//third_party/openssl/crypto/asn1/d2i_pr.c", - "//third_party/openssl/crypto/asn1/d2i_pu.c", - "//third_party/openssl/crypto/asn1/evp_asn1.c", - "//third_party/openssl/crypto/asn1/f_int.c", - "//third_party/openssl/crypto/asn1/f_string.c", - "//third_party/openssl/crypto/asn1/i2d_evp.c", - "//third_party/openssl/crypto/asn1/n_pkey.c", - "//third_party/openssl/crypto/asn1/nsseq.c", - "//third_party/openssl/crypto/asn1/p5_pbe.c", - "//third_party/openssl/crypto/asn1/p5_pbev2.c", - "//third_party/openssl/crypto/asn1/p5_scrypt.c", - "//third_party/openssl/crypto/asn1/p8_pkey.c", - "//third_party/openssl/crypto/asn1/t_bitst.c", - "//third_party/openssl/crypto/asn1/t_pkey.c", - "//third_party/openssl/crypto/asn1/t_spki.c", - "//third_party/openssl/crypto/asn1/tasn_dec.c", - "//third_party/openssl/crypto/asn1/tasn_enc.c", - "//third_party/openssl/crypto/asn1/tasn_fre.c", - "//third_party/openssl/crypto/asn1/tasn_new.c", - "//third_party/openssl/crypto/asn1/tasn_prn.c", - "//third_party/openssl/crypto/asn1/tasn_scn.c", - "//third_party/openssl/crypto/asn1/tasn_typ.c", - "//third_party/openssl/crypto/asn1/tasn_utl.c", - "//third_party/openssl/crypto/asn1/x_algor.c", - "//third_party/openssl/crypto/asn1/x_bignum.c", - "//third_party/openssl/crypto/asn1/x_info.c", - "//third_party/openssl/crypto/asn1/x_int64.c", - "//third_party/openssl/crypto/asn1/x_long.c", - "//third_party/openssl/crypto/asn1/x_pkey.c", - "//third_party/openssl/crypto/asn1/x_sig.c", - "//third_party/openssl/crypto/asn1/x_spki.c", - "//third_party/openssl/crypto/asn1/x_val.c", - "//third_party/openssl/crypto/asn1_dsa.c", - "//third_party/openssl/crypto/async/arch/async_null.c", - "//third_party/openssl/crypto/async/arch/async_posix.c", - "//third_party/openssl/crypto/async/arch/async_win.c", - "//third_party/openssl/crypto/async/async.c", - "//third_party/openssl/crypto/async/async_err.c", - "//third_party/openssl/crypto/async/async_wait.c", - "//third_party/openssl/crypto/bf/bf_cfb64.c", - "//third_party/openssl/crypto/bf/bf_ecb.c", - "//third_party/openssl/crypto/bf/bf_enc.c", - "//third_party/openssl/crypto/bf/bf_ofb64.c", - "//third_party/openssl/crypto/bf/bf_skey.c", - "//third_party/openssl/crypto/bio/bf_buff.c", - "//third_party/openssl/crypto/bio/bf_lbuf.c", - "//third_party/openssl/crypto/bio/bf_nbio.c", - "//third_party/openssl/crypto/bio/bf_null.c", - "//third_party/openssl/crypto/bio/bf_prefix.c", - "//third_party/openssl/crypto/bio/bf_readbuff.c", - "//third_party/openssl/crypto/bio/bio_addr.c", - "//third_party/openssl/crypto/bio/bio_cb.c", - "//third_party/openssl/crypto/bio/bio_dump.c", - "//third_party/openssl/crypto/bio/bio_err.c", - "//third_party/openssl/crypto/bio/bio_lib.c", - "//third_party/openssl/crypto/bio/bio_meth.c", - "//third_party/openssl/crypto/bio/bio_print.c", - "//third_party/openssl/crypto/bio/bio_sock.c", - "//third_party/openssl/crypto/bio/bio_sock2.c", - "//third_party/openssl/crypto/bio/bss_acpt.c", - "//third_party/openssl/crypto/bio/bss_bio.c", - "//third_party/openssl/crypto/bio/bss_conn.c", - "//third_party/openssl/crypto/bio/bss_core.c", - "//third_party/openssl/crypto/bio/bss_dgram.c", - "//third_party/openssl/crypto/bio/bss_fd.c", - "//third_party/openssl/crypto/bio/bss_file.c", - "//third_party/openssl/crypto/bio/bss_log.c", - "//third_party/openssl/crypto/bio/bss_mem.c", - "//third_party/openssl/crypto/bio/bss_null.c", - "//third_party/openssl/crypto/bio/bss_sock.c", - "//third_party/openssl/crypto/bio/ossl_core_bio.c", - "//third_party/openssl/crypto/bn/bn_add.c", - "//third_party/openssl/crypto/bn/bn_blind.c", - "//third_party/openssl/crypto/bn/bn_const.c", - "//third_party/openssl/crypto/bn/bn_conv.c", - "//third_party/openssl/crypto/bn/bn_ctx.c", - "//third_party/openssl/crypto/bn/bn_depr.c", - "//third_party/openssl/crypto/bn/bn_dh.c", - "//third_party/openssl/crypto/bn/bn_div.c", - "//third_party/openssl/crypto/bn/bn_err.c", - "//third_party/openssl/crypto/bn/bn_exp.c", - "//third_party/openssl/crypto/bn/bn_exp2.c", - "//third_party/openssl/crypto/bn/bn_gcd.c", - "//third_party/openssl/crypto/bn/bn_gf2m.c", - "//third_party/openssl/crypto/bn/bn_intern.c", - "//third_party/openssl/crypto/bn/bn_kron.c", - "//third_party/openssl/crypto/bn/bn_lib.c", - "//third_party/openssl/crypto/bn/bn_mod.c", - "//third_party/openssl/crypto/bn/bn_mont.c", - "//third_party/openssl/crypto/bn/bn_mpi.c", - "//third_party/openssl/crypto/bn/bn_mul.c", - "//third_party/openssl/crypto/bn/bn_nist.c", - "//third_party/openssl/crypto/bn/bn_prime.c", - "//third_party/openssl/crypto/bn/bn_print.c", - "//third_party/openssl/crypto/bn/bn_rand.c", - "//third_party/openssl/crypto/bn/bn_recp.c", - "//third_party/openssl/crypto/bn/bn_rsa_fips186_4.c", - "//third_party/openssl/crypto/bn/bn_shift.c", - "//third_party/openssl/crypto/bn/bn_sqr.c", - "//third_party/openssl/crypto/bn/bn_sqrt.c", - "//third_party/openssl/crypto/bn/bn_srp.c", - "//third_party/openssl/crypto/bn/bn_word.c", - "//third_party/openssl/crypto/bn/bn_x931p.c", - "//third_party/openssl/crypto/bsearch.c", - "//third_party/openssl/crypto/buffer/buf_err.c", - "//third_party/openssl/crypto/buffer/buffer.c", - "//third_party/openssl/crypto/camellia/cmll_cfb.c", - "//third_party/openssl/crypto/camellia/cmll_ctr.c", - "//third_party/openssl/crypto/camellia/cmll_ecb.c", - "//third_party/openssl/crypto/camellia/cmll_misc.c", - "//third_party/openssl/crypto/camellia/cmll_ofb.c", - "//third_party/openssl/crypto/cast/c_cfb64.c", - "//third_party/openssl/crypto/cast/c_ecb.c", - "//third_party/openssl/crypto/cast/c_enc.c", - "//third_party/openssl/crypto/cast/c_ofb64.c", - "//third_party/openssl/crypto/cast/c_skey.c", - "//third_party/openssl/crypto/cmac/cmac.c", - "//third_party/openssl/crypto/cmp/cmp_asn.c", - "//third_party/openssl/crypto/cmp/cmp_client.c", - "//third_party/openssl/crypto/cmp/cmp_ctx.c", - "//third_party/openssl/crypto/cmp/cmp_err.c", - "//third_party/openssl/crypto/cmp/cmp_hdr.c", - "//third_party/openssl/crypto/cmp/cmp_http.c", - "//third_party/openssl/crypto/cmp/cmp_msg.c", - "//third_party/openssl/crypto/cmp/cmp_protect.c", - "//third_party/openssl/crypto/cmp/cmp_server.c", - "//third_party/openssl/crypto/cmp/cmp_status.c", - "//third_party/openssl/crypto/cmp/cmp_util.c", - "//third_party/openssl/crypto/cmp/cmp_vfy.c", - "//third_party/openssl/crypto/cms/cms_asn1.c", - "//third_party/openssl/crypto/cms/cms_att.c", - "//third_party/openssl/crypto/cms/cms_cd.c", - "//third_party/openssl/crypto/cms/cms_dd.c", - "//third_party/openssl/crypto/cms/cms_dh.c", - "//third_party/openssl/crypto/cms/cms_ec.c", - "//third_party/openssl/crypto/cms/cms_enc.c", - "//third_party/openssl/crypto/cms/cms_env.c", - "//third_party/openssl/crypto/cms/cms_err.c", - "//third_party/openssl/crypto/cms/cms_ess.c", - "//third_party/openssl/crypto/cms/cms_io.c", - "//third_party/openssl/crypto/cms/cms_kari.c", - "//third_party/openssl/crypto/cms/cms_lib.c", - "//third_party/openssl/crypto/cms/cms_pwri.c", - "//third_party/openssl/crypto/cms/cms_rsa.c", - "//third_party/openssl/crypto/cms/cms_sd.c", - "//third_party/openssl/crypto/cms/cms_smime.c", - "//third_party/openssl/crypto/comp/c_zlib.c", - "//third_party/openssl/crypto/comp/comp_err.c", - "//third_party/openssl/crypto/comp/comp_lib.c", - "//third_party/openssl/crypto/conf/conf_api.c", - "//third_party/openssl/crypto/conf/conf_def.c", - "//third_party/openssl/crypto/conf/conf_err.c", - "//third_party/openssl/crypto/conf/conf_lib.c", - "//third_party/openssl/crypto/conf/conf_mall.c", - "//third_party/openssl/crypto/conf/conf_mod.c", - "//third_party/openssl/crypto/conf/conf_sap.c", - "//third_party/openssl/crypto/conf/conf_ssl.c", - "//third_party/openssl/crypto/context.c", - "//third_party/openssl/crypto/core_algorithm.c", - "//third_party/openssl/crypto/core_fetch.c", - "//third_party/openssl/crypto/core_namemap.c", - "//third_party/openssl/crypto/cpt_err.c", - "//third_party/openssl/crypto/cpuid.c", - "//third_party/openssl/crypto/crmf/crmf_asn.c", - "//third_party/openssl/crypto/crmf/crmf_err.c", - "//third_party/openssl/crypto/crmf/crmf_lib.c", - "//third_party/openssl/crypto/crmf/crmf_pbm.c", - "//third_party/openssl/crypto/cryptlib.c", - "//third_party/openssl/crypto/ct/ct_b64.c", - "//third_party/openssl/crypto/ct/ct_err.c", - "//third_party/openssl/crypto/ct/ct_log.c", - "//third_party/openssl/crypto/ct/ct_oct.c", - "//third_party/openssl/crypto/ct/ct_policy.c", - "//third_party/openssl/crypto/ct/ct_prn.c", - "//third_party/openssl/crypto/ct/ct_sct.c", - "//third_party/openssl/crypto/ct/ct_sct_ctx.c", - "//third_party/openssl/crypto/ct/ct_vfy.c", - "//third_party/openssl/crypto/ct/ct_x509v3.c", - "//third_party/openssl/crypto/ctype.c", - "//third_party/openssl/crypto/cversion.c", - "//third_party/openssl/crypto/der_writer.c", - "//third_party/openssl/crypto/des/cbc_cksm.c", - "//third_party/openssl/crypto/des/cbc_enc.c", - "//third_party/openssl/crypto/des/cfb64ede.c", - "//third_party/openssl/crypto/des/cfb64enc.c", - "//third_party/openssl/crypto/des/cfb_enc.c", - "//third_party/openssl/crypto/des/des_enc.c", - "//third_party/openssl/crypto/des/ecb3_enc.c", - "//third_party/openssl/crypto/des/ecb_enc.c", - "//third_party/openssl/crypto/des/fcrypt.c", - "//third_party/openssl/crypto/des/fcrypt_b.c", - "//third_party/openssl/crypto/des/ofb64ede.c", - "//third_party/openssl/crypto/des/ofb64enc.c", - "//third_party/openssl/crypto/des/ofb_enc.c", - "//third_party/openssl/crypto/des/pcbc_enc.c", - "//third_party/openssl/crypto/des/qud_cksm.c", - "//third_party/openssl/crypto/des/rand_key.c", - "//third_party/openssl/crypto/des/set_key.c", - "//third_party/openssl/crypto/des/str2key.c", - "//third_party/openssl/crypto/des/xcbc_enc.c", - "//third_party/openssl/crypto/dh/dh_ameth.c", - "//third_party/openssl/crypto/dh/dh_asn1.c", - "//third_party/openssl/crypto/dh/dh_backend.c", - "//third_party/openssl/crypto/dh/dh_check.c", - "//third_party/openssl/crypto/dh/dh_depr.c", - "//third_party/openssl/crypto/dh/dh_err.c", - "//third_party/openssl/crypto/dh/dh_gen.c", - "//third_party/openssl/crypto/dh/dh_group_params.c", - "//third_party/openssl/crypto/dh/dh_kdf.c", - "//third_party/openssl/crypto/dh/dh_key.c", - "//third_party/openssl/crypto/dh/dh_lib.c", - "//third_party/openssl/crypto/dh/dh_meth.c", - "//third_party/openssl/crypto/dh/dh_pmeth.c", - "//third_party/openssl/crypto/dh/dh_prn.c", - "//third_party/openssl/crypto/dh/dh_rfc5114.c", - "//third_party/openssl/crypto/dsa/dsa_ameth.c", - "//third_party/openssl/crypto/dsa/dsa_asn1.c", - "//third_party/openssl/crypto/dsa/dsa_backend.c", - "//third_party/openssl/crypto/dsa/dsa_check.c", - "//third_party/openssl/crypto/dsa/dsa_depr.c", - "//third_party/openssl/crypto/dsa/dsa_err.c", - "//third_party/openssl/crypto/dsa/dsa_gen.c", - "//third_party/openssl/crypto/dsa/dsa_key.c", - "//third_party/openssl/crypto/dsa/dsa_lib.c", - "//third_party/openssl/crypto/dsa/dsa_meth.c", - "//third_party/openssl/crypto/dsa/dsa_ossl.c", - "//third_party/openssl/crypto/dsa/dsa_pmeth.c", - "//third_party/openssl/crypto/dsa/dsa_prn.c", - "//third_party/openssl/crypto/dsa/dsa_sign.c", - "//third_party/openssl/crypto/dsa/dsa_vrf.c", - "//third_party/openssl/crypto/dso/dso_dl.c", - "//third_party/openssl/crypto/dso/dso_dlfcn.c", - "//third_party/openssl/crypto/dso/dso_err.c", - "//third_party/openssl/crypto/dso/dso_lib.c", - "//third_party/openssl/crypto/dso/dso_openssl.c", - "//third_party/openssl/crypto/dso/dso_vms.c", - "//third_party/openssl/crypto/dso/dso_win32.c", - "//third_party/openssl/crypto/ebcdic.c", - "//third_party/openssl/crypto/ec/curve25519.c", - "//third_party/openssl/crypto/ec/curve448/arch_32/f_impl32.c", - "//third_party/openssl/crypto/ec/curve448/arch_64/f_impl64.c", - "//third_party/openssl/crypto/ec/curve448/curve448.c", - "//third_party/openssl/crypto/ec/curve448/curve448_tables.c", - "//third_party/openssl/crypto/ec/curve448/eddsa.c", - "//third_party/openssl/crypto/ec/curve448/f_generic.c", - "//third_party/openssl/crypto/ec/curve448/scalar.c", - "//third_party/openssl/crypto/ec/ec2_oct.c", - "//third_party/openssl/crypto/ec/ec2_smpl.c", - "//third_party/openssl/crypto/ec/ec_ameth.c", - "//third_party/openssl/crypto/ec/ec_asn1.c", - "//third_party/openssl/crypto/ec/ec_backend.c", - "//third_party/openssl/crypto/ec/ec_check.c", - "//third_party/openssl/crypto/ec/ec_curve.c", - "//third_party/openssl/crypto/ec/ec_cvt.c", - "//third_party/openssl/crypto/ec/ec_deprecated.c", - "//third_party/openssl/crypto/ec/ec_err.c", - "//third_party/openssl/crypto/ec/ec_key.c", - "//third_party/openssl/crypto/ec/ec_kmeth.c", - "//third_party/openssl/crypto/ec/ec_lib.c", - "//third_party/openssl/crypto/ec/ec_mult.c", - "//third_party/openssl/crypto/ec/ec_oct.c", - "//third_party/openssl/crypto/ec/ec_pmeth.c", - "//third_party/openssl/crypto/ec/ec_print.c", - "//third_party/openssl/crypto/ec/ecdh_kdf.c", - "//third_party/openssl/crypto/ec/ecdh_ossl.c", - "//third_party/openssl/crypto/ec/ecdsa_ossl.c", - "//third_party/openssl/crypto/ec/ecdsa_sign.c", - "//third_party/openssl/crypto/ec/ecdsa_vrf.c", - "//third_party/openssl/crypto/ec/eck_prn.c", - "//third_party/openssl/crypto/ec/ecp_mont.c", - "//third_party/openssl/crypto/ec/ecp_nist.c", - "//third_party/openssl/crypto/ec/ecp_nistz256.c", - "//third_party/openssl/crypto/ec/ecp_oct.c", - "//third_party/openssl/crypto/ec/ecp_smpl.c", - "//third_party/openssl/crypto/ec/ecx_backend.c", - "//third_party/openssl/crypto/ec/ecx_key.c", - "//third_party/openssl/crypto/ec/ecx_meth.c", - "//third_party/openssl/crypto/encode_decode/decoder_err.c", - "//third_party/openssl/crypto/encode_decode/decoder_lib.c", - "//third_party/openssl/crypto/encode_decode/decoder_meth.c", - "//third_party/openssl/crypto/encode_decode/decoder_pkey.c", - "//third_party/openssl/crypto/encode_decode/encoder_err.c", - "//third_party/openssl/crypto/encode_decode/encoder_lib.c", - "//third_party/openssl/crypto/encode_decode/encoder_meth.c", - "//third_party/openssl/crypto/encode_decode/encoder_pkey.c", - "//third_party/openssl/crypto/engine/eng_all.c", - "//third_party/openssl/crypto/engine/eng_cnf.c", - "//third_party/openssl/crypto/engine/eng_ctrl.c", - "//third_party/openssl/crypto/engine/eng_dyn.c", - "//third_party/openssl/crypto/engine/eng_err.c", - "//third_party/openssl/crypto/engine/eng_fat.c", - "//third_party/openssl/crypto/engine/eng_init.c", - "//third_party/openssl/crypto/engine/eng_lib.c", - "//third_party/openssl/crypto/engine/eng_list.c", - "//third_party/openssl/crypto/engine/eng_openssl.c", - "//third_party/openssl/crypto/engine/eng_pkey.c", - "//third_party/openssl/crypto/engine/eng_rdrand.c", - "//third_party/openssl/crypto/engine/eng_table.c", - "//third_party/openssl/crypto/engine/tb_asnmth.c", - "//third_party/openssl/crypto/engine/tb_cipher.c", - "//third_party/openssl/crypto/engine/tb_dh.c", - "//third_party/openssl/crypto/engine/tb_digest.c", - "//third_party/openssl/crypto/engine/tb_dsa.c", - "//third_party/openssl/crypto/engine/tb_eckey.c", - "//third_party/openssl/crypto/engine/tb_pkmeth.c", - "//third_party/openssl/crypto/engine/tb_rand.c", - "//third_party/openssl/crypto/engine/tb_rsa.c", - "//third_party/openssl/crypto/err/err.c", - "//third_party/openssl/crypto/err/err_all.c", - "//third_party/openssl/crypto/err/err_all_legacy.c", - "//third_party/openssl/crypto/err/err_blocks.c", - "//third_party/openssl/crypto/err/err_prn.c", - "//third_party/openssl/crypto/ess/ess_asn1.c", - "//third_party/openssl/crypto/ess/ess_err.c", - "//third_party/openssl/crypto/ess/ess_lib.c", - "//third_party/openssl/crypto/evp/asymcipher.c", - "//third_party/openssl/crypto/evp/bio_b64.c", - "//third_party/openssl/crypto/evp/bio_enc.c", - "//third_party/openssl/crypto/evp/bio_md.c", - "//third_party/openssl/crypto/evp/bio_ok.c", - "//third_party/openssl/crypto/evp/c_allc.c", - "//third_party/openssl/crypto/evp/c_alld.c", - "//third_party/openssl/crypto/evp/cmeth_lib.c", - "//third_party/openssl/crypto/evp/ctrl_params_translate.c", - "//third_party/openssl/crypto/evp/dh_ctrl.c", - "//third_party/openssl/crypto/evp/dh_support.c", - "//third_party/openssl/crypto/evp/digest.c", - "//third_party/openssl/crypto/evp/dsa_ctrl.c", - "//third_party/openssl/crypto/evp/e_aes.c", - "//third_party/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c", - "//third_party/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c", - "//third_party/openssl/crypto/evp/e_aria.c", - "//third_party/openssl/crypto/evp/e_bf.c", - "//third_party/openssl/crypto/evp/e_camellia.c", - "//third_party/openssl/crypto/evp/e_cast.c", - "//third_party/openssl/crypto/evp/e_chacha20_poly1305.c", - "//third_party/openssl/crypto/evp/e_des.c", - "//third_party/openssl/crypto/evp/e_des3.c", - "//third_party/openssl/crypto/evp/e_idea.c", - "//third_party/openssl/crypto/evp/e_null.c", - "//third_party/openssl/crypto/evp/e_old.c", - "//third_party/openssl/crypto/evp/e_rc2.c", - "//third_party/openssl/crypto/evp/e_rc4.c", - "//third_party/openssl/crypto/evp/e_rc4_hmac_md5.c", - "//third_party/openssl/crypto/evp/e_rc5.c", - "//third_party/openssl/crypto/evp/e_seed.c", - "//third_party/openssl/crypto/evp/e_sm4.c", - "//third_party/openssl/crypto/evp/e_xcbc_d.c", - "//third_party/openssl/crypto/evp/ec_ctrl.c", - "//third_party/openssl/crypto/evp/ec_support.c", - "//third_party/openssl/crypto/evp/encode.c", - "//third_party/openssl/crypto/evp/evp_cnf.c", - "//third_party/openssl/crypto/evp/evp_enc.c", - "//third_party/openssl/crypto/evp/evp_err.c", - "//third_party/openssl/crypto/evp/evp_fetch.c", - "//third_party/openssl/crypto/evp/evp_key.c", - "//third_party/openssl/crypto/evp/evp_lib.c", - "//third_party/openssl/crypto/evp/evp_pbe.c", - "//third_party/openssl/crypto/evp/evp_pkey.c", - "//third_party/openssl/crypto/evp/evp_rand.c", - "//third_party/openssl/crypto/evp/evp_utils.c", - "//third_party/openssl/crypto/evp/exchange.c", - "//third_party/openssl/crypto/evp/kdf_lib.c", - "//third_party/openssl/crypto/evp/kdf_meth.c", - "//third_party/openssl/crypto/evp/kem.c", - "//third_party/openssl/crypto/evp/keymgmt_lib.c", - "//third_party/openssl/crypto/evp/keymgmt_meth.c", - "//third_party/openssl/crypto/evp/legacy_blake2.c", - "//third_party/openssl/crypto/evp/legacy_md4.c", - "//third_party/openssl/crypto/evp/legacy_md5.c", - "//third_party/openssl/crypto/evp/legacy_md5_sha1.c", - "//third_party/openssl/crypto/evp/legacy_mdc2.c", - "//third_party/openssl/crypto/evp/legacy_ripemd.c", - "//third_party/openssl/crypto/evp/legacy_sha.c", - "//third_party/openssl/crypto/evp/legacy_wp.c", - "//third_party/openssl/crypto/evp/m_null.c", - "//third_party/openssl/crypto/evp/m_sigver.c", - "//third_party/openssl/crypto/evp/mac_lib.c", - "//third_party/openssl/crypto/evp/mac_meth.c", - "//third_party/openssl/crypto/evp/names.c", - "//third_party/openssl/crypto/evp/p5_crpt.c", - "//third_party/openssl/crypto/evp/p5_crpt2.c", - "//third_party/openssl/crypto/evp/p_dec.c", - "//third_party/openssl/crypto/evp/p_enc.c", - "//third_party/openssl/crypto/evp/p_legacy.c", - "//third_party/openssl/crypto/evp/p_lib.c", - "//third_party/openssl/crypto/evp/p_open.c", - "//third_party/openssl/crypto/evp/p_seal.c", - "//third_party/openssl/crypto/evp/p_sign.c", - "//third_party/openssl/crypto/evp/p_verify.c", - "//third_party/openssl/crypto/evp/pbe_scrypt.c", - "//third_party/openssl/crypto/evp/pmeth_check.c", - "//third_party/openssl/crypto/evp/pmeth_gn.c", - "//third_party/openssl/crypto/evp/pmeth_lib.c", - "//third_party/openssl/crypto/evp/signature.c", - "//third_party/openssl/crypto/ex_data.c", - "//third_party/openssl/crypto/ffc/ffc_backend.c", - "//third_party/openssl/crypto/ffc/ffc_dh.c", - "//third_party/openssl/crypto/ffc/ffc_key_generate.c", - "//third_party/openssl/crypto/ffc/ffc_key_validate.c", - "//third_party/openssl/crypto/ffc/ffc_params.c", - "//third_party/openssl/crypto/ffc/ffc_params_generate.c", - "//third_party/openssl/crypto/ffc/ffc_params_validate.c", - "//third_party/openssl/crypto/getenv.c", - "//third_party/openssl/crypto/hmac/hmac.c", - "//third_party/openssl/crypto/http/http_client.c", - "//third_party/openssl/crypto/http/http_err.c", - "//third_party/openssl/crypto/http/http_lib.c", - "//third_party/openssl/crypto/idea/i_cbc.c", - "//third_party/openssl/crypto/idea/i_cfb64.c", - "//third_party/openssl/crypto/idea/i_ecb.c", - "//third_party/openssl/crypto/idea/i_ofb64.c", - "//third_party/openssl/crypto/idea/i_skey.c", - "//third_party/openssl/crypto/info.c", - "//third_party/openssl/crypto/init.c", - "//third_party/openssl/crypto/initthread.c", - "//third_party/openssl/crypto/kdf/kdf_err.c", - "//third_party/openssl/crypto/lhash/lh_stats.c", - "//third_party/openssl/crypto/lhash/lhash.c", - "//third_party/openssl/crypto/md4/md4_dgst.c", - "//third_party/openssl/crypto/md4/md4_one.c", - "//third_party/openssl/crypto/md5/md5_dgst.c", - "//third_party/openssl/crypto/md5/md5_one.c", - "//third_party/openssl/crypto/md5/md5_sha1.c", - "//third_party/openssl/crypto/mdc2/mdc2_one.c", - "//third_party/openssl/crypto/mdc2/mdc2dgst.c", - "//third_party/openssl/crypto/mem.c", - "//third_party/openssl/crypto/mem_sec.c", - "//third_party/openssl/crypto/modes/cbc128.c", - "//third_party/openssl/crypto/modes/ccm128.c", - "//third_party/openssl/crypto/modes/cfb128.c", - "//third_party/openssl/crypto/modes/ctr128.c", - "//third_party/openssl/crypto/modes/cts128.c", - "//third_party/openssl/crypto/modes/gcm128.c", - "//third_party/openssl/crypto/modes/ocb128.c", - "//third_party/openssl/crypto/modes/ofb128.c", - "//third_party/openssl/crypto/modes/siv128.c", - "//third_party/openssl/crypto/modes/wrap128.c", - "//third_party/openssl/crypto/modes/xts128.c", - "//third_party/openssl/crypto/o_dir.c", - "//third_party/openssl/crypto/o_fopen.c", - "//third_party/openssl/crypto/o_init.c", - "//third_party/openssl/crypto/o_str.c", - "//third_party/openssl/crypto/o_time.c", - "//third_party/openssl/crypto/objects/o_names.c", - "//third_party/openssl/crypto/objects/obj_dat.c", - "//third_party/openssl/crypto/objects/obj_err.c", - "//third_party/openssl/crypto/objects/obj_lib.c", - "//third_party/openssl/crypto/objects/obj_xref.c", - "//third_party/openssl/crypto/ocsp/ocsp_asn.c", - "//third_party/openssl/crypto/ocsp/ocsp_cl.c", - "//third_party/openssl/crypto/ocsp/ocsp_err.c", - "//third_party/openssl/crypto/ocsp/ocsp_ext.c", - "//third_party/openssl/crypto/ocsp/ocsp_http.c", - "//third_party/openssl/crypto/ocsp/ocsp_lib.c", - "//third_party/openssl/crypto/ocsp/ocsp_prn.c", - "//third_party/openssl/crypto/ocsp/ocsp_srv.c", - "//third_party/openssl/crypto/ocsp/ocsp_vfy.c", - "//third_party/openssl/crypto/ocsp/v3_ocsp.c", - "//third_party/openssl/crypto/packet.c", - "//third_party/openssl/crypto/param_build.c", - "//third_party/openssl/crypto/param_build_set.c", - "//third_party/openssl/crypto/params.c", - "//third_party/openssl/crypto/params_dup.c", - "//third_party/openssl/crypto/params_from_text.c", - "//third_party/openssl/crypto/passphrase.c", - "//third_party/openssl/crypto/pem/pem_all.c", - "//third_party/openssl/crypto/pem/pem_err.c", - "//third_party/openssl/crypto/pem/pem_info.c", - "//third_party/openssl/crypto/pem/pem_lib.c", - "//third_party/openssl/crypto/pem/pem_oth.c", - "//third_party/openssl/crypto/pem/pem_pk8.c", - "//third_party/openssl/crypto/pem/pem_pkey.c", - "//third_party/openssl/crypto/pem/pem_sign.c", - "//third_party/openssl/crypto/pem/pem_x509.c", - "//third_party/openssl/crypto/pem/pem_xaux.c", - "//third_party/openssl/crypto/pem/pvkfmt.c", - "//third_party/openssl/crypto/pkcs12/p12_add.c", - "//third_party/openssl/crypto/pkcs12/p12_asn.c", - "//third_party/openssl/crypto/pkcs12/p12_attr.c", - "//third_party/openssl/crypto/pkcs12/p12_crpt.c", - "//third_party/openssl/crypto/pkcs12/p12_crt.c", - "//third_party/openssl/crypto/pkcs12/p12_decr.c", - "//third_party/openssl/crypto/pkcs12/p12_init.c", - "//third_party/openssl/crypto/pkcs12/p12_key.c", - "//third_party/openssl/crypto/pkcs12/p12_kiss.c", - "//third_party/openssl/crypto/pkcs12/p12_mutl.c", - "//third_party/openssl/crypto/pkcs12/p12_npas.c", - "//third_party/openssl/crypto/pkcs12/p12_p8d.c", - "//third_party/openssl/crypto/pkcs12/p12_p8e.c", - "//third_party/openssl/crypto/pkcs12/p12_sbag.c", - "//third_party/openssl/crypto/pkcs12/p12_utl.c", - "//third_party/openssl/crypto/pkcs12/pk12err.c", - "//third_party/openssl/crypto/pkcs7/bio_pk7.c", - "//third_party/openssl/crypto/pkcs7/pk7_asn1.c", - "//third_party/openssl/crypto/pkcs7/pk7_attr.c", - "//third_party/openssl/crypto/pkcs7/pk7_doit.c", - "//third_party/openssl/crypto/pkcs7/pk7_lib.c", - "//third_party/openssl/crypto/pkcs7/pk7_mime.c", - "//third_party/openssl/crypto/pkcs7/pk7_smime.c", - "//third_party/openssl/crypto/pkcs7/pkcs7err.c", - "//third_party/openssl/crypto/poly1305/poly1305.c", - "//third_party/openssl/crypto/property/defn_cache.c", - "//third_party/openssl/crypto/property/property.c", - "//third_party/openssl/crypto/property/property_err.c", - "//third_party/openssl/crypto/property/property_parse.c", - "//third_party/openssl/crypto/property/property_query.c", - "//third_party/openssl/crypto/property/property_string.c", - "//third_party/openssl/crypto/provider.c", - "//third_party/openssl/crypto/provider_child.c", - "//third_party/openssl/crypto/provider_conf.c", - "//third_party/openssl/crypto/provider_core.c", - "//third_party/openssl/crypto/provider_predefined.c", - "//third_party/openssl/crypto/punycode.c", - "//third_party/openssl/crypto/rand/prov_seed.c", - "//third_party/openssl/crypto/rand/rand_deprecated.c", - "//third_party/openssl/crypto/rand/rand_err.c", - "//third_party/openssl/crypto/rand/rand_lib.c", - "//third_party/openssl/crypto/rand/rand_meth.c", - "//third_party/openssl/crypto/rand/rand_pool.c", - "//third_party/openssl/crypto/rand/randfile.c", - "//third_party/openssl/crypto/rc2/rc2_cbc.c", - "//third_party/openssl/crypto/rc2/rc2_ecb.c", - "//third_party/openssl/crypto/rc2/rc2_skey.c", - "//third_party/openssl/crypto/rc2/rc2cfb64.c", - "//third_party/openssl/crypto/rc2/rc2ofb64.c", - "//third_party/openssl/crypto/ripemd/rmd_dgst.c", - "//third_party/openssl/crypto/ripemd/rmd_one.c", - "//third_party/openssl/crypto/rsa/rsa_ameth.c", - "//third_party/openssl/crypto/rsa/rsa_asn1.c", - "//third_party/openssl/crypto/rsa/rsa_backend.c", - "//third_party/openssl/crypto/rsa/rsa_chk.c", - "//third_party/openssl/crypto/rsa/rsa_crpt.c", - "//third_party/openssl/crypto/rsa/rsa_depr.c", - "//third_party/openssl/crypto/rsa/rsa_err.c", - "//third_party/openssl/crypto/rsa/rsa_gen.c", - "//third_party/openssl/crypto/rsa/rsa_lib.c", - "//third_party/openssl/crypto/rsa/rsa_meth.c", - "//third_party/openssl/crypto/rsa/rsa_mp.c", - "//third_party/openssl/crypto/rsa/rsa_mp_names.c", - "//third_party/openssl/crypto/rsa/rsa_none.c", - "//third_party/openssl/crypto/rsa/rsa_oaep.c", - "//third_party/openssl/crypto/rsa/rsa_ossl.c", - "//third_party/openssl/crypto/rsa/rsa_pk1.c", - "//third_party/openssl/crypto/rsa/rsa_pmeth.c", - "//third_party/openssl/crypto/rsa/rsa_prn.c", - "//third_party/openssl/crypto/rsa/rsa_pss.c", - "//third_party/openssl/crypto/rsa/rsa_saos.c", - "//third_party/openssl/crypto/rsa/rsa_schemes.c", - "//third_party/openssl/crypto/rsa/rsa_sign.c", - "//third_party/openssl/crypto/rsa/rsa_sp800_56b_check.c", - "//third_party/openssl/crypto/rsa/rsa_sp800_56b_gen.c", - "//third_party/openssl/crypto/rsa/rsa_x931.c", - "//third_party/openssl/crypto/rsa/rsa_x931g.c", - "//third_party/openssl/crypto/seed/seed.c", - "//third_party/openssl/crypto/seed/seed_cbc.c", - "//third_party/openssl/crypto/seed/seed_cfb.c", - "//third_party/openssl/crypto/seed/seed_ecb.c", - "//third_party/openssl/crypto/seed/seed_ofb.c", - "//third_party/openssl/crypto/self_test_core.c", - "//third_party/openssl/crypto/sha/sha1_one.c", - "//third_party/openssl/crypto/sha/sha1dgst.c", - "//third_party/openssl/crypto/sha/sha256.c", - "//third_party/openssl/crypto/sha/sha3.c", - "//third_party/openssl/crypto/sha/sha512.c", - "//third_party/openssl/crypto/siphash/siphash.c", - "//third_party/openssl/crypto/sm2/sm2_crypt.c", - "//third_party/openssl/crypto/sm2/sm2_err.c", - "//third_party/openssl/crypto/sm2/sm2_key.c", - "//third_party/openssl/crypto/sm2/sm2_sign.c", - "//third_party/openssl/crypto/sm3/legacy_sm3.c", - "//third_party/openssl/crypto/sm3/sm3.c", - "//third_party/openssl/crypto/sm4/sm4.c", - "//third_party/openssl/crypto/sparse_array.c", - "//third_party/openssl/crypto/srp/srp_lib.c", - "//third_party/openssl/crypto/srp/srp_vfy.c", - "//third_party/openssl/crypto/stack/stack.c", - "//third_party/openssl/crypto/store/store_err.c", - "//third_party/openssl/crypto/store/store_init.c", - "//third_party/openssl/crypto/store/store_lib.c", - "//third_party/openssl/crypto/store/store_meth.c", - "//third_party/openssl/crypto/store/store_register.c", - "//third_party/openssl/crypto/store/store_result.c", - "//third_party/openssl/crypto/store/store_strings.c", - "//third_party/openssl/crypto/threads_lib.c", - "//third_party/openssl/crypto/threads_none.c", - "//third_party/openssl/crypto/threads_pthread.c", - "//third_party/openssl/crypto/threads_win.c", - "//third_party/openssl/crypto/trace.c", - "//third_party/openssl/crypto/ts/ts_asn1.c", - "//third_party/openssl/crypto/ts/ts_conf.c", - "//third_party/openssl/crypto/ts/ts_err.c", - "//third_party/openssl/crypto/ts/ts_lib.c", - "//third_party/openssl/crypto/ts/ts_req_print.c", - "//third_party/openssl/crypto/ts/ts_req_utils.c", - "//third_party/openssl/crypto/ts/ts_rsp_print.c", - "//third_party/openssl/crypto/ts/ts_rsp_sign.c", - "//third_party/openssl/crypto/ts/ts_rsp_utils.c", - "//third_party/openssl/crypto/ts/ts_rsp_verify.c", - "//third_party/openssl/crypto/ts/ts_verify_ctx.c", - "//third_party/openssl/crypto/txt_db/txt_db.c", - "//third_party/openssl/crypto/ui/ui_err.c", - "//third_party/openssl/crypto/ui/ui_lib.c", - "//third_party/openssl/crypto/ui/ui_null.c", - "//third_party/openssl/crypto/ui/ui_openssl.c", - "//third_party/openssl/crypto/ui/ui_util.c", - "//third_party/openssl/crypto/uid.c", - "//third_party/openssl/crypto/whrlpool/wp_dgst.c", - "//third_party/openssl/crypto/x509/by_dir.c", - "//third_party/openssl/crypto/x509/by_file.c", - "//third_party/openssl/crypto/x509/by_store.c", - "//third_party/openssl/crypto/x509/pcy_cache.c", - "//third_party/openssl/crypto/x509/pcy_data.c", - "//third_party/openssl/crypto/x509/pcy_lib.c", - "//third_party/openssl/crypto/x509/pcy_map.c", - "//third_party/openssl/crypto/x509/pcy_node.c", - "//third_party/openssl/crypto/x509/pcy_tree.c", - "//third_party/openssl/crypto/x509/t_crl.c", - "//third_party/openssl/crypto/x509/t_req.c", - "//third_party/openssl/crypto/x509/t_x509.c", - "//third_party/openssl/crypto/x509/v3_addr.c", - "//third_party/openssl/crypto/x509/v3_admis.c", - "//third_party/openssl/crypto/x509/v3_akeya.c", - "//third_party/openssl/crypto/x509/v3_akid.c", - "//third_party/openssl/crypto/x509/v3_asid.c", - "//third_party/openssl/crypto/x509/v3_bcons.c", - "//third_party/openssl/crypto/x509/v3_bitst.c", - "//third_party/openssl/crypto/x509/v3_conf.c", - "//third_party/openssl/crypto/x509/v3_cpols.c", - "//third_party/openssl/crypto/x509/v3_crld.c", - "//third_party/openssl/crypto/x509/v3_enum.c", - "//third_party/openssl/crypto/x509/v3_extku.c", - "//third_party/openssl/crypto/x509/v3_genn.c", - "//third_party/openssl/crypto/x509/v3_ia5.c", - "//third_party/openssl/crypto/x509/v3_info.c", - "//third_party/openssl/crypto/x509/v3_int.c", - "//third_party/openssl/crypto/x509/v3_ist.c", - "//third_party/openssl/crypto/x509/v3_lib.c", - "//third_party/openssl/crypto/x509/v3_ncons.c", - "//third_party/openssl/crypto/x509/v3_pci.c", - "//third_party/openssl/crypto/x509/v3_pcia.c", - "//third_party/openssl/crypto/x509/v3_pcons.c", - "//third_party/openssl/crypto/x509/v3_pku.c", - "//third_party/openssl/crypto/x509/v3_pmaps.c", - "//third_party/openssl/crypto/x509/v3_prn.c", - "//third_party/openssl/crypto/x509/v3_purp.c", - "//third_party/openssl/crypto/x509/v3_san.c", - "//third_party/openssl/crypto/x509/v3_skid.c", - "//third_party/openssl/crypto/x509/v3_sxnet.c", - "//third_party/openssl/crypto/x509/v3_tlsf.c", - "//third_party/openssl/crypto/x509/v3_utf8.c", - "//third_party/openssl/crypto/x509/v3_utl.c", - "//third_party/openssl/crypto/x509/v3err.c", - "//third_party/openssl/crypto/x509/x509_att.c", - "//third_party/openssl/crypto/x509/x509_cmp.c", - "//third_party/openssl/crypto/x509/x509_d2.c", - "//third_party/openssl/crypto/x509/x509_def.c", - "//third_party/openssl/crypto/x509/x509_err.c", - "//third_party/openssl/crypto/x509/x509_ext.c", - "//third_party/openssl/crypto/x509/x509_lu.c", - "//third_party/openssl/crypto/x509/x509_meth.c", - "//third_party/openssl/crypto/x509/x509_obj.c", - "//third_party/openssl/crypto/x509/x509_r2x.c", - "//third_party/openssl/crypto/x509/x509_req.c", - "//third_party/openssl/crypto/x509/x509_set.c", - "//third_party/openssl/crypto/x509/x509_trust.c", - "//third_party/openssl/crypto/x509/x509_txt.c", - "//third_party/openssl/crypto/x509/x509_v3.c", - "//third_party/openssl/crypto/x509/x509_vfy.c", - "//third_party/openssl/crypto/x509/x509_vpm.c", - "//third_party/openssl/crypto/x509/x509cset.c", - "//third_party/openssl/crypto/x509/x509name.c", - "//third_party/openssl/crypto/x509/x509rset.c", - "//third_party/openssl/crypto/x509/x509spki.c", - "//third_party/openssl/crypto/x509/x509type.c", - "//third_party/openssl/crypto/x509/x_all.c", - "//third_party/openssl/crypto/x509/x_attrib.c", - "//third_party/openssl/crypto/x509/x_crl.c", - "//third_party/openssl/crypto/x509/x_exten.c", - "//third_party/openssl/crypto/x509/x_name.c", - "//third_party/openssl/crypto/x509/x_pubkey.c", - "//third_party/openssl/crypto/x509/x_req.c", - "//third_party/openssl/crypto/x509/x_x509.c", - "//third_party/openssl/crypto/x509/x_x509a.c", - "//third_party/openssl/engines/e_capi.c", - "//third_party/openssl/engines/e_padlock.c", - "//third_party/openssl/providers/baseprov.c", - "//third_party/openssl/providers/defltprov.c", - "//third_party/openssl/providers/legacyprov.c", - "//third_party/openssl/providers/nullprov.c", - "//third_party/openssl/providers/prov_running.c", - ] - sources += libcommon_common_sources - sources += libcommon_build_all_generated_selected_platform_sources - sources += libdefault_common_sources - sources += libdefault_build_all_generated_selected_platform_sources - sources += libcrypto_build_all_generated_selected_platform_sources - sources += liblegacy_sources - - if (openssl_selected_platform == "linux-armv4") { - # 升级修改适配检查点21 libcrypto 不同平台c源码列表 - sources += [ - "//third_party/openssl/crypto/aes/aes_cbc.c", - "//third_party/openssl/crypto/armcap.c", - "//third_party/openssl/crypto/bn/bn_asm.c", - "//third_party/openssl/crypto/camellia/camellia.c", - "//third_party/openssl/crypto/camellia/cmll_cbc.c", - "//third_party/openssl/crypto/rc4/rc4_enc.c", - "//third_party/openssl/crypto/rc4/rc4_skey.c", - "//third_party/openssl/crypto/whrlpool/wp_block.c", - "//third_party/openssl/engines/e_afalg.c", - ] - } else if (openssl_selected_platform == "linux-aarch64") { - # 升级修改适配检查点22 libcrypto 不同平台c源码列表 - sources += [ - "//third_party/openssl/crypto/aes/aes_cbc.c", - "//third_party/openssl/crypto/aes/aes_core.c", - "//third_party/openssl/crypto/armcap.c", - "//third_party/openssl/crypto/bn/bn_asm.c", - "//third_party/openssl/crypto/camellia/camellia.c", - "//third_party/openssl/crypto/camellia/cmll_cbc.c", - "//third_party/openssl/crypto/rc4/rc4_enc.c", - "//third_party/openssl/crypto/rc4/rc4_skey.c", - "//third_party/openssl/crypto/whrlpool/wp_block.c", - "//third_party/openssl/engines/e_afalg.c", - ] - } else if (openssl_selected_platform == "darwin64-x86_64-cc") { - # 升级修改适配检查点23 libcrypto 不同平台c源码列表 - sources += [ - "//third_party/openssl/crypto/bn/asm/x86_64-gcc.c", - "//third_party/openssl/crypto/bn/rsaz_exp.c", - "//third_party/openssl/crypto/bn/rsaz_exp_x2.c", - ] - } else if (openssl_selected_platform == "darwin64-arm64-cc") { - # 升级修改适配检查点24 libcrypto 不同平台c源码列表 - sources += [ - "//third_party/openssl/crypto/aes/aes_cbc.c", - "//third_party/openssl/crypto/aes/aes_core.c", - "//third_party/openssl/crypto/armcap.c", - "//third_party/openssl/crypto/bn/bn_asm.c", - "//third_party/openssl/crypto/camellia/camellia.c", - "//third_party/openssl/crypto/camellia/cmll_cbc.c", - "//third_party/openssl/crypto/rc4/rc4_enc.c", - "//third_party/openssl/crypto/rc4/rc4_skey.c", - "//third_party/openssl/crypto/whrlpool/wp_block.c", - ] - } else if (openssl_selected_platform == "linux-x86_64") { - # 升级修改适配检查点25 libcrypto 不同平台c源码列表 - sources += [ - "//third_party/openssl/crypto/bn/asm/x86_64-gcc.c", - "//third_party/openssl/crypto/bn/rsaz_exp.c", - "//third_party/openssl/crypto/bn/rsaz_exp_x2.c", - "//third_party/openssl/engines/e_afalg.c", - ] - } else if (openssl_selected_platform == "mingw64") { - # 升级修改适配检查点26 libcrypto 不同平台c源码列表 - sources += [ - "//third_party/openssl/crypto/bn/asm/x86_64-gcc.c", - "//third_party/openssl/crypto/bn/rsaz_exp.c", - "//third_party/openssl/crypto/bn/rsaz_exp_x2.c", - ] - } - - configs = [ ":crypto_config_private" ] - public_configs = [ ":crypto_config_public" ] - deps = [ ":openssl_build_all_generated" ] -} - -ohos_static_library("libcrypto_static") { - subsystem_name = "thirdparty" - part_name = "openssl" - deps = [ ":crypto_source" ] - public_configs = [ ":crypto_config_public" ] - complete_static_lib = true -} - -if (is_mingw || is_mac) { - ohos_shared_library("libcrypto_restool") { - sources = [] - configs = [] - deps = [ ":crypto_source" ] - if (openssl_selected_platform == "mingw64") { - sources += [ "//third_party/openssl/crypto/dllmain.c" ] - configs += [ ":crypto_config_private" ] - } - subsystem_name = "thirdparty" - part_name = "openssl" - public_configs = [ ":crypto_config_public" ] - install_images = [ - "system", - "updater", - ] - } -} - -ohos_shared_library("libcrypto_shared") { - sources = [] - configs = [] - deps = [ - ":crypto_source", - ":openssl.cnf", - ] - if (openssl_selected_platform == "mingw64") { - sources += [ "//third_party/openssl/crypto/dllmain.c" ] - configs += [ ":crypto_config_private" ] - } - if (current_os == "ios") { - ldflags = [ - "-Wl", - "-install_name", - "@rpath/libcrypto_openssl.framework/libcrypto_openssl", - ] - output_name = "crypto_openssl" - } else { - output_name = "libcrypto_openssl" - } - subsystem_name = "thirdparty" - part_name = "openssl" - innerapi_tags = [ - "platformsdk", - "chipsetsdk", - ] - public_configs = [ ":crypto_config_public" ] - install_images = [ - "system", - "updater", - ] -} - -if (current_os == "ios") { - ohos_combine_darwin_framework("libcrypto_openssl") { - deps = [ ":libcrypto_shared" ] - subsystem_name = "thirdparty" - part_name = "openssl" - } -} - -unused_variables = [] -unused_variables += unused_variables -unused_variables += crypto_config_common_private_include_dirs -unused_variables += crypto_config_common_public_include_dirs -unused_variables += crypto_config_common_cflags -unused_variables += crypto_config_linux_armv4_cflags -unused_variables += crypto_config_linux_aarch64_cflags -unused_variables += crypto_config_darwin64_x86_64_cc_cflags -unused_variables += crypto_config_darwin64_arm64_cc_cflags -unused_variables += crypto_config_linux_x86_64_cflags -unused_variables += crypto_config_mingw64_cflags -unused_variables += libcommon_common_sources -unused_variables += libdefault_common_sources -unused_variables += libcrypto_build_all_generated_linux_armv4_sources -unused_variables += libcrypto_build_all_generated_linux_aarch64_sources -unused_variables += libcrypto_build_all_generated_darwin64_x86_64_cc_sources -unused_variables += libcrypto_build_all_generated_darwin64_arm64_cc_sources -unused_variables += libcrypto_build_all_generated_linux_x86_64_sources -unused_variables += libcrypto_build_all_generated_mingw64_sources - -config("ssl_config_private") { - include_dirs = crypto_config_common_private_include_dirs - cflags = crypto_config_common_cflags + crypto_config_current_platform_cflags + - openssl_internal_cflags -} - -config("ssl_config_public") { - include_dirs = crypto_config_common_public_include_dirs -} - -ohos_source_set("ssl_source") { - subsystem_name = "thirdparty" - part_name = "openssl" - - # 升级修改适配检查点27 libssl 源码列表 - sources = [ - "//third_party/openssl/ssl/bio_ssl.c", - "//third_party/openssl/ssl/d1_lib.c", - "//third_party/openssl/ssl/d1_msg.c", - "//third_party/openssl/ssl/d1_srtp.c", - "//third_party/openssl/ssl/methods.c", - "//third_party/openssl/ssl/pqueue.c", - "//third_party/openssl/ssl/record/dtls1_bitmap.c", - "//third_party/openssl/ssl/record/rec_layer_d1.c", - "//third_party/openssl/ssl/record/rec_layer_s3.c", - "//third_party/openssl/ssl/record/ssl3_buffer.c", - "//third_party/openssl/ssl/record/ssl3_record.c", - "//third_party/openssl/ssl/record/ssl3_record_tls13.c", - "//third_party/openssl/ssl/s3_enc.c", - "//third_party/openssl/ssl/s3_lib.c", - "//third_party/openssl/ssl/s3_msg.c", - "//third_party/openssl/ssl/ssl_asn1.c", - "//third_party/openssl/ssl/ssl_cert.c", - "//third_party/openssl/ssl/ssl_ciph.c", - "//third_party/openssl/ssl/ssl_conf.c", - "//third_party/openssl/ssl/ssl_err.c", - "//third_party/openssl/ssl/ssl_err_legacy.c", - "//third_party/openssl/ssl/ssl_init.c", - "//third_party/openssl/ssl/ssl_lib.c", - "//third_party/openssl/ssl/ssl_mcnf.c", - "//third_party/openssl/ssl/ssl_rsa.c", - "//third_party/openssl/ssl/ssl_rsa_legacy.c", - "//third_party/openssl/ssl/ssl_sess.c", - "//third_party/openssl/ssl/ssl_stat.c", - "//third_party/openssl/ssl/ssl_txt.c", - "//third_party/openssl/ssl/ssl_utst.c", - "//third_party/openssl/ssl/statem/extensions.c", - "//third_party/openssl/ssl/statem/extensions_clnt.c", - "//third_party/openssl/ssl/statem/extensions_cust.c", - "//third_party/openssl/ssl/statem/extensions_srvr.c", - "//third_party/openssl/ssl/statem/statem.c", - "//third_party/openssl/ssl/statem/statem_clnt.c", - "//third_party/openssl/ssl/statem/statem_dtls.c", - "//third_party/openssl/ssl/statem/statem_lib.c", - "//third_party/openssl/ssl/statem/statem_srvr.c", - "//third_party/openssl/ssl/t1_enc.c", - "//third_party/openssl/ssl/t1_lib.c", - "//third_party/openssl/ssl/t1_trce.c", - "//third_party/openssl/ssl/tls13_enc.c", - "//third_party/openssl/ssl/tls_depr.c", - "//third_party/openssl/ssl/tls_srp.c", - ] - - configs = [ ":ssl_config_private" ] - public_configs = [ ":ssl_config_public" ] - deps = [ ":openssl_build_all_generated" ] -} - -ohos_static_library("libssl_static") { - subsystem_name = "thirdparty" - part_name = "openssl" - deps = [ ":ssl_source" ] - public_configs = [ ":ssl_config_public" ] - complete_static_lib = true -} - -ohos_shared_library("libssl_shared") { - deps = [ - ":libcrypto_shared", - ":openssl.cnf", - ":ssl_source", - ] - if (current_os == "ios") { - ldflags = [ - "-Wl", - "-install_name", - "@rpath/libssl_openssl.framework/libssl_openssl", - ] - output_name = "ssl_openssl" - } else { - output_name = "libssl_openssl" - } - subsystem_name = "thirdparty" - part_name = "openssl" - - innerapi_tags = [ - "platformsdk", - "chipsetsdk", - ] - public_configs = [ - ":crypto_config_public", - ":ssl_config_public", - ] - - install_images = [ - "system", - - # compile libssl_openssl.z.so to the updater image for wpa to use - "updater", - ] -} - -if (current_os == "ios") { - ohos_combine_darwin_framework("libssl_openssl") { - deps = [ ":libssl_shared" ] - subsystem_name = "thirdparty" - part_name = "openssl" - } -} - -ohos_static_library("libapps") { - # 升级修改适配检查点28 libapps 源码列表 - sources = [ - "//third_party/openssl/apps/lib/app_libctx.c", - "//third_party/openssl/apps/lib/app_params.c", - "//third_party/openssl/apps/lib/app_provider.c", - "//third_party/openssl/apps/lib/app_rand.c", - "//third_party/openssl/apps/lib/app_x509.c", - "//third_party/openssl/apps/lib/apps.c", - "//third_party/openssl/apps/lib/apps_ui.c", - "//third_party/openssl/apps/lib/columns.c", - "//third_party/openssl/apps/lib/engine.c", - "//third_party/openssl/apps/lib/engine_loader.c", - "//third_party/openssl/apps/lib/fmt.c", - "//third_party/openssl/apps/lib/http_server.c", - "//third_party/openssl/apps/lib/names.c", - "//third_party/openssl/apps/lib/opt.c", - "//third_party/openssl/apps/lib/s_cb.c", - "//third_party/openssl/apps/lib/s_socket.c", - "//third_party/openssl/apps/lib/tlssrp_depr.c", - ] - if (openssl_selected_platform == "mingw64") { - sources += [ "//third_party/openssl/apps/lib/win32_init.c" ] - } - subsystem_name = "thirdparty" - part_name = "openssl" - configs = [ ":crypto_config_private" ] -} - -ohos_executable("openssl") { - # 升级修改适配检查点29 apps/openssl 源码列表 - sources = [ - "${openssl_selected_platform_full_path}/apps/progs.c", - "//third_party/openssl/apps/asn1parse.c", - "//third_party/openssl/apps/ca.c", - "//third_party/openssl/apps/ciphers.c", - "//third_party/openssl/apps/cmp.c", - "//third_party/openssl/apps/cms.c", - "//third_party/openssl/apps/crl.c", - "//third_party/openssl/apps/crl2pkcs7.c", - "//third_party/openssl/apps/dgst.c", - "//third_party/openssl/apps/dhparam.c", - "//third_party/openssl/apps/dsa.c", - "//third_party/openssl/apps/dsaparam.c", - "//third_party/openssl/apps/ec.c", - "//third_party/openssl/apps/ecparam.c", - "//third_party/openssl/apps/enc.c", - "//third_party/openssl/apps/engine.c", - "//third_party/openssl/apps/errstr.c", - "//third_party/openssl/apps/fipsinstall.c", - "//third_party/openssl/apps/gendsa.c", - "//third_party/openssl/apps/genpkey.c", - "//third_party/openssl/apps/genrsa.c", - "//third_party/openssl/apps/info.c", - "//third_party/openssl/apps/kdf.c", - "//third_party/openssl/apps/lib/cmp_mock_srv.c", - "//third_party/openssl/apps/list.c", - "//third_party/openssl/apps/mac.c", - "//third_party/openssl/apps/nseq.c", - "//third_party/openssl/apps/ocsp.c", - "//third_party/openssl/apps/openssl.c", - "//third_party/openssl/apps/passwd.c", - "//third_party/openssl/apps/pkcs12.c", - "//third_party/openssl/apps/pkcs7.c", - "//third_party/openssl/apps/pkcs8.c", - "//third_party/openssl/apps/pkey.c", - "//third_party/openssl/apps/pkeyparam.c", - "//third_party/openssl/apps/pkeyutl.c", - "//third_party/openssl/apps/prime.c", - "//third_party/openssl/apps/rand.c", - "//third_party/openssl/apps/rehash.c", - "//third_party/openssl/apps/req.c", - "//third_party/openssl/apps/rsa.c", - "//third_party/openssl/apps/rsautl.c", - "//third_party/openssl/apps/s_client.c", - "//third_party/openssl/apps/s_server.c", - "//third_party/openssl/apps/s_time.c", - "//third_party/openssl/apps/sess_id.c", - "//third_party/openssl/apps/smime.c", - "//third_party/openssl/apps/speed.c", - "//third_party/openssl/apps/spkac.c", - "//third_party/openssl/apps/srp.c", - "//third_party/openssl/apps/storeutl.c", - "//third_party/openssl/apps/ts.c", - "//third_party/openssl/apps/verify.c", - "//third_party/openssl/apps/version.c", - "//third_party/openssl/apps/x509.c", - ] - if (openssl_selected_platform == "mingw64") { - sources += [ "${openssl_selected_platform_full_path}/apps/openssl.rc" ] - } - deps = [ - ":libapps", - ":libcrypto_shared", - ":libssl_shared", - ":openssl.cnf", - ":openssl_build_all_generated", - ] - subsystem_name = "thirdparty" - part_name = "openssl" - configs = [ ":crypto_config_private" ] -} -# 升级修改适配检查点 汇总 -# -# libcommon = -# libcommon 生成的源码列表(7) + -# libcommon 原目录源码列表(17) -# -# libdefault = -# libdefault 生成的源码列表(8) + -# libdefault 原目录源码列表(18) -# -# liblegacy = -# liblegacy 源码列表(19) -# -# libcrypto = -# libcrypto 不同平台汇编代码(1,2,3,4,5,6) + -# libcrypto 不同平台c源码列表(21,22,23,24,25,26) + -# libcrypto 原目录源码列表(20) + -# libcommon + -# libdefault + -# liblegacy -# -# libssl = -# libssl 源码列表(27) -# -# libapps = -# libapps 源码列表(28) -# -# apps/openssl = -# apps/openssl 源码列表(29) + -# libapps -# -# 编译选项 = -# 内部公共头文件目录列表(9) + -# 内部公共编译选项宏列表(10) + -# 内部不同平台编译选项列表(11,12,13,14,15,16) diff --git a/build/third_party_gn/openssl/dummy_bundle.json b/build/third_party_gn/openssl/dummy_bundle.json deleted file mode 100644 index f0bffa2b0676db18862c94cd5547d7f73cdbe297..0000000000000000000000000000000000000000 --- a/build/third_party_gn/openssl/dummy_bundle.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "name": "//arkcompiler/toolchain/build/third_party_gn/openssl:libcrypto_shared" - }, - { - "name": "//arkcompiler/toolchain/build/third_party_gn/openssl:libcrypto_static" - }, - { - "name": "//arkcompiler/toolchain/build/third_party_gn/openssl:libcrypto_restool" - } - ] - } - } -} \ No newline at end of file diff --git a/build/third_party_gn/protobuf/BUILD.gn b/build/third_party_gn/protobuf/BUILD.gn deleted file mode 100644 index 754fca1096d8fad8f317805792d2a9ced5bfb334..0000000000000000000000000000000000000000 --- a/build/third_party_gn/protobuf/BUILD.gn +++ /dev/null @@ -1,553 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//developtools/profiler/build/config.gni") -import("$build_root/ark.gni") - -THIRDPARTY_PROTOBUF_SUBSYS_NAME = "thirdparty" -THIRDPARTY_PROTOBUF_PART_NAME = "protobuf" -protobuf_src_root = "//third_party/protobuf/src" - -config("protobuf_config") { - include_dirs = [ "$protobuf_src_root" ] -} - -ohos_shared_library("protobuf_lite") { - sources = [ - "$protobuf_src_root/google/protobuf/any_lite.cc", - "$protobuf_src_root/google/protobuf/arena.cc", - "$protobuf_src_root/google/protobuf/extension_set.cc", - "$protobuf_src_root/google/protobuf/generated_enum_util.cc", - "$protobuf_src_root/google/protobuf/generated_message_table_driven_lite.cc", - "$protobuf_src_root/google/protobuf/generated_message_util.cc", - "$protobuf_src_root/google/protobuf/implicit_weak_message.cc", - "$protobuf_src_root/google/protobuf/io/coded_stream.cc", - "$protobuf_src_root/google/protobuf/io/io_win32.cc", - "$protobuf_src_root/google/protobuf/io/strtod.cc", - "$protobuf_src_root/google/protobuf/io/zero_copy_stream.cc", - "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl.cc", - "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl_lite.cc", - "$protobuf_src_root/google/protobuf/message_lite.cc", - "$protobuf_src_root/google/protobuf/parse_context.cc", - "$protobuf_src_root/google/protobuf/repeated_field.cc", - "$protobuf_src_root/google/protobuf/stubs/bytestream.cc", - "$protobuf_src_root/google/protobuf/stubs/common.cc", - "$protobuf_src_root/google/protobuf/stubs/int128.cc", - "$protobuf_src_root/google/protobuf/stubs/status.cc", - "$protobuf_src_root/google/protobuf/stubs/statusor.cc", - "$protobuf_src_root/google/protobuf/stubs/stringpiece.cc", - "$protobuf_src_root/google/protobuf/stubs/stringprintf.cc", - "$protobuf_src_root/google/protobuf/stubs/structurally_valid.cc", - "$protobuf_src_root/google/protobuf/stubs/strutil.cc", - "$protobuf_src_root/google/protobuf/stubs/time.cc", - "$protobuf_src_root/google/protobuf/wire_format_lite.cc", - ] - if (!is_asan && !is_debug) { - version_script = "libprotobuf_lite.map" - } - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - if (!is_mingw) { - if (current_toolchain != host_toolchain) { - external_deps = [ "hilog:libhilog" ] - } - } else { - defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ] - } - - cflags_cc = [ "-Wno-sign-compare" ] - cflags = [ - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - ] - - public_configs = [ ":protobuf_config" ] - install_enable = true - innerapi_tags = [ "platformsdk_indirect" ] - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" -} - -ohos_static_library("protobuf_lite_static") { - sources = [ - "$protobuf_src_root/google/protobuf/any_lite.cc", - "$protobuf_src_root/google/protobuf/arena.cc", - "$protobuf_src_root/google/protobuf/extension_set.cc", - "$protobuf_src_root/google/protobuf/generated_enum_util.cc", - "$protobuf_src_root/google/protobuf/generated_message_table_driven_lite.cc", - "$protobuf_src_root/google/protobuf/generated_message_util.cc", - "$protobuf_src_root/google/protobuf/implicit_weak_message.cc", - "$protobuf_src_root/google/protobuf/io/coded_stream.cc", - "$protobuf_src_root/google/protobuf/io/io_win32.cc", - "$protobuf_src_root/google/protobuf/io/strtod.cc", - "$protobuf_src_root/google/protobuf/io/zero_copy_stream.cc", - "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl.cc", - "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl_lite.cc", - "$protobuf_src_root/google/protobuf/message_lite.cc", - "$protobuf_src_root/google/protobuf/parse_context.cc", - "$protobuf_src_root/google/protobuf/repeated_field.cc", - "$protobuf_src_root/google/protobuf/stubs/bytestream.cc", - "$protobuf_src_root/google/protobuf/stubs/common.cc", - "$protobuf_src_root/google/protobuf/stubs/int128.cc", - "$protobuf_src_root/google/protobuf/stubs/status.cc", - "$protobuf_src_root/google/protobuf/stubs/statusor.cc", - "$protobuf_src_root/google/protobuf/stubs/stringpiece.cc", - "$protobuf_src_root/google/protobuf/stubs/stringprintf.cc", - "$protobuf_src_root/google/protobuf/stubs/structurally_valid.cc", - "$protobuf_src_root/google/protobuf/stubs/strutil.cc", - "$protobuf_src_root/google/protobuf/stubs/time.cc", - "$protobuf_src_root/google/protobuf/wire_format_lite.cc", - ] - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - if (!is_mingw) { - if (current_toolchain != host_toolchain) { - # target build, not host build - defines = [ "HAVE_HILOG" ] - external_deps = [ "hilog:libhilog" ] - } - } else { - defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ] - } - - cflags_cc = [ - "-Wno-sign-compare", - "-Wno-deprecated-declarations", - ] - cflags = [ - "-Wno-deprecated-declarations", - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - ] - if (is_mingw) { - # ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc:60:9: error: 'lseek' macro redefined [-Werror,-Wmacro-redefined] - cflags += [ "-Wno-macro-redefined" ] - } - public_configs = [ ":protobuf_config" ] - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" -} - -ohos_shared_library("protobuf") { - sources = [ - "$protobuf_src_root/google/protobuf/any.cc", - "$protobuf_src_root/google/protobuf/any.pb.cc", - "$protobuf_src_root/google/protobuf/api.pb.cc", - "$protobuf_src_root/google/protobuf/compiler/importer.cc", - "$protobuf_src_root/google/protobuf/compiler/parser.cc", - "$protobuf_src_root/google/protobuf/descriptor.cc", - "$protobuf_src_root/google/protobuf/descriptor.pb.cc", - "$protobuf_src_root/google/protobuf/descriptor_database.cc", - "$protobuf_src_root/google/protobuf/duration.pb.cc", - "$protobuf_src_root/google/protobuf/dynamic_message.cc", - "$protobuf_src_root/google/protobuf/empty.pb.cc", - "$protobuf_src_root/google/protobuf/extension_set_heavy.cc", - "$protobuf_src_root/google/protobuf/field_mask.pb.cc", - "$protobuf_src_root/google/protobuf/generated_message_reflection.cc", - "$protobuf_src_root/google/protobuf/generated_message_table_driven.cc", - "$protobuf_src_root/google/protobuf/io/gzip_stream.cc", - "$protobuf_src_root/google/protobuf/io/printer.cc", - "$protobuf_src_root/google/protobuf/io/tokenizer.cc", - "$protobuf_src_root/google/protobuf/map_field.cc", - "$protobuf_src_root/google/protobuf/message.cc", - "$protobuf_src_root/google/protobuf/reflection_ops.cc", - "$protobuf_src_root/google/protobuf/service.cc", - "$protobuf_src_root/google/protobuf/source_context.pb.cc", - "$protobuf_src_root/google/protobuf/struct.pb.cc", - "$protobuf_src_root/google/protobuf/stubs/substitute.cc", - "$protobuf_src_root/google/protobuf/text_format.cc", - "$protobuf_src_root/google/protobuf/timestamp.pb.cc", - "$protobuf_src_root/google/protobuf/type.pb.cc", - "$protobuf_src_root/google/protobuf/unknown_field_set.cc", - "$protobuf_src_root/google/protobuf/util/delimited_message_util.cc", - "$protobuf_src_root/google/protobuf/util/field_comparator.cc", - "$protobuf_src_root/google/protobuf/util/field_mask_util.cc", - "$protobuf_src_root/google/protobuf/util/internal/datapiece.cc", - "$protobuf_src_root/google/protobuf/util/internal/default_value_objectwriter.cc", - "$protobuf_src_root/google/protobuf/util/internal/error_listener.cc", - "$protobuf_src_root/google/protobuf/util/internal/field_mask_utility.cc", - "$protobuf_src_root/google/protobuf/util/internal/json_escaping.cc", - "$protobuf_src_root/google/protobuf/util/internal/json_objectwriter.cc", - "$protobuf_src_root/google/protobuf/util/internal/json_stream_parser.cc", - "$protobuf_src_root/google/protobuf/util/internal/object_writer.cc", - "$protobuf_src_root/google/protobuf/util/internal/proto_writer.cc", - "$protobuf_src_root/google/protobuf/util/internal/protostream_objectsource.cc", - "$protobuf_src_root/google/protobuf/util/internal/protostream_objectwriter.cc", - "$protobuf_src_root/google/protobuf/util/internal/type_info.cc", - "$protobuf_src_root/google/protobuf/util/internal/type_info_test_helper.cc", - "$protobuf_src_root/google/protobuf/util/internal/utility.cc", - "$protobuf_src_root/google/protobuf/util/json_util.cc", - "$protobuf_src_root/google/protobuf/util/message_differencer.cc", - "$protobuf_src_root/google/protobuf/util/time_util.cc", - "$protobuf_src_root/google/protobuf/util/type_resolver_util.cc", - "$protobuf_src_root/google/protobuf/wire_format.cc", - "$protobuf_src_root/google/protobuf/wrappers.pb.cc", - ] - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - cflags_cc = [ - "-Wno-sign-compare", - "-Wno-deprecated-declarations", - ] - cflags = [ - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - "-Wno-deprecated-declarations", - ] - - deps = [ ":protobuf_lite" ] - if (!is_asan && !is_debug) { - version_script = "libprotobuf.map" - } - - public_configs = [ ":protobuf_config" ] - install_enable = true - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" -} - -ohos_static_library("protobuf_static") { - sources = [ - "$protobuf_src_root/google/protobuf/any.cc", - "$protobuf_src_root/google/protobuf/any.pb.cc", - "$protobuf_src_root/google/protobuf/api.pb.cc", - "$protobuf_src_root/google/protobuf/compiler/importer.cc", - "$protobuf_src_root/google/protobuf/compiler/parser.cc", - "$protobuf_src_root/google/protobuf/descriptor.cc", - "$protobuf_src_root/google/protobuf/descriptor.pb.cc", - "$protobuf_src_root/google/protobuf/descriptor_database.cc", - "$protobuf_src_root/google/protobuf/duration.pb.cc", - "$protobuf_src_root/google/protobuf/dynamic_message.cc", - "$protobuf_src_root/google/protobuf/empty.pb.cc", - "$protobuf_src_root/google/protobuf/extension_set_heavy.cc", - "$protobuf_src_root/google/protobuf/field_mask.pb.cc", - "$protobuf_src_root/google/protobuf/generated_message_reflection.cc", - "$protobuf_src_root/google/protobuf/generated_message_table_driven.cc", - "$protobuf_src_root/google/protobuf/io/gzip_stream.cc", - "$protobuf_src_root/google/protobuf/io/printer.cc", - "$protobuf_src_root/google/protobuf/io/tokenizer.cc", - "$protobuf_src_root/google/protobuf/map_field.cc", - "$protobuf_src_root/google/protobuf/message.cc", - "$protobuf_src_root/google/protobuf/reflection_ops.cc", - "$protobuf_src_root/google/protobuf/service.cc", - "$protobuf_src_root/google/protobuf/source_context.pb.cc", - "$protobuf_src_root/google/protobuf/struct.pb.cc", - "$protobuf_src_root/google/protobuf/stubs/substitute.cc", - "$protobuf_src_root/google/protobuf/text_format.cc", - "$protobuf_src_root/google/protobuf/timestamp.pb.cc", - "$protobuf_src_root/google/protobuf/type.pb.cc", - "$protobuf_src_root/google/protobuf/unknown_field_set.cc", - "$protobuf_src_root/google/protobuf/util/delimited_message_util.cc", - "$protobuf_src_root/google/protobuf/util/field_comparator.cc", - "$protobuf_src_root/google/protobuf/util/field_mask_util.cc", - "$protobuf_src_root/google/protobuf/util/internal/datapiece.cc", - "$protobuf_src_root/google/protobuf/util/internal/default_value_objectwriter.cc", - "$protobuf_src_root/google/protobuf/util/internal/error_listener.cc", - "$protobuf_src_root/google/protobuf/util/internal/field_mask_utility.cc", - "$protobuf_src_root/google/protobuf/util/internal/json_escaping.cc", - "$protobuf_src_root/google/protobuf/util/internal/json_objectwriter.cc", - "$protobuf_src_root/google/protobuf/util/internal/json_stream_parser.cc", - "$protobuf_src_root/google/protobuf/util/internal/object_writer.cc", - "$protobuf_src_root/google/protobuf/util/internal/proto_writer.cc", - "$protobuf_src_root/google/protobuf/util/internal/protostream_objectsource.cc", - "$protobuf_src_root/google/protobuf/util/internal/protostream_objectwriter.cc", - "$protobuf_src_root/google/protobuf/util/internal/type_info.cc", - "$protobuf_src_root/google/protobuf/util/internal/type_info_test_helper.cc", - "$protobuf_src_root/google/protobuf/util/internal/utility.cc", - "$protobuf_src_root/google/protobuf/util/json_util.cc", - "$protobuf_src_root/google/protobuf/util/message_differencer.cc", - "$protobuf_src_root/google/protobuf/util/time_util.cc", - "$protobuf_src_root/google/protobuf/util/type_resolver_util.cc", - "$protobuf_src_root/google/protobuf/wire_format.cc", - "$protobuf_src_root/google/protobuf/wrappers.pb.cc", - ] - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - cflags_cc = [ - "-Wno-sign-compare", - "-Wno-deprecated-declarations", - ] - cflags = [ - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - "-Wno-deprecated-declarations", - ] - - deps = [ ":protobuf_lite_static" ] - - public_configs = [ ":protobuf_config" ] - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" -} - -if (current_toolchain == host_toolchain) { - ohos_shared_library("protoc_lib") { - sources = [ - "$protobuf_src_root/google/protobuf/compiler/code_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/command_line_interface.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_extension.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_file.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_service.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_string_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_doc_comment.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_field_base.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_reflection_class.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_context.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_doc_comment.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_extension.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_extension_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_file.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_generator_factory.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_map_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_name_resolver.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_service.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_shared_code_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_string_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_string_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/js/js_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/js/well_known_types_embed.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_extension.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_file.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_oneof.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/php/php_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/plugin.cc", - "$protobuf_src_root/google/protobuf/compiler/plugin.pb.cc", - "$protobuf_src_root/google/protobuf/compiler/python/python_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/ruby/ruby_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/subprocess.cc", - "$protobuf_src_root/google/protobuf/compiler/zip_writer.cc", - ] - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - cflags_cc = [ - "-Wno-sign-compare", - "-Wno-unused-function", - "-Wno-unused-private-field", - "-Wno-deprecated-declarations", - ] - cflags = [ - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - "-Wno-unused-function", - "-Wno-deprecated-declarations", - ] - - deps = [ - ":protobuf", - ":protobuf_lite", - ] - - public_configs = [ ":protobuf_config" ] - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" - } - - ohos_static_library("protoc_static_lib") { - sources = [ - "$protobuf_src_root/google/protobuf/compiler/code_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/command_line_interface.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_extension.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_file.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_service.cc", - "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_string_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_doc_comment.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_field_base.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_reflection_class.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", - "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_context.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_doc_comment.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_enum_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_extension.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_extension_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_file.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_generator_factory.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_map_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_message_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_name_resolver.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_service.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_shared_code_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_string_field.cc", - "$protobuf_src_root/google/protobuf/compiler/java/java_string_field_lite.cc", - "$protobuf_src_root/google/protobuf/compiler/js/js_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/js/well_known_types_embed.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_extension.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_file.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_helpers.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_map_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message_field.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_oneof.cc", - "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", - "$protobuf_src_root/google/protobuf/compiler/php/php_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/plugin.cc", - "$protobuf_src_root/google/protobuf/compiler/plugin.pb.cc", - "$protobuf_src_root/google/protobuf/compiler/python/python_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/ruby/ruby_generator.cc", - "$protobuf_src_root/google/protobuf/compiler/subprocess.cc", - "$protobuf_src_root/google/protobuf/compiler/zip_writer.cc", - ] - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - cflags_cc = [ - "-Wno-sign-compare", - "-Wno-unused-function", - "-Wno-unused-private-field", - "-Wno-deprecated-declarations", - ] - cflags = [ - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - "-Wno-unused-function", - "-Wno-deprecated-declarations", - ] - - deps = [ - ":protobuf_lite_static", - ":protobuf_static", - ] - - public_configs = [ ":protobuf_config" ] - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" - } -} - -# Only compile the plugin for the host architecture. -if (current_toolchain == host_toolchain) { - ohos_executable("protoc") { - sources = [ "$protobuf_src_root/google/protobuf/compiler/main.cc" ] - include_dirs = [ - "$protobuf_src_root/google/protobuf/**/*.h", - "$protobuf_src_root/google/protobuf/**/*.inc", - "$protobuf_src_root", - ] - deps = [ ":protoc_static_lib" ] - cflags_cc = [ - "-Wno-sign-compare", - "-Wno-deprecated-declarations", - ] - cflags = [ - "-Wno-sign-compare", - "-D HAVE_PTHREAD", - "-Wno-deprecated-declarations", - ] - subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" - part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" - } -} diff --git a/build/third_party_gn/protobuf/dummy_bundle.json b/build/third_party_gn/protobuf/dummy_bundle.json deleted file mode 100644 index 153353bc094c2920894707148377171c99b32501..0000000000000000000000000000000000000000 --- a/build/third_party_gn/protobuf/dummy_bundle.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "header": { - "header_base": "//third_party/protobuf/src/google/protobuf", - "header_files": [] - }, - "name": "//arkcompiler/toolchain/build/third_party_gn/protobuf:protobuf_lite_static" - }, - { - "header": { - "header_base": "//third_party/protobuf/src/google/protobuf", - "header_files": [] - }, - "name": "//arkcompiler/toolchain/build/third_party_gn/protobuf:protobuf_static" - } - ] - } - } -} \ No newline at end of file diff --git a/build/third_party_gn/zlib/BUILD.gn b/build/third_party_gn/zlib/BUILD.gn deleted file mode 100644 index 8d599d6b8ae90e6cc161014db1f03ccb6ba4a2d0..0000000000000000000000000000000000000000 --- a/build/third_party_gn/zlib/BUILD.gn +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/ark.gni") - -config("zlib_config") { - cflags = [ - "-Wno-incompatible-pointer-types", - "-Werror", - "-Wno-strict-prototypes", - "-Wimplicit-function-declaration", - "-Wno-unused-but-set-variable", - ] -} - -config("zlib_public_config") { - include_dirs = [ "//third_party/zlib" ] -} - -ohos_static_library("libz") { - stack_protector_ret = false - sources = [ - "//third_party/zlib/adler32.c", - "//third_party/zlib/compress.c", - "//third_party/zlib/contrib/minizip/ioapi.c", - "//third_party/zlib/contrib/minizip/unzip.c", - "//third_party/zlib/contrib/minizip/zip.c", - "//third_party/zlib/crc32.c", - "//third_party/zlib/crc32.h", - "//third_party/zlib/deflate.c", - "//third_party/zlib/deflate.h", - "//third_party/zlib/gzclose.c", - "//third_party/zlib/gzguts.h", - "//third_party/zlib/gzlib.c", - "//third_party/zlib/gzread.c", - "//third_party/zlib/gzwrite.c", - "//third_party/zlib/infback.c", - "//third_party/zlib/inffast.c", - "//third_party/zlib/inffast.h", - "//third_party/zlib/inffixed.h", - "//third_party/zlib/inflate.c", - "//third_party/zlib/inflate.h", - "//third_party/zlib/inftrees.c", - "//third_party/zlib/inftrees.h", - "//third_party/zlib/trees.c", - "//third_party/zlib/trees.h", - "//third_party/zlib/uncompr.c", - "//third_party/zlib/zconf.h", - "//third_party/zlib/zlib.h", - "//third_party/zlib/zutil.c", - "//third_party/zlib/zutil.h", - ] - configs = [ ":zlib_config" ] - public_configs = [ ":zlib_public_config" ] - - part_name = "zlib" - subsystem_name = "thirdparty" -} - -ohos_shared_library("shared_libz") { - stack_protector_ret = false - sources = [ - "//third_party/zlib/adler32.c", - "//third_party/zlib/compress.c", - "//third_party/zlib/contrib/minizip/ioapi.c", - "//third_party/zlib/contrib/minizip/unzip.c", - "//third_party/zlib/contrib/minizip/zip.c", - "//third_party/zlib/crc32.c", - "//third_party/zlib/crc32.h", - "//third_party/zlib/deflate.c", - "//third_party/zlib/deflate.h", - "//third_party/zlib/gzclose.c", - "//third_party/zlib/gzguts.h", - "//third_party/zlib/gzlib.c", - "//third_party/zlib/gzread.c", - "//third_party/zlib/gzwrite.c", - "//third_party/zlib/infback.c", - "//third_party/zlib/inffast.c", - "//third_party/zlib/inffast.h", - "//third_party/zlib/inffixed.h", - "//third_party/zlib/inflate.c", - "//third_party/zlib/inflate.h", - "//third_party/zlib/inftrees.c", - "//third_party/zlib/inftrees.h", - "//third_party/zlib/trees.c", - "//third_party/zlib/trees.h", - "//third_party/zlib/uncompr.c", - "//third_party/zlib/zconf.h", - "//third_party/zlib/zlib.h", - "//third_party/zlib/zutil.c", - "//third_party/zlib/zutil.h", - ] - configs = [ ":zlib_config" ] - public_configs = [ ":zlib_public_config" ] - - install_images = [ - "system", - "updater", - ] - - innerapi_tags = [ "platformsdk" ] - part_name = "zlib" - subsystem_name = "thirdparty" -} diff --git a/build/third_party_gn/zlib/dummy_bundle.json b/build/third_party_gn/zlib/dummy_bundle.json deleted file mode 100644 index 22e272ffa5ce7505bb7ef7955b05ac778fa40322..0000000000000000000000000000000000000000 --- a/build/third_party_gn/zlib/dummy_bundle.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "component": { - "build": { - "inner_kits": [ - { - "header": { - "header_base": "//third_party/zlib", - "header_files": "" - }, - "name": "//arkcompiler/toolchain/build/third_party_gn/zlib:libz" - }, - { - "header": { - "header_base": "//third_party/zlib", - "header_files": "" - }, - "name": "//arkcompiler/toolchain/build/third_party_gn/zlib:shared_libz" - } - ] - } - } -} \ No newline at end of file diff --git a/build/toolchain/BUILD.gn b/build/toolchain/BUILD.gn deleted file mode 100644 index 983fb6aa41cceeb9f188eb4df125d008913e2ff3..0000000000000000000000000000000000000000 --- a/build/toolchain/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/toolchain/concurrent_links.gni") - -declare_args() { - # Pool for non goma tasks. - action_pool_depth = -1 -} - -if (action_pool_depth == -1) { - action_pool_depth = exec_script("get_cpu_count.py", [], "value") -} - -if (current_toolchain == default_toolchain) { - pool("link_pool") { - depth = concurrent_links - } - - pool("action_pool") { - depth = action_pool_depth - } -} diff --git a/build/toolchain/aosp/BUILD.gn b/build/toolchain/aosp/BUILD.gn deleted file mode 100644 index 174eea396255f527223c45b918bc8c0bd8958cf6..0000000000000000000000000000000000000000 --- a/build/toolchain/aosp/BUILD.gn +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/sysroot.gni") -import("$build_root/toolchain/gcc_toolchain.gni") - -declare_args() { - aosp_unstripped_runtime_outputs = true -} - -template("aosp_clang_toolchain") { - gcc_toolchain(target_name) { - aosp_ndk_lib = - rebase_path(invoker.sysroot + "/" + invoker.lib_dir, root_build_dir) - libs_section_prefix = "$aosp_ndk_lib/crtbegin_dynamic.o" - libs_section_postfix = "$aosp_ndk_lib/crtend_android.o" - solink_libs_section_prefix = "$aosp_ndk_lib/crtbegin_so.o" - solink_libs_section_postfix = "$aosp_ndk_lib/crtend_so.o" - - _prefix = rebase_path("$clang_base_path/bin", root_build_dir) - cc = "$_prefix/clang" - cxx = "$_prefix/clang++" - ld = cxx - ar = "$_prefix/llvm-ar" - if (!is_debug) { - strip = "${_prefix}/llvm-strip" - use_unstripped_as_runtime_outputs = aosp_unstripped_runtime_outputs - } - - # Don't use .cr.so for loadable_modules since they are always loaded via - # absolute path. - loadable_module_extension = ".so" - - toolchain_args = { - if (defined(invoker.toolchain_args)) { - forward_variables_from(invoker.toolchain_args, "*") - } - is_clang = true - } - } -} - -aosp_clang_toolchain("aosp_clang_arm64") { - sysroot = "$aosp_ndk_root/$arm64_aosp_sysroot_subdir" - lib_dir = "usr/lib" - - toolchain_args = { - current_cpu = "arm64" - current_os = "android" - } -} diff --git a/build/toolchain/ark/BUILD.gn b/build/toolchain/ark/BUILD.gn deleted file mode 100644 index 5bea83dda0136848621e1d039d495392435573bf..0000000000000000000000000000000000000000 --- a/build/toolchain/ark/BUILD.gn +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/toolchain/ark/ark_toolchain.gni") - -ark_clang_toolchain("ark_clang_arm") { - sysroot = "${musl_sysroot}" - lib_dir = "usr/lib/arm-linux-ohos" - toolchain_args = { - current_cpu = "arm" - current_os = "ohos" - } -} - -ark_clang_toolchain("ark_clang_x64") { - sysroot = "${musl_sysroot}" - lib_dir = "usr/lib/x86_64-linux-ohos" - toolchain_args = { - current_cpu = "x64" - current_os = "linux" - } -} - -ark_clang_toolchain("ark_clang_arm64") { - sysroot = "${musl_sysroot}" - lib_dir = "usr/lib/aarch64-linux-ohos" - toolchain_args = { - current_cpu = "arm64" - current_os = "ohos" - } -} - -ark_clang_toolchain("ark_clang_mipsel") { - sysroot = "${musl_sysroot}" - lib_dir = "usr/lib/mipsel-linux-ohos" - toolchain_args = { - current_cpu = "mipsel" - current_os = "ohos" - } -} diff --git a/build/toolchain/ark/ark_toolchain.gni b/build/toolchain/ark/ark_toolchain.gni deleted file mode 100644 index 2b169d85cc0d2fb79875dab84b0b3160c4c78eef..0000000000000000000000000000000000000000 --- a/build/toolchain/ark/ark_toolchain.gni +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/ohos/config.gni") -import("$build_root/toolchain/gcc_toolchain.gni") - -declare_args() { - unstripped_runtime_outputs = true -} - -template("ark_clang_toolchain") { - gcc_toolchain(target_name) { - ohos_libc_dir = - rebase_path(invoker.sysroot + "/" + invoker.lib_dir, root_build_dir) - libs_section_prefix = "${ohos_libc_dir}/Scrt1.o" - libs_section_prefix += " ${ohos_libc_dir}/crti.o" - libs_section_postfix = "${ohos_libc_dir}/crtn.o" - - if (invoker.target_name == "ark_clang_arm") { - abi_target = "arm-linux-ohos" - } else if (invoker.target_name == "ark_clang_arm64") { - abi_target = "aarch64-linux-ohos" - } else if (invoker.target_name == "ark_clang_x86_64") { - abi_target = "x86_64-linux-ohos" - } - - clang_rt_dir = - rebase_path("${clang_lib_base_path}/${abi_target}", root_build_dir) - solink_libs_section_prefix = "${ohos_libc_dir}/crti.o" - solink_libs_section_prefix += " ${clang_rt_dir}/clang_rt.crtbegin.o" - solink_libs_section_postfix = "${ohos_libc_dir}/crtn.o" - solink_libs_section_postfix += " ${clang_rt_dir}/clang_rt.crtend.o" - - prefix = rebase_path("${clang_base_path}/bin", root_build_dir) - cc = "${prefix}/clang" - cxx = "${prefix}/clang++" - ar = "${prefix}/llvm-ar" - ld = cxx - if (!is_debug) { - strip = "${prefix}/llvm-strip" - use_unstripped_as_runtime_outputs = unstripped_runtime_outputs - } - - toolchain_args = { - if (defined(invoker.toolchain_args)) { - forward_variables_from(invoker.toolchain_args, "*") - } - is_clang = true - } - - if (defined(invoker.shlib_extension) && invoker.shlib_extension != "") { - shlib_extension = invoker.shlib_extension - } - } -} diff --git a/build/toolchain/cc_wrapper.gni b/build/toolchain/cc_wrapper.gni deleted file mode 100644 index 0c682700778df6302a05f6bdf1a7edc0a3ca5d69..0000000000000000000000000000000000000000 --- a/build/toolchain/cc_wrapper.gni +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Defines the configuration of cc wrapper -# ccache: a c/c++ compiler cache which can greatly reduce recompilation times. -# icecc, distcc: it takes compile jobs from a build and distributes them among -# remote machines allowing a parallel build. -# -# TIPS -# -# 1) ccache -# Set clang_use_chrome_plugins=false if using ccache 3.1.9 or earlier, since -# these versions don't support -Xclang. (3.1.10 and later will silently -# ignore -Xclang, so it doesn't matter if you disable clang_use_chrome_plugins -# or not). -# -# Use ccache 3.2 or later to avoid clang unused argument warnings: -# https://bugzilla.samba.org/show_bug.cgi?id=8118 -# -# To avoid -Wparentheses-equality clang warnings, at some cost in terms of -# speed, you can do: -# export CCACHE_CPP2=yes -# -# 2) icecc -# Set clang_use_chrome_plugins=false because icecc cannot distribute custom -# clang libraries. -# -# To use icecc and ccache together, set cc_wrapper = "ccache" with -# export CCACHE_PREFIX=icecc - -_cc_wrapper = "" -_ccache_exec = getenv("CCACHE_EXEC") -_use_ccache = getenv("USE_CCACHE") -if (_use_ccache == "1" && _ccache_exec != "") { - _cc_wrapper = rebase_path(_ccache_exec) -} - -declare_args() { - # Set to "ccache", "icecc" or "distcc". Probably doesn't work on windows. - cc_wrapper = _cc_wrapper -} diff --git a/build/toolchain/clang_static_analyzer.gni b/build/toolchain/clang_static_analyzer.gni deleted file mode 100644 index 03191b2f69824704a480cb4814a9148d5ce4aa8d..0000000000000000000000000000000000000000 --- a/build/toolchain/clang_static_analyzer.gni +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Defines the configuration of Clang static analysis tools. -# See docs/clang_static_analyzer.md for more information. - -declare_args() { - # Uses the Clang static analysis tools during compilation. - use_clang_static_analyzer = false -} diff --git a/build/toolchain/clang_static_analyzer_wrapper.py b/build/toolchain/clang_static_analyzer_wrapper.py deleted file mode 100755 index 97929127dd48a76328af3f707f209611715767e5..0000000000000000000000000000000000000000 --- a/build/toolchain/clang_static_analyzer_wrapper.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Adds an analysis build step to invocations of the Clang C/C++ compiler. - -Usage: clang_static_analyzer_wrapper.py [args...] -""" - -import argparse -import sys -import wrapper_utils - -# Flags used to enable analysis for Clang invocations. -analyzer_enable_flags = [ - '--analyze', -] - -# Flags used to configure the analyzer's behavior. -analyzer_option_flags = [ - '-fdiagnostics-show-option', - '-analyzer-checker=cplusplus', - '-analyzer-opt-analyze-nested-blocks', - '-analyzer-eagerly-assume', - '-analyzer-output=text', - '-analyzer-config', - 'suppress-c++-stdlib=true', - - # List of checkers to execute. - # The full list of checkers can be found at - # https://clang-analyzer.llvm.org/available_checks.html. - '-analyzer-checker=core', - '-analyzer-checker=unix', - '-analyzer-checker=deadcode', -] - - -# Prepends every element of a list |args| with |token|. -# e.g. ['-analyzer-foo', '-analyzer-bar'] => ['-Xanalyzer', '-analyzer-foo', -# '-Xanalyzer', '-analyzer-bar'] -def interleave_args(args, token): - return list(sum(zip([token] * len(args), args), ())) - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--mode', - choices=['clang', 'cl'], - required=True, - help='Specifies the compiler argument convention ' - 'to use.') - parser.add_argument('args', nargs=argparse.REMAINDER) - parsed_args = parser.parse_args() - - prefix = '-Xclang' if parsed_args.mode == 'cl' else '-Xanalyzer' - cmd = parsed_args.args + analyzer_enable_flags + interleave_args( - analyzer_option_flags, prefix) - returncode, stderr = wrapper_utils.capture_command_stderr( - wrapper_utils.command_to_run(cmd)) - sys.stderr.write(stderr) - - return_code, stderr = wrapper_utils.capture_command_stderr( - wrapper_utils.command_to_run(parsed_args.args)) - sys.stderr.write(stderr) - - return return_code - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/toolchain/concurrent_links.gni b/build/toolchain/concurrent_links.gni deleted file mode 100644 index 86b82fa3c77150a154ca79cd55d92363f2262a55..0000000000000000000000000000000000000000 --- a/build/toolchain/concurrent_links.gni +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This file should only be imported from files that define toolchains. -# There's no way to enforce this exactly, but all toolchains are processed -# in the context of the default_toolchain, so we can at least check for that. -assert(current_toolchain == default_toolchain) - -import("$build_root/config/compiler/compiler.gni") -import("$build_root/config/sanitizers/sanitizers.gni") -import("$build_root/toolchain/toolchain.gni") - -declare_args() { - # Limit the number of concurrent links; we often want to run fewer - # links at once than we do compiles, because linking is memory-intensive. - # The default to use varies by platform and by the amount of memory - # available, so we call out to a script to get the right value. - concurrent_links = -1 -} - -if (concurrent_links == -1) { - if (use_sanitizer_coverage || use_fuzzing_engine) { - # Sanitizer coverage instrumentation increases linker memory consumption - # significantly. - _args = [ "--mem_per_link_gb=16" ] - } else if (is_win && symbol_level == 1 && !is_debug) { - _args = [ "--mem_per_link_gb=3" ] - } else if (is_win) { - _args = [ "--mem_per_link_gb=5" ] - } else if (is_mac) { - _args = [ "--mem_per_link_gb=4" ] - } else if (is_ohos && !is_component_build && symbol_level == 2) { - # Full debug symbols require large memory for link. - _args = [ "--mem_per_link_gb=25" ] - } else if (is_ohos && !is_debug && !using_sanitizer && symbol_level < 2) { - # Increase the number of concurrent links for release bots. Debug builds - # make heavier use of ProGuard, and so should not be raised. Sanitizers also - # increase the memory overhead. - if (symbol_level == 1) { - _args = [ "--mem_per_link_gb=6" ] - } else { - _args = [ "--mem_per_link_gb=4" ] - } - } else if (is_linux) { - # Memory consumption on link without debug symbols is low on linux. - _args = [ "--mem_per_link_gb=3" ] - } else { - _args = [] - } - - concurrent_links = exec_script("get_concurrent_links.py", _args, "value") -} diff --git a/build/toolchain/gcc_link_wrapper.py b/build/toolchain/gcc_link_wrapper.py deleted file mode 100755 index 659efd685ab0d0adcff583f4371c25cf625d2065..0000000000000000000000000000000000000000 --- a/build/toolchain/gcc_link_wrapper.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Runs a linking command and optionally a strip command. - -This script exists to avoid using complex shell commands in -gcc_toolchain.gni's tool("link"), in case the host running the compiler -does not have a POSIX-like shell (e.g. Windows). -""" - -import argparse -import os -import subprocess -import sys - - -def is_static_link(command): - if "-static" in command: - return True - else: - return False - - -""" since static link and dynamic link have different CRT files on ohos, -and we use dynamic link CRT files as default, so when link statically, -we need change the CRT files -""" - - -def update_crt(command): - for item in command: - if str(item).find("crtbegin_dynamic.o") >= 0: - index = command.index(item) - new_crtbegin = str(item).replace("crtbegin_dynamic.o", - "crtbegin_static.o") - command[index] = new_crtbegin - return command - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument('--strip', - help='The strip binary to run', - metavar='PATH') - parser.add_argument('--unstripped-file', - help='Executable file produced by linking command', - metavar='FILE') - parser.add_argument('--output', - required=True, - help='Final output executable file', - metavar='FILE') - parser.add_argument('--clang_rt_dso_path', - help=('Clang asan runtime shared library')) - parser.add_argument('command', nargs='+', help='Linking command') - args = parser.parse_args() - - # Work-around for gold being slow-by-default. http://crbug.com/632230 - fast_env = dict(os.environ) - fast_env['LC_ALL'] = 'C' - if is_static_link(args.command): - command = update_crt(args.command) - if args.clang_rt_dso_path is not None: - return 0 - else: - command = args.command - result = subprocess.call(command, env=fast_env) - if result != 0: - return result - - # Finally, strip the linked executable (if desired). - if args.strip: - result = subprocess.call([args.strip, '-o', args.output, args.unstripped_file]) - - return result - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/build/toolchain/gcc_solink_wrapper.py b/build/toolchain/gcc_solink_wrapper.py deleted file mode 100755 index 7c41c84feb20b83c087023b83017b4374019932c..0000000000000000000000000000000000000000 --- a/build/toolchain/gcc_solink_wrapper.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Runs 'ld -shared' and generates a .TOC file that's untouched when unchanged. - -This script exists to avoid using complex shell commands in -gcc_toolchain.gni's tool("solink"), in case the host running the compiler -does not have a POSIX-like shell (e.g. Windows). -""" - -import argparse -import os -import subprocess -import sys -import shutil - - -def reformat_rsp_file(rspfile): - """ Move all implibs from --whole-archive section""" - with open(rspfile, "r") as fi: - rspcontent = fi.read() - result = [] - implibs = [] - naflag = False - for arg in rspcontent.split(" "): - if naflag and arg.endswith(".lib"): - implibs.append(arg) - continue - result.append(arg) - if arg == "-Wl,--whole-archive": - naflag = True - continue - if arg == "-Wl,--no-whole-archive": - naflag = False - result.extend(implibs) - - with open(rspfile, "w") as fo: - fo.write(" ".join(result)) - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument('--strip', - help='The strip binary to run', - metavar='PATH') - parser.add_argument('--sofile', - required=True, - help='Shared object file produced by linking command', - metavar='FILE') - parser.add_argument('--output', - required=True, - help='Final output shared object file', - metavar='FILE') - parser.add_argument('--libfile', required=False, metavar='FILE') - parser.add_argument('command', nargs='+', help='Linking command') - args = parser.parse_args() - - if args.sofile.endswith(".dll"): - rspfile = None - for a in args.command: - if a[0] == "@": - rspfile = a[1:] - break - if rspfile: - reformat_rsp_file(rspfile) - # Work-around for gold being slow-by-default. http://crbug.com/632230 - fast_env = dict(os.environ) - fast_env['LC_ALL'] = 'C' - - # First, run the actual link. - result = subprocess.call(args.command, env=fast_env) - if result != 0: - return result - - # Finally, strip the linked shared object file (if desired). - if args.strip: - result = subprocess.call([args.strip, '-o', args.output, args.sofile]) - if args.libfile: - libfile_name = os.path.basename(args.libfile) - sofile_output_dir = os.path.dirname(args.sofile) - unstripped_libfile = os.path.join(sofile_output_dir, libfile_name) - shutil.copy2(unstripped_libfile, args.libfile) - - return result - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni deleted file mode 100644 index aa95d1fa030231e287e6f2d96648d0ef3dda9100..0000000000000000000000000000000000000000 --- a/build/toolchain/gcc_toolchain.gni +++ /dev/null @@ -1,465 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/clang/clang.gni") -import("$build_root/config/sanitizers/sanitizers.gni") -import("$build_root/toolchain/cc_wrapper.gni") -import("$build_root/toolchain/toolchain.gni") - -declare_args() { - linux_unstripped_runtime_outputs = true -} - -template("gcc_toolchain") { - toolchain(target_name) { - assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") - assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") - assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") - assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") - - # This define changes when the toolchain changes, forcing a rebuild. - # Nothing should ever use this define. - if (defined(invoker.rebuild_define)) { - rebuild_string = "-D" + invoker.rebuild_define - } else { - rebuild_string = "" - } - - # GN's syntax can't handle more than one scope dereference at once, like - # "invoker.toolchain_args.foo", so make a temporary to hold the toolchain - # args so we can do "invoker_toolchain_args.foo". - assert(defined(invoker.toolchain_args), - "Toolchains must specify toolchain_args") - invoker_toolchain_args = invoker.toolchain_args - assert(defined(invoker_toolchain_args.current_cpu), - "toolchain_args must specify a current_cpu") - assert(defined(invoker_toolchain_args.current_os), - "toolchain_args must specify a current_os") - - # When invoking this toolchain not as the default one, these args will be - # passed to the build. They are ignored when this is the default toolchain. - toolchain_args = { - # Populate toolchain args from the invoker. - forward_variables_from(invoker_toolchain_args, "*") - # The host toolchain value computed by the default toolchain's setup - # needs to be passed through unchanged to all secondary toolchains to - # ensure that it's always the same, regardless of the values that may be - # set on those toolchains. - } - - if (defined(toolchain_args.cc_wrapper)) { - toolchain_cc_wrapper = toolchain_args.cc_wrapper - } else { - toolchain_cc_wrapper = cc_wrapper - } - - compiler_prefix = "${toolchain_cc_wrapper} " - - cc = compiler_prefix + invoker.cc - cxx = compiler_prefix + invoker.cxx - ar = invoker.ar - ld = invoker.ld - if (!defined(asm)) { - asm = cc - } - - if (defined(invoker.shlib_extension)) { - default_shlib_extension = invoker.shlib_extension - } else { - default_shlib_extension = shlib_extension - } - - if (defined(invoker.executable_extension)) { - default_executable_extension = invoker.executable_extension - } else { - default_executable_extension = "" - } - - # Bring these into our scope for string interpolation with default values. - if (defined(invoker.libs_section_prefix)) { - libs_section_prefix = invoker.libs_section_prefix - } else { - libs_section_prefix = "" - } - - if (defined(invoker.libs_section_postfix)) { - libs_section_postfix = invoker.libs_section_postfix - } else { - libs_section_postfix = "" - } - - if (defined(invoker.solink_libs_section_prefix)) { - solink_libs_section_prefix = invoker.solink_libs_section_prefix - } else { - solink_libs_section_prefix = "" - } - - if (defined(invoker.solink_libs_section_postfix)) { - solink_libs_section_postfix = invoker.solink_libs_section_postfix - } else { - solink_libs_section_postfix = "" - } - - if (defined(invoker.extra_cflags) && invoker.extra_cflags != "") { - extra_cflags = invoker.extra_cflags - } else { - extra_cflags = "" - } - - if (defined(invoker.extra_cppflags) && invoker.extra_cppflags != "") { - extra_cppflags = invoker.extra_cppflags - } else { - extra_cppflags = "" - } - - if (defined(invoker.extra_cxxflags) && invoker.extra_cxxflags != "") { - extra_cxxflags = invoker.extra_cxxflags - } else { - extra_cxxflags = "" - } - - if (defined(invoker.extra_asmflags) && invoker.extra_asmflags != "") { - extra_asmflags = invoker.extra_asmflags - } else { - extra_asmflags = "" - } - - if (defined(invoker.extra_ldflags) && invoker.extra_ldflags != "") { - extra_ldflags = invoker.extra_ldflags - } else { - extra_ldflags = "" - } - - # These library switches can apply to all tools below. - lib_switch = "-l" - lib_dir_switch = "-L" - - # Object files go in this directory. - object_subdir = "{{source_out_dir}}/{{label_name}}" - - tool("cc") { - depfile = "{{output}}.d" - command = "$cc" + " -MMD" + " -MF" + " $depfile" + " ${rebuild_string}" + - " {{defines}}" + " {{include_dirs}}" + " {{cflags}}" + - " {{cflags_c}}" + " ${extra_cppflags}" + " ${extra_cflags}" + - " -c {{source}}" + " -o {{output}}" - depsformat = "gcc" - description = "CC {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("cxx") { - depfile = "{{output}}.d" - command = "$cxx" + " -MMD" + " -MF" + " $depfile" + " ${rebuild_string}" + - " {{defines}}" + " {{include_dirs}}" + " {{cflags}}" + - " {{cflags_cc}}" + " ${extra_cppflags}" + " ${extra_cxxflags}" + - " -c {{source}}" + " -o {{output}}" - depsformat = "gcc" - description = "CXX {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("asm") { - # For GCC we can just use the C compiler to compile assembly. - depfile = "{{output}}.d" - command = "$asm" + " -MMD" + " -MF" + " $depfile" + " ${rebuild_string}" + - " {{defines}}" + " {{include_dirs}}" + " {{asmflags}}" + - " ${extra_asmflags}" + " -c {{source}}" + " -o {{output}}" - depsformat = "gcc" - description = "ASM {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("alink") { - if (current_os == "aix") { - # AIX does not support either -D (deterministic output) or response - # files. - command = "$ar" + " -X64" + " {{arflags}}" + " -r" + " -c" + " -s" + - " {{output}}" + " {{inputs}}" - } else { - rspfile = "{{output}}.rsp" - rspfile_content = "{{inputs}}" - command = "\"$ar\"" + " {{arflags}}" + " -r" + " -c" + " -s" + " -D" + - " {{output}}" + " @\"$rspfile\"" - } - - # Remove the output file first so that ar doesn't try to modify the - # existing file. - command = "rm -f {{output}}" + " && $command" - - # Almost all targets build with //build/config/compiler:thin_archive which - # adds -T to arflags. - description = "AR {{output}}" - outputs = [ "{{output_dir}}/{{target_output_name}}{{output_extension}}" ] - - # Shared libraries go in the target out directory by default so we can - # generate different targets with the same name and not have them collide. - default_output_dir = "{{target_out_dir}}" - default_output_extension = ".a" - output_prefix = "lib" - } - - tool("solink") { - soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". - sofile = "{{output_dir}}/$soname" # Possibly including toolchain dir. - rspfile = sofile + ".rsp" - - is_mingw_link = false - if (invoker_toolchain_args.current_os == "mingw") { - is_mingw_link = true - libname = "{{target_output_name}}.lib" - libfile = "{{output_dir}}/$libname" - } - - if (defined(invoker.strip)) { - unstripped_sofile = "{{root_out_dir}}/lib.unstripped/$sofile" - } else { - unstripped_sofile = sofile - } - - link_command = "$ld" + " -shared" + " {{ldflags}}" + " ${extra_ldflags}" + - " -o \"$unstripped_sofile\"" + " @\"$rspfile\"" - if (!is_mingw_link) { - link_command = "$link_command" + " -Wl,-soname=\"$soname\"" - } else { - link_command = - "$link_command" + - " -Wl,--out-implib,{{root_out_dir}}/lib.unstripped/$libfile" - } - - strip_switch = "" - if (defined(invoker.strip)) { - strip_switch = "--strip=${invoker.strip} " - } - - # This needs a Python script to avoid using a complex shell command - # requiring sh control structures, pipelines, and POSIX utilities. - # The host might not have a POSIX shell and utilities (e.g. Windows). - solink_wrapper = - rebase_path("$build_root/toolchain/gcc_solink_wrapper.py", - root_build_dir) - command = "$python_path" + " \"$solink_wrapper\"" + " $strip_switch" + - " --sofile=\"$unstripped_sofile\"" + " --output=\"$sofile\"" - if (is_mingw_link) { - command = "$command" + " --libfile=\"$libfile\"" - } - command = "$command" + " -- $link_command" - - rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" - - description = "SOLINK $sofile" - - # Use this for {{output_extension}} expansions unless a target manually - # overrides it (in which case {{output_extension}} will be what the target - # specifies). - default_output_extension = default_shlib_extension - - default_output_dir = "{{root_out_dir}}" - - output_prefix = "lib" - - # Since the above commands only updates the .TOC file when it changes, ask - # Ninja to check if the timestamp actually changed to know if downstream - # dependencies should be recompiled. - restat = true - - # Tell GN about the output files. It will link to the sofile - outputs = [ sofile ] - if (sofile != unstripped_sofile) { - outputs += [ unstripped_sofile ] - if (defined(invoker.use_unstripped_as_runtime_outputs) && - invoker.use_unstripped_as_runtime_outputs) { - runtime_outputs = [ unstripped_sofile ] - } - } - - if (is_mingw_link) { - outputs += [ libfile ] - link_output = libfile - depend_output = libfile - } else { - link_output = sofile - depend_output = sofile - } - } - - tool("solink_module") { - soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". - sofile = "{{output_dir}}/$soname" - rspfile = sofile + ".rsp" - - if (defined(invoker.strip)) { - unstripped_sofile = "{{root_out_dir}}/lib.unstripped/$sofile" - } else { - unstripped_sofile = sofile - } - - command = "$ld" + " -shared" + " {{ldflags}}" + " ${extra_ldflags}" + - " -o \"$unstripped_sofile\"" + " -Wl,-soname=\"$soname\"" + - " @\"$rspfile\"" - - if (defined(invoker.strip)) { - strip_command = - "${invoker.strip}" + " -o \"$sofile\"" + " \"$unstripped_sofile\"" - command += " && " + strip_command - } - rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" - - description = "SOLINK_MODULE $sofile" - - # Use this for {{output_extension}} expansions unless a target manually - # overrides it (in which case {{output_extension}} will be what the target - # specifies). - if (defined(invoker.loadable_module_extension)) { - default_output_extension = invoker.loadable_module_extension - } else { - default_output_extension = default_shlib_extension - } - - default_output_dir = "{{root_out_dir}}" - - output_prefix = "lib" - - outputs = [ sofile ] - if (sofile != unstripped_sofile) { - outputs += [ unstripped_sofile ] - if (defined(invoker.use_unstripped_as_runtime_outputs) && - invoker.use_unstripped_as_runtime_outputs) { - runtime_outputs = [ unstripped_sofile ] - } - } - } - - tool("link") { - exename = "{{target_output_name}}{{output_extension}}" - outfile = "{{output_dir}}/$exename" - rspfile = "${outfile}.rsp" - unstripped_outfile = outfile - - # Use this for {{output_extension}} expansions unless a target manually - # overrides it (in which case {{output_extension}} will be what the target - # specifies). - default_output_extension = default_executable_extension - - default_output_dir = "{{root_out_dir}}" - - if (defined(invoker.strip)) { - unstripped_outfile = "{{root_out_dir}}/exe.unstripped/$outfile" - } - - start_group_flag = "" - end_group_flag = "" - if (current_os != "aix") { - # the "--start-group .. --end-group" feature isn't available on the aix ld. - start_group_flag = "-Wl,--start-group" - end_group_flag = "-Wl,--end-group " - } - _clang_rt_dso_full_path = "" - if (is_asan && invoker_toolchain_args.current_os == "ohos") { - if (invoker_toolchain_args.current_cpu == "arm64") { - _clang_rt_dso_full_path = rebase_path( - "$clang_base_path/lib/clang/$clang_version/lib/aarch64-linux-ohos/libclang_rt.asan.so", - root_build_dir) - } else { - _clang_rt_dso_full_path = rebase_path( - "$clang_base_path/lib/clang/$clang_version/lib/arm-linux-ohos/libclang_rt.asan.so", - root_build_dir) - } - } - link_command = "$ld" + " {{ldflags}}" + " ${extra_ldflags}" + - " -o \"$unstripped_outfile\"" + " $libs_section_prefix" + - " $start_group_flag" + " $_clang_rt_dso_full_path" + - " @\"$rspfile\"" + " {{solibs}}" + " {{libs}}" + - " $end_group_flag" + " $libs_section_postfix" - - strip_switch = "" - - if (defined(invoker.strip)) { - strip_switch = "--strip=\"${invoker.strip}\" --unstripped-file=\"$unstripped_outfile\"" - } - if (is_asan && invoker_toolchain_args.current_os == "ohos") { - strip_switch = - "$strip_switch --clang_rt_dso_path=\"$_clang_rt_dso_full_path\"" - } - - link_wrapper = rebase_path("$build_root/toolchain/gcc_link_wrapper.py", - root_build_dir) - command = - "$python_path" + " \"$link_wrapper\"" + " --output=\"$outfile\"" + - " $strip_switch" + " -- $link_command" - description = "LINK $outfile" - rspfile_content = "{{inputs}}" - outputs = [ outfile ] - if (outfile != unstripped_outfile) { - outputs += [ unstripped_outfile ] - if (defined(invoker.use_unstripped_as_runtime_outputs) && - invoker.use_unstripped_as_runtime_outputs) { - runtime_outputs = [ unstripped_outfile ] - } - } - if (defined(invoker.link_outputs)) { - outputs += invoker.link_outputs - } - } - - # These two are really entirely generic, but have to be repeated in - # each toolchain because GN doesn't allow a template to be used here. - # See //build/toolchain/toolchain.gni for details. - tool("stamp") { - command = stamp_command - description = stamp_description - } - tool("copy") { - command = copy_command - description = copy_description - } - - forward_variables_from(invoker, [ "deps" ]) - } -} - -# This is a shorthand for gcc_toolchain instances based on the Chromium-built -# version of Clang. Only the toolchain_cpu and toolchain_os variables need to -# be specified by the invoker, and optionally toolprefix if it's a -# cross-compile case. Note that for a cross-compile case this toolchain -# requires a config to pass the appropriate -target option, or else it will -# actually just be doing a native compile. The invoker can optionally override -# use_gold too. -template("clang_toolchain") { - gcc_toolchain(target_name) { - prefix = rebase_path("$clang_base_path/bin", root_build_dir) - cc = "$prefix/clang" - cxx = "$prefix/clang++" - ld = cxx - ar = "${prefix}/llvm-ar" - if (!is_debug) { - strip = "${prefix}/llvm-strip" - use_unstripped_as_runtime_outputs = linux_unstripped_runtime_outputs - } - - forward_variables_from(invoker, [ "executable_extension" ]) - - toolchain_args = { - if (defined(invoker.toolchain_args)) { - forward_variables_from(invoker.toolchain_args, "*") - } - is_clang = true - } - - if (defined(invoker.shlib_extension) && invoker.shlib_extension != "") { - shlib_extension = invoker.shlib_extension - } - } -} diff --git a/build/toolchain/get_concurrent_links.py b/build/toolchain/get_concurrent_links.py deleted file mode 100755 index 9da14fc6a7e6e4cff961bab35df8bad555dfa468..0000000000000000000000000000000000000000 --- a/build/toolchain/get_concurrent_links.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script computes the number of concurrent links we want to run -# in the build as a function of machine spec. It's based -# on GetDefaultConcurrentLinks in GYP. - -import multiprocessing -import optparse -import os -import re -import subprocess -import sys - - -def _get_total_memory_in_bytes(): - if sys.platform in ('win32', 'cygwin'): - import ctypes - - class MEMORYSTATUSEX(ctypes.Structure): - _fields_ = [ - ("dwLength", ctypes.c_ulong), - ("dwMemoryLoad", ctypes.c_ulong), - ("ullTotalPhys", ctypes.c_ulonglong), - ("ullAvailPhys", ctypes.c_ulonglong), - ("ullTotalPageFile", ctypes.c_ulonglong), - ("ullAvailPageFile", ctypes.c_ulonglong), - ("ullTotalVirtual", ctypes.c_ulonglong), - ("ullAvailVirtual", ctypes.c_ulonglong), - ("sullAvailExtendedVirtual", ctypes.c_ulonglong), - ] - - stat = MEMORYSTATUSEX(dwLength=ctypes.sizeof(MEMORYSTATUSEX)) - ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) - return stat.ullTotalPhys - elif sys.platform.startswith('linux'): - if os.path.exists("/proc/meminfo"): - with open("/proc/meminfo") as meminfo: - memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB') - for line in meminfo: - match = memtotal_re.match(line) - if not match: - continue - return float(match.group(1)) * 2**10 - elif sys.platform == 'darwin': - try: - return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize'])) - except Exception: - return 0 - return 0 - - -def _get_default_concurrent_links(mem_per_link_gb, reserve_mem_gb): - mem_total_bytes = _get_total_memory_in_bytes() - mem_total_bytes = max(0, mem_total_bytes - reserve_mem_gb * 2**30) - num_concurrent_links = int( - max(1, mem_total_bytes / mem_per_link_gb / 2**30)) - hard_cap = max(1, int(os.getenv('GYP_LINK_CONCURRENCY_MAX', 2**32))) - - try: - cpu_cap = multiprocessing.cpu_count() - except: # noqa E722 - cpu_cap = 1 - - return min(num_concurrent_links, hard_cap, cpu_cap) - - -def main(): - parser = optparse.OptionParser() - parser.add_option('--mem_per_link_gb', - action="store", - type="int", - default=8) - parser.add_option('--reserve_mem_gb', - action="store", - type="int", - default=0) - parser.disable_interspersed_args() - options, _ = parser.parse_args() - - print( - _get_default_concurrent_links(options.mem_per_link_gb, - options.reserve_mem_gb)) - return 0 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/toolchain/get_cpu_count.py b/build/toolchain/get_cpu_count.py deleted file mode 100755 index a93c04a98b39f1bbe02115030da7711e395b157e..0000000000000000000000000000000000000000 --- a/build/toolchain/get_cpu_count.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script shows cpu count to specify capacity of action pool. - -import multiprocessing -import sys - - -def main(): - try: - cpu_count = multiprocessing.cpu_count() - except: # noqa E722 - cpu_count = 1 - - print(cpu_count) - return 0 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn deleted file mode 100644 index 3906faa6c7e824bef8c527e3b4cba685f247a477..0000000000000000000000000000000000000000 --- a/build/toolchain/linux/BUILD.gn +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/toolchain/gcc_toolchain.gni") -clang_toolchain("clang_arm") { - toolchain_args = { - current_cpu = "arm" - current_os = "linux" - } - executable_extension = "" - shlib_extension = ".so" -} - -clang_toolchain("clang_arm64") { - toolchain_args = { - current_cpu = "arm64" - current_os = "linux" - } - executable_extension = "" - shlib_extension = ".so" -} - -gcc_toolchain("arm64") { - toolprefix = "aarch64-linux-gnu-" - - cc = "${toolprefix}gcc" - cxx = "${toolprefix}g++" - - ar = "${toolprefix}ar" - ld = cxx - - toolchain_args = { - current_cpu = "arm64" - current_os = "linux" - is_clang = false - } -} - -gcc_toolchain("arm") { - toolprefix = "arm-linux-gnueabihf-" - - cc = "${toolprefix}gcc" - cxx = "${toolprefix}g++" - - ar = "${toolprefix}ar" - ld = cxx - - toolchain_args = { - current_cpu = "arm" - current_os = "linux" - is_clang = false - } -} - -clang_toolchain("clang_x86") { - toolchain_args = { - current_cpu = "x86" - current_os = "linux" - } - executable_extension = "" - shlib_extension = ".so" -} - -gcc_toolchain("x86") { - cc = "gcc" - cxx = "g++" - - ar = "ar" - ld = cxx - - toolchain_args = { - current_cpu = "x86" - current_os = "linux" - is_clang = false - } -} - -clang_toolchain("clang_x64") { - toolchain_args = { - current_cpu = "x64" - current_os = "linux" - } - executable_extension = "" - shlib_extension = ".so" -} - -gcc_toolchain("x64") { - cc = "gcc" - cxx = "g++" - - ar = "ar" - ld = cxx - - toolchain_args = { - current_cpu = "x64" - current_os = "linux" - is_clang = false - } -} diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn deleted file mode 100644 index fd56709b7ea0f45950342dd1634064687394c64c..0000000000000000000000000000000000000000 --- a/build/toolchain/mac/BUILD.gn +++ /dev/null @@ -1,342 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/config/clang/clang.gni") -import("$build_root/config/mac/mac_sdk.gni") -import("$build_root/config/mac/symbols.gni") - -assert(host_os == "mac") - -import("$build_root/toolchain/cc_wrapper.gni") -import("$build_root/toolchain/clang_static_analyzer.gni") -import("$build_root/toolchain/toolchain.gni") - -# When implementing tools using Python scripts, a TOOL_VERSION=N env -# variable is placed in front of the command. The N should be incremented -# whenever the script is changed, so that the build system rebuilds all -# edges that utilize the script. Ideally this should be changed to use -# proper input-dirty checking, but that could be expensive. Instead, use a -# script to get the tool scripts' modification time to use as the version. -# This won't cause a re-generation of GN files when the tool script changes -# but it will cause edges to be marked as dirty if the ninja files are -# regenerated. See https://crbug.com/619083 for details. A proper fix -# would be to have inputs to tools (https://crbug.com/621119). -tool_versions = - exec_script("get_tool_mtime.py", - rebase_path([ - "$build_root/toolchain/mac/filter_libtool.py", - "$build_root/toolchain/mac/linker_driver.py", - ], - root_build_dir), - "trim scope") - -# Shared toolchain definition. Invocations should set current_os to set the -# build args in this definition. -template("mac_toolchain") { - toolchain(target_name) { - if (use_system_xcode) { - env_wrapper = "" - } else { - env_wrapper = "export DEVELOPER_DIR=$hermetic_xcode_path; " - } - - # When invoking this toolchain not as the default one, these args will be - # passed to the build. They are ignored when this is the default toolchain. - assert(defined(invoker.toolchain_args), - "Toolchains must declare toolchain_args") - toolchain_args = { - # Populate toolchain args from the invoker. - forward_variables_from(invoker.toolchain_args, "*") - - # The host toolchain value computed by the default toolchain's setup - # needs to be passed through unchanged to all secondary toolchains to - # ensure that it's always the same, regardless of the values that may be - # set on those toolchains. - host_toolchain = host_toolchain - } - - # Supports building with the version of clang shipped with Xcode when - # targeting iOS by not respecting clang_base_path. - if (toolchain_args.current_os == "ios" && use_xcode_clang) { - prefix = "" - } else { - prefix = rebase_path("$clang_base_path/bin/", root_build_dir) - } - - _cc = "${prefix}clang" - _cxx = "${prefix}clang++" - _ar = "${prefix}llvm-ar" - - # When the invoker has explicitly overridden use_goma or cc_wrapper in the - # toolchain args, use those values, otherwise default to the global one. - # This works because the only reasonable override that toolchains might - # supply for these values are to force-disable them. - if (defined(toolchain_args.cc_wrapper)) { - toolchain_cc_wrapper = toolchain_args.cc_wrapper - } else { - toolchain_cc_wrapper = cc_wrapper - } - - # Compute the compiler prefix. - if (toolchain_cc_wrapper != "") { - compiler_prefix = toolchain_cc_wrapper + " " - } else { - compiler_prefix = "" - } - - cc = compiler_prefix + _cc - cxx = compiler_prefix + _cxx - ld = _cxx - - if (use_clang_static_analyzer) { - analyzer_wrapper = - rebase_path("$build_root/toolchain/clang_static_analyzer_wrapper.py", - root_build_dir) + " --mode=clang" - cc = analyzer_wrapper + " ${cc}" - cxx = analyzer_wrapper + " ${cxx}" - ld = cxx - } - - linker_driver = "TOOL_VERSION=${tool_versions.linker_driver} " + - rebase_path("$build_root/toolchain/mac/linker_driver.py", - root_build_dir) - - # On iOS, the final applications are assembled using lipo (to support fat - # builds). The correct flags are passed to the linker_driver.py script - # directly during the lipo call. - _save_unstripped_output = false - - # Make these apply to all tools below. - lib_switch = "-l" - lib_dir_switch = "-L" - - # Object files go in this directory. Use label_name instead of - # target_output_name since labels will generally have no spaces and will be - # unique in the directory. - object_subdir = "{{source_out_dir}}/{{label_name}}" - - if (_save_unstripped_output) { - _unstripped_output = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.unstripped" - } - - tool("cc") { - depfile = "{{output}}.d" - precompiled_header_type = "gcc" - command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "CC {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("cxx") { - depfile = "{{output}}.d" - precompiled_header_type = "gcc" - command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "CXX {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("asm") { - # For GCC we can just use the C compiler to compile assembly. - depfile = "{{output}}.d" - command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "ASM {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("objc") { - depfile = "{{output}}.d" - precompiled_header_type = "gcc" - command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{framework_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "OBJC {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("objcxx") { - depfile = "{{output}}.d" - precompiled_header_type = "gcc" - command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{framework_dirs}} {{cflags}} {{cflags_objcc}} -c {{source}} -o {{output}}" - depsformat = "gcc" - description = "OBJCXX {{output}}" - outputs = [ "$object_subdir/{{source_name_part}}.o" ] - } - - tool("alink") { - rspfile = "{{output}}.rsp" - rspfile_content = "{{inputs}}" - command = "$_ar {{arflags}} -r -c -s -D {{output}} \"@$rspfile\"" - command = "rm -f {{output}} && $command" - description = "AR {{output}}" - outputs = [ "{{output_dir}}/{{target_output_name}}{{output_extension}}" ] - default_output_dir = "{{target_out_dir}}" - default_output_extension = ".a" - output_prefix = "lib" - } - - tool("solink") { - dylib = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # eg - # "./libfoo.dylib" - rspfile = dylib + ".rsp" - pool = "$build_root/toolchain:link_pool($default_toolchain)" - - # These variables are not built into GN but are helpers that implement - # (1) linking to produce a .dylib, (2) extracting the symbols from that - # file to a temporary file, (3) if the temporary file has differences from - # the existing .TOC file, overwrite it, otherwise, don't change it. - # - # As a special case, if the library reexports symbols from other dynamic - # libraries, we always update the .TOC and skip the temporary file and - # diffing steps, since that library always needs to be re-linked. - tocname = dylib + ".TOC" - temporary_tocname = dylib + ".tmp" - - does_reexport_command = "[ ! -e \"$dylib\" -o ! -e \"$tocname\" ] || otool -l \"$dylib\" | grep -q LC_REEXPORT_DYLIB" - - link_command = "$linker_driver $ld -shared " - if (is_component_build) { - link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{output_extension}}\" " - } - link_command += "{{ldflags}} -o \"$dylib\" -Wl,-filelist,\"$rspfile\" {{libs}} {{solibs}} {{frameworks}}" - - replace_command = "if ! cmp -s \"$temporary_tocname\" \"$tocname\"; then mv \"$temporary_tocname\" \"$tocname\"" - extract_toc_command = "{ otool -l \"$dylib\" | grep LC_ID_DYLIB -A 5; nm -gP \"$dylib\" | cut -f1-2 -d' ' | grep -v U\$\$; true; }" - - command = "$env_wrapper if $does_reexport_command ; then $link_command && $extract_toc_command > \"$tocname\"; else $link_command && $extract_toc_command > \"$temporary_tocname\" && $replace_command ; fi; fi" - - rspfile_content = "{{inputs_newline}}" - - description = "SOLINK {{output}}" - - # Use this for {{output_extension}} expansions unless a target manually - # overrides it (in which case {{output_extension}} will be what the target - # specifies). - default_output_dir = "{{root_out_dir}}" - default_output_extension = ".dylib" - - output_prefix = "lib" - - # Since the above commands only updates the .TOC file when it changes, ask - # Ninja to check if the timestamp actually changed to know if downstream - # dependencies should be recompiled. - restat = true - - # Tell GN about the output files. It will link to the dylib but use the - # tocname for dependency management. - outputs = [ - dylib, - tocname, - ] - link_output = dylib - depend_output = tocname - - if (_save_unstripped_output) { - outputs += [ _unstripped_output ] - } - } - - tool("solink_module") { - sofile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # eg - # "./libfoo.so" - rspfile = sofile + ".rsp" - pool = "$build_root/toolchain:link_pool($default_toolchain)" - - link_command = "$env_wrapper $linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,-filelist,\"$rspfile\"" - if (is_component_build) { - link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}" - } - link_command += " {{solibs}} {{libs}}" - command = link_command - - rspfile_content = "{{inputs_newline}}" - - description = "SOLINK_MODULE {{output}}" - - # Use this for {{output_extension}} expansions unless a target manually - # overrides it (in which case {{output_extension}} will be what the target - # specifies). - default_output_dir = "{{root_out_dir}}" - default_output_extension = ".so" - - outputs = [ sofile ] - - if (_save_unstripped_output) { - outputs += [ _unstripped_output ] - } - } - - tool("link") { - outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" - rspfile = "$outfile.rsp" - pool = "$build_root/toolchain:link_pool($default_toolchain)" - - # Note about -filelist: Apple's linker reads the file list file and - # interprets each newline-separated chunk of text as a file name. It - # doesn't do the things one would expect from the shell like unescaping - # or handling quotes. In contrast, when Ninja finds a file name with - # spaces, it single-quotes them in $inputs_newline as it would normally - # do for command-line arguments. Thus any source names with spaces, or - # label names with spaces (which GN bases the output paths on) will be - # corrupted by this process. Don't use spaces for source files or labels. - command = "$env_wrapper $linker_driver $ld {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{solibs}} {{libs}} {{frameworks}}" - description = "LINK $outfile" - rspfile_content = "{{inputs_newline}}" - outputs = [ outfile ] - - if (_save_unstripped_output) { - outputs += [ _unstripped_output ] - } - - default_output_dir = "{{root_out_dir}}" - } - - # These two are really entirely generic, but have to be repeated in - # each toolchain because GN doesn't allow a template to be used here. - # See $build_root/toolchain/toolchain.gni for details. - tool("stamp") { - command = stamp_command - description = stamp_description - } - tool("copy") { - command = copy_command - description = copy_description - } - - tool("action") { - pool = "$build_root/toolchain:action_pool($default_toolchain)" - } - } -} - -mac_toolchain("clang_x64") { - toolchain_args = { - current_cpu = "x64" - current_os = "mac" - } -} - -mac_toolchain("clang_x86") { - toolchain_args = { - current_cpu = "x86" - current_os = "mac" - } -} - -mac_toolchain("clang_arm64") { - toolchain_args = { - current_cpu = "arm64" - current_os = "mac" - } -} diff --git a/build/toolchain/mac/filter_libtool.py b/build/toolchain/mac/filter_libtool.py deleted file mode 100755 index 9a2bcbd13dc719b6b083b6e4dc5b3ae0c1520183..0000000000000000000000000000000000000000 --- a/build/toolchain/mac/filter_libtool.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import re -import subprocess -import sys - -# This script executes libtool and filters out logspam lines like: -# '/path/to/libtool: file: foo.o has no symbols' -BLOCKLIST_PATTERNS = map(re.compile, [ - r'^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$', - r'^.*libtool: warning for library: .* the table of contents is empty ' - r'\(no object file members in the library define global symbols\)$', - r'^.*libtool: warning same member name \(\S*\) in output file used for ' - r'input files: \S* and: \S* \(due to use of basename, truncation, ' - r'blank padding or duplicate input files\)$', -]) - - -def is_blocklisted_line(line): - """Returns whether the line should be filtered out.""" - for pattern in BLOCKLIST_PATTERNS: - if isinstance(line, bytes): - line = line.decode() - if pattern.match(line): - return True - return False - - -def main(cmd_list): - env = os.environ.copy() - # The problem with this flag is that it resets the file mtime on the file - # to epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. - env['ZERO_AR_DATE'] = '1' - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) - _, err = libtoolout.communicate() - for line in err.splitlines(): - if not is_blocklisted_line(line): - print(line, file=sys.stderr) - # Unconditionally touch the output .a file on the command line if present - # and the command succeeded. A bit hacky. - if not libtoolout.returncode: - for i in range(len(cmd_list) - 1): - if cmd_list[i] == '-o' and cmd_list[i + 1].endswith('.a'): - os.utime(cmd_list[i + 1], None) - break - return libtoolout.returncode - - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) diff --git a/build/toolchain/mac/get_tool_mtime.py b/build/toolchain/mac/get_tool_mtime.py deleted file mode 100755 index 5340720cd475590bb11220475f81d769fc873897..0000000000000000000000000000000000000000 --- a/build/toolchain/mac/get_tool_mtime.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import sys - -# Usage: python get_tool_mtime.py path/to/file1.py path/to/file2.py -# -# Prints a GN scope with the variable name being the basename sans-extension -# and the value being the file modification time. A variable is emitted for -# each file argument on the command line. - -if __name__ == '__main__': - for f in sys.argv[1:]: - variable = os.path.splitext(os.path.basename(f))[0] - print('%s = %d' % (variable, os.path.getmtime(f))) diff --git a/build/toolchain/mac/linker_driver.py b/build/toolchain/mac/linker_driver.py deleted file mode 100755 index c958bc9ce502002642ae26a08d515bd687e5f405..0000000000000000000000000000000000000000 --- a/build/toolchain/mac/linker_driver.py +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import os.path -import shutil -import subprocess -import sys - -""" -The linker_driver.py is responsible for forwarding a linker invocation to -the compiler driver, while processing special arguments itself. - -Usage: linker_driver.py clang++ main.o -L. -llib -o prog -Wcrl,dsym,out - -On Mac, the logical step of linking is handled by three discrete tools to -perform the image link, debug info link, and strip. The linker_driver.py -combines these three steps into a single tool. - -The command passed to the linker_driver.py should be the compiler driver -invocation for the linker. It is first invoked unaltered (except for the -removal of the special driver arguments, described below). Then the driver -performs additional actions, based on these arguments: - - -Wcrl,dsym, - After invoking the linker, this will run `dsymutil` on the linker's - output, producing a dSYM bundle, stored at dsym_path_prefix. As an - example, if the linker driver were invoked with: - "... -o out/gn/obj/foo/libbar.dylib ... -Wcrl,dsym,out/gn ..." - The resulting dSYM would be out/gn/libbar.dylib.dSYM/. - - -Wcrl,unstripped, - After invoking the linker, and before strip, this will save a copy of - the unstripped linker output in the directory unstripped_path_prefix. - - -Wcrl,strip, - After invoking the linker, and optionally dsymutil, this will run - the strip command on the linker's output. strip_arguments are - comma-separated arguments to be passed to the strip command. -""" - - -def main(args): - """main function for the linker driver. Separates out the arguments for - the main compiler driver and the linker driver, then invokes all the - required tools. - - Args: - args: list of string, Arguments to the script. - """ - - if len(args) < 2: - raise RuntimeError("Usage: linker_driver.py [linker-invocation]") - - for i in range(len(args)): - if args[i] != '--developer_dir': - continue - os.environ['DEVELOPER_DIR'] = args[i + 1] - del args[i:i + 2] - break - - # Collect arguments to the linker driver (this script) and remove them from - # the arguments being passed to the compiler driver. - linker_driver_actions = {} - compiler_driver_args = [] - for arg in args[1:]: - if arg.startswith(_LINKER_DRIVER_ARG_PREFIX): - # Convert driver actions into a map of name => lambda to invoke. - driver_action = process_linker_driver_arg(arg) - assert driver_action[0] not in linker_driver_actions - linker_driver_actions[driver_action[0]] = driver_action[1] - else: - compiler_driver_args.append(arg) - - linker_driver_outputs = [_find_linker_output(compiler_driver_args)] - - try: - # Run the linker by invoking the compiler driver. - subprocess.check_call(compiler_driver_args) - - # Run the linker driver actions, in the order specified by the actions list. - for action in _LINKER_DRIVER_ACTIONS: - name = action[0] - if name in linker_driver_actions: - linker_driver_outputs += linker_driver_actions[name](args) - except: - # If a linker driver action failed, remove all the outputs to make the - # build step atomic. - map(_remove_path, linker_driver_outputs) - - # Re-report the original failure. - raise - - -def process_linker_driver_arg(arg): - """Processes a linker driver argument and returns a tuple containing the - name and unary lambda to invoke for that linker driver action. - - Args: - arg: string, The linker driver argument. - - Returns: - A 2-tuple: - 0: The driver action name, as in _LINKER_DRIVER_ACTIONS. - 1: An 1-ary lambda that takes the full list of arguments passed to - main(). The lambda should call the linker driver action that - corresponds to the argument and return a list of outputs from the - action. - """ - if not arg.startswith(_LINKER_DRIVER_ARG_PREFIX): - raise ValueError('%s is not a linker driver argument' % (arg,)) - - sub_arg = arg[len(_LINKER_DRIVER_ARG_PREFIX):] - - for driver_action in _LINKER_DRIVER_ACTIONS: - (name, action) = driver_action - if sub_arg.startswith(name): - return (name, - lambda full_args: action(sub_arg[len(name):], full_args)) - - raise ValueError('Unknown linker driver argument: %s' % (arg,)) - - -def run_dsym_util(dsym_path_prefix, full_args): - """Linker driver action for -Wcrl,dsym,. Invokes dsymutil - on the linker's output and produces a dsym file at |dsym_file| path. - - Args: - dsym_path_prefix: string, The path at which the dsymutil output should be - located. - full_args: list of string, Full argument list for the linker driver. - - Returns: - list of string, Build step outputs. - """ - if not len(dsym_path_prefix): - raise ValueError('Unspecified dSYM output file') - - linker_out = _find_linker_output(full_args) - base = os.path.basename(linker_out) - dsym_out = os.path.join(dsym_path_prefix, base + '.dSYM') - - # Remove old dSYMs before invoking dsymutil. - _remove_path(dsym_out) - subprocess.check_call(['xcrun', 'dsymutil', '-o', dsym_out, linker_out]) - return [dsym_out] - - -def run_save_unstripped(unstripped_path_prefix, full_args): - """Linker driver action for -Wcrl,unstripped,. Copies - the linker output to |unstripped_path_prefix| before stripping. - - Args: - unstripped_path_prefix: string, The path at which the unstripped output - should be located. - full_args: list of string, Full argument list for the linker driver. - - Returns: - list of string, Build step outputs. - """ - if not len(unstripped_path_prefix): - raise ValueError('Unspecified unstripped output file') - - linker_out = _find_linker_output(full_args) - base = os.path.basename(linker_out) - unstripped_out = os.path.join(unstripped_path_prefix, base + '.unstripped') - - shutil.copyfile(linker_out, unstripped_out) - return [unstripped_out] - - -def run_strip(strip_args_string, full_args): - """Linker driver action for -Wcrl,strip,. - - Args: - strip_args_string: string, Comma-separated arguments for `strip`. - full_args: list of string, Full arguments for the linker driver. - - Returns: - list of string, Build step outputs. - """ - strip_command = ['xcrun', 'strip'] - if len(strip_args_string) > 0: - strip_command += strip_args_string.split(',') - strip_command.append(_find_linker_output(full_args)) - subprocess.check_call(strip_command) - return [] - - -def _find_linker_output(full_args): - """Finds the output of the linker by looking for the output flag in its - argument list. As this is a required linker argument, raises an error if it - cannot be found. - """ - # The linker_driver.py script may be used to wrap either the compiler linker - # (uses -o to configure the output) or lipo (uses -output to configure the - # output). Since wrapping the compiler linker is the most likely possibility - # use try/except and fallback to checking for -output if -o is not found. - try: - output_flag_index = full_args.index('-o') - except ValueError: - output_flag_index = full_args.index('-output') - return full_args[output_flag_index + 1] - - -def _remove_path(path): - """Removes the file or directory at |path| if it exists.""" - if os.path.exists(path): - if os.path.isdir(path): - shutil.rmtree(path) - else: - os.unlink(path) - - -_LINKER_DRIVER_ARG_PREFIX = '-Wcrl,' - -"""List of linker driver actions. The sort order of this list affects the -order in which the actions are invoked. The first item in the tuple is the -argument's -Wcrl, and the second is the function to invoke. -""" -_LINKER_DRIVER_ACTIONS = [ - ('dsym,', run_dsym_util), - ('unstripped,', run_save_unstripped), - ('strip,', run_strip), -] - -if __name__ == '__main__': - main(sys.argv) - sys.exit(0) diff --git a/build/toolchain/mingw/BUILD.gn b/build/toolchain/mingw/BUILD.gn deleted file mode 100644 index e61675dc3f080470e87cabc104ed0847a2262788..0000000000000000000000000000000000000000 --- a/build/toolchain/mingw/BUILD.gn +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("$build_root/toolchain/gcc_toolchain.gni") - -declare_args() { - # Whether unstripped binaries, i.e. compiled with debug symbols, should be - # considered runtime_deps rather than stripped ones. - mingw_unstripped_runtime_outputs = true -} - -template("mingw_toolchain") { - gcc_toolchain(target_name) { - assert(defined(invoker.toolchain_root), - "toolchain_root must be defined for mingw_toolchain.") - assert(defined(invoker.toolchain_args), - "toolchain_args must be defined for mingw_toolchain.") - toolchain_args = invoker.toolchain_args - - _mingw_tool_prefix = - rebase_path("${invoker.toolchain_root}/bin", root_build_dir) - - cc = "${_mingw_tool_prefix}/clang" - cxx = "${_mingw_tool_prefix}/clang++" - ar = "${_mingw_tool_prefix}/llvm-ar" - ld = cxx - strip = "${_mingw_tool_prefix}/llvm-strip" - use_unstripped_as_runtime_outputs = mingw_unstripped_runtime_outputs - - executable_extension = ".exe" - shlib_extension = ".dll" - } -} - -mingw_toolchain("mingw_x86_64") { - toolchain_root = "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw" - toolchain_args = { - current_cpu = "x86_64" - current_os = "mingw" - - # use_custom_libcxx = false - is_clang = true - } -} diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni deleted file mode 100644 index 208f26d67deab854933c1d5da6f8f625a8b1e6e2..0000000000000000000000000000000000000000 --- a/build/toolchain/toolchain.gni +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Toolchain-related configuration that may be needed outside the context of the -# toolchain() rules themselves. - -import("$build_root/misc/overrides/build.gni") - -declare_args() { - # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 - # in the environment, we use the revision in the llvm repo to determine - # the CLANG_REVISION to use, instead of the version hard-coded into - # //tools/clang/scripts/update.py. This should only be used in - # conjunction with setting LLVM_FORCE_HEAD_REVISION in the - # environment when `gclient runhooks` is run as well. - llvm_force_head_revision = false - - # Compile with Xcode version of clang instead of hermetic version shipped - # with the build. Used on iOS to ship official builds (as they are built - # with the version of clang shipped with Xcode). - use_xcode_clang = false - - # Use absolute file paths in the compiler diagnostics and __FILE__ macro - # if needed. - msvc_use_absolute_paths = false -} - -# The path to the hermetic install of Xcode. Only relevant when -hermetic_xcode_path = - rebase_path("//build/${target_os}_files/Xcode.app", "", root_build_dir) - -declare_args() { - if (is_clang) { - # Clang compiler version. Clang files are placed at version-dependent paths. - clang_version = "15.0.4" - } - use_custom_clang = true -} - -# Check target_os here instead of is_ios as this file is loaded for secondary -# toolchain (host toolchain in particular) but the argument is the same for -# all toolchains. -assert(!use_xcode_clang || target_os == "ios", - "Using Xcode's clang is only supported in iOS builds") - -# Extension for shared library files (including leading dot). -if (is_mac) { - shlib_extension = ".dylib" - dylib_extension = ".dylib.so" - rlib_extension = ".rlib" -} else if (is_ohos && is_component_build) { - # By appending .z, we prevent name collisions with libraries already loaded by the ohos. - shlib_extension = ".z.so" -} else if (is_mingw) { - shlib_extension = ".dll" -} else if (is_posix) { - shlib_extension = ".so" -} else if (is_win) { - shlib_extension = ".dll" -} else { - assert(false, "Platform not supported") -} - -# Prefix for shared library files. -if (is_posix) { - shlib_prefix = "lib" -} else { - shlib_prefix = "" -} - -# While other "tool"s in a toolchain are specific to the target of that -# toolchain, the "stamp" and "copy" tools are really generic to the host; -# but each toolchain must define them separately. GN doesn't allow a -# template instantiation inside a toolchain definition, so some boilerplate -# has to be repeated in each toolchain to define these two tools. These -# four variables reduce the duplication in that boilerplate. -stamp_description = "STAMP {{output}}" -copy_description = "COPY {{source}} {{output}}" -if (host_os == "win") { - _tool_wrapper_path = - rebase_path("$build_root/toolchain/win/tool_wrapper.py", root_build_dir) - stamp_command = "cmd /c type nul > \"{{output}}\"" - copy_command = - "$python_path $_tool_wrapper_path recursive-mirror {{source}} {{output}}" -} else { - stamp_command = "touch {{output}}" - copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" -} diff --git a/toolchain_config.gni b/toolchain_config.gni index e02bd052a388858f80c789fc5bf48fda87ffb463..2522cac24dcb61aa641c9cbb030522d60778156c 100644 --- a/toolchain_config.gni +++ b/toolchain_config.gni @@ -25,7 +25,7 @@ if (!ark_standalone_build) { import("$build_root/config/components/toolchain/build_type.gni") import("$build_root/ohos.gni") } else { - ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn" + ark_third_party_root = "//build/third_party_gn" import("$build_root/ark.gni") import("$build_root/config/build_type.gni") }