From 85fd20384094ed84f432c15c3a72e100b7d57f2b Mon Sep 17 00:00:00 2001 From: karenonni Date: Tue, 15 Oct 2024 03:00:34 +0000 Subject: [PATCH] add skip compiler command Issue: #IAX5QB Signed-off-by: karenonni Change-Id: I28c96ddd32119261052e5427a8785f523b4892f6 --- build/compile_script/ark.py | 89 +++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 23 deletions(-) diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index 1f9fff09..5b1c3007 100755 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -310,23 +310,51 @@ class ArkPy: @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" + libs = [] + if is_aot: + if is_arm: + if is_pgo: + # ARM + AOT + PGO + libs.extend([ + f"../../{out_dir}/arkcompiler/ets_runtime", + f"../../{out_dir}/thirdparty/icu", + f"../../{out_dir}/third_party/icu", + "../../thirdparty/zlib", + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib", + f"../../{out_dir}/thirdparty/bounds_checking_function", + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" + ]) + else: + # ARM + AOT + Not PGO + libs.extend([ + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib", + f"../../{x64_out_dir}/thirdparty/icu/", + f"../../{out_dir}/thirdparty/bounds_checking_function", + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" + ]) + else: + # Non-ARM + AOT + libs.extend([ + f"../../{out_dir}/arkcompiler/ets_runtime", + f"../../{out_dir}/thirdparty/icu", + f"../../{out_dir}/third_party/icu", + "../../thirdparty/zlib", + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib" + ]) + else: + if is_arm: + # ARM + not AOT + libs.extend([ + f"../../{out_dir}/thirdparty/bounds_checking_function", + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" + ]) + else: + # Not AOT + not arm + libs.append("../../prebuilts/clang/ohos/linux-x86_64/llvm/lib") + + # Join all paths with colon separator + libs_dir_str = ":".join(libs) + return f"--libs-dir {libs_dir_str}" @staticmethod def get_cmd(test_suite, test_script_name, test_script_path, gn_args, out_path, x64_out_path, aot_mode, run_pgo, @@ -393,7 +421,9 @@ class ArkPy: 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"../../{out_path}/thirdparty/zlib:../../prebuilts/clang/ohos/linux-x86_64/llvm/lib:" \ + f"../../{out_path}/thirdparty/bounds_checking_function:" \ + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" \ " --ark-arch aarch64" \ f" --ark-arch-root=../../{out_path}/common/common/libc/" \ f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ @@ -405,7 +435,9 @@ class ArkPy: " --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/" \ + " --libs-dir ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib:../../{2}/thirdparty/icu/:" \ + f"../../{out_path}/thirdparty/bounds_checking_function:" \ + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" \ " --ark-arch aarch64" \ " --ark-arch-root=../../{1}/common/common/libc/" \ " --ark-aot" \ @@ -420,6 +452,8 @@ class ArkPy: 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"../../{out_path}/thirdparty/bounds_checking_function:" \ + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" \ 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" \ @@ -439,6 +473,7 @@ class ArkPy: 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" \ + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" \ f":../../{out_path}/arkcompiler/ets_runtime:" \ " --ark-arch aarch64" \ " --run-jit" \ @@ -452,6 +487,8 @@ class ArkPy: 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" \ + f"../../{out_path}/thirdparty/bounds_checking_function:" \ + "../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-ohos" \ " --run-jit" \ f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ f" --ark-frontend-binary=../../{out_path}/arkcompiler/ets_frontend/es2abc" \ @@ -874,9 +911,11 @@ class ArkPy: 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): + 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) - self.call_build_gn_target(gn_args, out_path, x64_out_path, test_suite, log_file_name) + if skip_compiler != True: + 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, @@ -909,6 +948,7 @@ class ArkPy: 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) @@ -925,7 +965,8 @@ class ArkPy: run_pgo=is_pgo, run_baseline_jit=is_baseline_jit, aot_mode=is_aot_mode, - enable_litecg=is_litecg + enable_litecg=is_litecg, + skip_compiler=is_skip_compiler ) def build_for_unittest(self, out_path: str, gn_args: list, log_file_name: str): @@ -945,6 +986,7 @@ class ArkPy: 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) @@ -962,7 +1004,8 @@ class ArkPy: run_baseline_jit=is_baseline_jit, aot_mode=is_aot, enable_litecg=is_litecg, - ignore_list=ignore_list + ignore_list=ignore_list, + skip_compiler=is_skip_compiler ) def build(self, out_path: str, gn_args: list, arg_list: list): -- Gitee