From 2cd388de17e063e1e502f49bb337adcf6fde233b Mon Sep 17 00:00:00 2001 From: Petrov Igor Date: Mon, 11 Nov 2024 18:38:39 +0300 Subject: [PATCH 01/13] [MM] Support hybrid build for JS and STS Support arkplatform as common library for JS and STS VMs Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IB80F7 Testing: `ark.py` Signed-off-by: Petrov Igor --- build/compile_script/ark.py | 10 ++++++++++ build/core/gn/BUILD.gn | 18 ++++++++++++++++++ build/third_party_gn/libuv/BUILD.gn | 21 ++++++++++----------- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index c3fba732..f97fd3c3 100755 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -228,6 +228,11 @@ class ArkPy: "description": "Compile arkcompiler target and run regresstest with arkcompiler target.", "gn_targets_depend_on": ["default"], }, + "hybrid": { + "flags": ["hybrid"], + "description": "Compile ArkJS and STS parts in hybrid mode.", + "gn_targets_depend_on": ["hybrid"], + }, "gn_target": { "flags": [""], # any other flags "description": @@ -1015,6 +1020,11 @@ class ArkPy: 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) + elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("hybrid"), arg_list[0]): + self.build_for_gn_target(out_path, + gn_args + ["ark_ets_hybrid=true", "ark_js_hybrid=true"], + self.ARG_DICT.get("target").get("hybrid").get("gn_targets_depend_on"), + self.GN_TARGET_LOG_FILE_NAME) else: self.build_for_gn_target(out_path, gn_args, arg_list, self.GN_TARGET_LOG_FILE_NAME) return diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 8281cdfa..96b180d5 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -91,6 +91,24 @@ group("static_core") { "$ark_root/static_core/libpandabase:libarktsbase", "$ark_root/static_core/libpandafile:libarktsfile", ] + if (target_os != "mingw") { + deps += [ "$ark_root/static_core/runtime:libarkruntime" ] + } +} + +group("hybrid") { + deps = [ + ":ets_frontend", + ":ets_runtime", + ":static_core", + "$ark_root/static_core/plugins/ets:etsstdlib(${host_toolchain})", + ] + if (target_os != "mingw") { + deps += [ + "$ark_root/static_core/plugins/ets/runtime/interop_js:ets_interop_js_napi", + "$ark_root/static_core/tools/ark_js_napi_cli:ark_js_napi_cli", + ] + } } group("toolchain") { diff --git a/build/third_party_gn/libuv/BUILD.gn b/build/third_party_gn/libuv/BUILD.gn index 5bb82bb0..183cd2b4 100644 --- a/build/third_party_gn/libuv/BUILD.gn +++ b/build/third_party_gn/libuv/BUILD.gn @@ -66,10 +66,9 @@ config("libuv_config") { "-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" ] + if (!is_debug) { + defines += [ "NDEBUG" ] + } } else if (is_mingw || is_win) { cflags += [ "-Wno-missing-braces", @@ -127,13 +126,13 @@ ohos_source_set("libuv_source") { 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/kqueue.c", "//third_party/libuv/src/unix/log_unix.c", + "//third_party/libuv/src/unix/os390-proctitle.c", + "//third_party/libuv/src/unix/random-getentropy.c", "//third_party/libuv/src/unix/trace_unix.c", ] } else if (is_mingw || is_win) { @@ -170,10 +169,10 @@ ohos_source_set("libuv_source") { sources += nonwin_srcs + [ "//third_party/libuv/src/unix/linux.c", "//third_party/libuv/src/unix/procfs-exepath.c", + "//third_party/libuv/src/unix/proctitle.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", @@ -182,20 +181,20 @@ ohos_source_set("libuv_source") { } else if (is_linux) { sources += nonwin_srcs + [ "//third_party/libuv/src/unix/linux.c", + "//third_party/libuv/src/unix/log_unix.c", "//third_party/libuv/src/unix/procfs-exepath.c", + "//third_party/libuv/src/unix/proctitle.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/proctitle.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" -- Gitee From 1a40964d7b019f8d4ca1520e2b74e8569bcf3c60 Mon Sep 17 00:00:00 2001 From: Petrov Igor Date: Thu, 19 Dec 2024 13:03:10 +0300 Subject: [PATCH 02/13] [Build] Set hybrid build as default Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IBCEZI Testing: CI Signed-off-by: Petrov Igor --- build/compile_script/ark.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index f97fd3c3..77ab229f 100755 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -325,6 +325,7 @@ class ArkPy: 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}/arkcompiler/runtime_core:" f"../../{out_dir}/thirdparty/icu:" f"../../{out_dir}/third_party/icu:" f"../../thirdparty/zlib:" @@ -334,6 +335,7 @@ class ArkPy: 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}/arkcompiler/runtime_core" f":../../{out_dir}/thirdparty/icu:" f"../../{out_dir}/third_party/icu:" f"../../thirdparty/zlib:" @@ -407,6 +409,7 @@ 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}/arkcompiler/runtime_core" \ " --ark-arch aarch64" \ f" --ark-arch-root=../../{out_path}/common/common/libc/" \ f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ @@ -433,6 +436,7 @@ 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}/arkcompiler/runtime_core" \ 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" \ @@ -453,6 +457,7 @@ class ArkPy: 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:" \ + f"../../{out_path}/arkcompiler/runtime_core:" \ " --ark-arch aarch64" \ " --run-jit" \ f" --ark-arch-root=../../{out_path}/common/common/libc/" \ @@ -465,6 +470,7 @@ 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}/arkcompiler/runtime_core" \ " --run-jit" \ f" --ark-tool=../../{out_path}/arkcompiler/ets_runtime/ark_js_vm" \ f" --ark-frontend-binary=../../{out_path}/arkcompiler/ets_frontend/es2abc" \ -- Gitee From 570f5cc9996dbbe03a4ef219341bf6dfec0e905e Mon Sep 17 00:00:00 2001 From: Tao Wu Date: Tue, 7 Jan 2025 21:43:40 +0800 Subject: [PATCH 03/13] Standalone build for static linker Support building static linker for Linux, Windows and OHOS by standalone build. Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IBGBHL Signed-off-by: Tao Wu Change-Id: I94121910dca88382a319846962efed977bc427d2 --- build/core/gn/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 96b180d5..de909824 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -90,6 +90,7 @@ group("static_core") { "$ark_root/static_core/compiler:libarktscompiler", "$ark_root/static_core/libpandabase:libarktsbase", "$ark_root/static_core/libpandafile:libarktsfile", + "$ark_root/static_core/static_linker:static_linker", ] if (target_os != "mingw") { deps += [ "$ark_root/static_core/runtime:libarkruntime" ] -- Gitee From ebc72fe854e632bea4536ac3e3ab2e28ed372696 Mon Sep 17 00:00:00 2001 From: kurnevichstanislav Date: Tue, 17 Dec 2024 18:19:20 +0300 Subject: [PATCH 04/13] Add interop gtests helper to hybrid build group Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/IBBYSB?from=project-issue Signed-off-by: kurnevichstanislav Change-Id: I23fba18cb26a4d1989a8ed864ba6428a56989143 --- build/compile_script/ark.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index 77ab229f..60035a4c 100755 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# Copyright (c) 2022-2024 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -229,9 +229,9 @@ class ArkPy: "gn_targets_depend_on": ["default"], }, "hybrid": { - "flags": ["hybrid"], + "flags": ["hybrid", "hybrid_tests"], "description": "Compile ArkJS and STS parts in hybrid mode.", - "gn_targets_depend_on": ["hybrid"], + "gn_targets_depend_on": [], }, "gn_target": { "flags": [""], # any other flags @@ -1027,9 +1027,10 @@ class ArkPy: 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) elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("hybrid"), arg_list[0]): + targets = arg_list self.build_for_gn_target(out_path, gn_args + ["ark_ets_hybrid=true", "ark_js_hybrid=true"], - self.ARG_DICT.get("target").get("hybrid").get("gn_targets_depend_on"), + targets, self.GN_TARGET_LOG_FILE_NAME) else: self.build_for_gn_target(out_path, gn_args, arg_list, self.GN_TARGET_LOG_FILE_NAME) -- Gitee From dcaae8c7ee0d775a47d4340e47e33b54d3d6f761 Mon Sep 17 00:00:00 2001 From: Artem Udovichenko Date: Fri, 24 Jan 2025 10:56:23 +0300 Subject: [PATCH 05/13] Fix stacktrace printing Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IBJE1G Change-Id: Ia7b3dce273ab693a7bbe709b01b750c637838b18 Signed-off-by: Artem Udovichenko --- BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 6e6df7b9..e49e8430 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -169,12 +169,14 @@ config("ark_toolchain_common_config") { cflags_cc += [ "-O3", "-ggdb3", + "-gdwarf-4", "-fno-omit-frame-pointer", "-D_GLIBCXX_ASSERTIONS", ] cflags_c += [ "-O3", "-ggdb3", + "-gdwarf-4", "-fno-omit-frame-pointer", "-D_GLIBCXX_ASSERTIONS", ] @@ -182,6 +184,7 @@ config("ark_toolchain_common_config") { cflags_cc += [ "-O0", "-ggdb3", + "-gdwarf-4", ] } else { defines += [ "NDEBUG" ] -- Gitee From 984b58424f9b1ef1129a36ef8bb51c96babd8cf2 Mon Sep 17 00:00:00 2001 From: lijunru Date: Wed, 19 Feb 2025 20:34:07 +0800 Subject: [PATCH 06/13] Add lsp build target Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/IBP1PP Signed-off-by: lijunru --- build/core/gn/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index de909824..6dc3d457 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -72,6 +72,7 @@ group("ets_frontend") { target_os == "mac") { deps = [ "$ets_frontend_root/es2panda:es2panda", + "$ets_frontend_root/ets2panda/lsp:lsp_packages", "$ets_frontend_root/merge_abc:merge_abc", ] } -- Gitee From 950bc17f0a9c62ddccb7174db1f44a6d81901281 Mon Sep 17 00:00:00 2001 From: wengchangcheng Date: Thu, 13 Mar 2025 15:52:19 +0800 Subject: [PATCH 07/13] add base_runtime Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/IBT461 Signed-off-by: wengchangcheng Change-Id: Ie249c562b99b8a2cc1e775fed2b8688f0d22a7ab --- BUILD.gn | 5 ++++- build/core/gn/BUILD.gn | 7 ++++++- build/templates/cxx/external_deps_handler.py | 6 +++++- toolchain_config.gni | 3 ++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index e49e8430..18f559fb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -274,6 +274,9 @@ group("ark_js_host_unittest") { "//arkcompiler/ets_runtime:ark_runtime_host_unittest", "//arkcompiler/toolchain:ark_toolchain_host_unittest", ] + if (ark_standalone_build) { + deps += [ "$base_root:base_runtime_host_unittest" ] + } } group("runtime_core_host_ut") { diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 6dc3d457..e97716b5 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -28,6 +28,7 @@ print() group("default") { deps = [ + ":base_runtime", ":ets_frontend", ":ets_runtime", ":runtime_core", @@ -130,3 +131,7 @@ group("toolchain") { ] } } + +group("base_runtime") { + deps = [ "$base_root:libbase_runtime" ] +} diff --git a/build/templates/cxx/external_deps_handler.py b/build/templates/cxx/external_deps_handler.py index 82107af7..a449aeda 100755 --- a/build/templates/cxx/external_deps_handler.py +++ b/build/templates/cxx/external_deps_handler.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -92,6 +92,10 @@ def main(): 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("base_runtime"): + config_info = read_json_file("{}arkcompiler/base_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] diff --git a/toolchain_config.gni b/toolchain_config.gni index e02bd052..e5dde911 100644 --- a/toolchain_config.gni +++ b/toolchain_config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2025 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 @@ -31,6 +31,7 @@ if (!ark_standalone_build) { } ark_root = "//arkcompiler/runtime_core" js_root = "//arkcompiler/ets_runtime" +base_root = "//arkcompiler/base_runtime" global_root = "//base/global/i18n" hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits" qos_root = "//foundation/resourceschedule/qos_manager" -- Gitee From c87cd96947e10ec57e66da553fd33b7bb22cd911 Mon Sep 17 00:00:00 2001 From: wengchangcheng Date: Thu, 27 Mar 2025 14:30:53 +0800 Subject: [PATCH 08/13] Revert "add base_runtime" This reverts commit 950bc17f0a9c62ddccb7174db1f44a6d81901281. Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/IBWPWK Change-Id: I39219b79c4b1344c2c9d2f130bce1a39d794090f Signed-off-by: wengchangcheng Change-Id: I78fa15fba4477bcdf35e83c56ae5e496cd0e1dd6 (cherry picked from commit 6fd3ad823d1f7ffc243ebce7b81a899baf955e96) --- BUILD.gn | 3 --- build/core/gn/BUILD.gn | 5 ----- build/templates/cxx/external_deps_handler.py | 4 ---- toolchain_config.gni | 1 - 4 files changed, 13 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 18f559fb..04aae54c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -274,9 +274,6 @@ group("ark_js_host_unittest") { "//arkcompiler/ets_runtime:ark_runtime_host_unittest", "//arkcompiler/toolchain:ark_toolchain_host_unittest", ] - if (ark_standalone_build) { - deps += [ "$base_root:base_runtime_host_unittest" ] - } } group("runtime_core_host_ut") { diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index e97716b5..57349680 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -28,7 +28,6 @@ print() group("default") { deps = [ - ":base_runtime", ":ets_frontend", ":ets_runtime", ":runtime_core", @@ -131,7 +130,3 @@ group("toolchain") { ] } } - -group("base_runtime") { - deps = [ "$base_root:libbase_runtime" ] -} diff --git a/build/templates/cxx/external_deps_handler.py b/build/templates/cxx/external_deps_handler.py index a449aeda..506b91fc 100755 --- a/build/templates/cxx/external_deps_handler.py +++ b/build/templates/cxx/external_deps_handler.py @@ -92,10 +92,6 @@ def main(): 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("base_runtime"): - config_info = read_json_file("{}arkcompiler/base_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] diff --git a/toolchain_config.gni b/toolchain_config.gni index e5dde911..9442eb52 100644 --- a/toolchain_config.gni +++ b/toolchain_config.gni @@ -31,7 +31,6 @@ if (!ark_standalone_build) { } ark_root = "//arkcompiler/runtime_core" js_root = "//arkcompiler/ets_runtime" -base_root = "//arkcompiler/base_runtime" global_root = "//base/global/i18n" hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits" qos_root = "//foundation/resourceschedule/qos_manager" -- Gitee From 33bbf9751f7229ff2391250087d932027d24c05d Mon Sep 17 00:00:00 2001 From: cllvly Date: Wed, 2 Apr 2025 10:16:36 +0800 Subject: [PATCH 09/13] Update KFl Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IBY4TT Signed-off-by: chenlong --- test/ut/ignore-ut-release-qemu-toolchain.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/ut/ignore-ut-release-qemu-toolchain.txt b/test/ut/ignore-ut-release-qemu-toolchain.txt index 835394a7..0bc310cc 100644 --- a/test/ut/ignore-ut-release-qemu-toolchain.txt +++ b/test/ut/ignore-ut-release-qemu-toolchain.txt @@ -1,2 +1,5 @@ # Known failure list for ut - release - qemu - toolchain +#24285 +test/test/libjsdebugtest.so + -- Gitee From 93e8784631ba2f93eb246bc3a9ad7bd15fa5a580 Mon Sep 17 00:00:00 2001 From: kurnevichstanislav Date: Wed, 2 Apr 2025 19:13:32 +0300 Subject: [PATCH 10/13] add node as third party Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/IBYELV?from=project-issue Signed-off-by: kurnevichstanislav Change-Id: I21130fed51acd6b57bd5d950a9f29ba92b4b9f9a --- build/templates/cxx/external_deps_handler.py | 9 ++++++ build/third_party_gn/node/BUILD.gn | 31 ++++++++++++++++++++ build/third_party_gn/node/dummy_bundle.json | 15 ++++++++++ 3 files changed, 55 insertions(+) create mode 100644 build/third_party_gn/node/BUILD.gn create mode 100644 build/third_party_gn/node/dummy_bundle.json diff --git a/build/templates/cxx/external_deps_handler.py b/build/templates/cxx/external_deps_handler.py index b42f432e..86cfb387 100755 --- a/build/templates/cxx/external_deps_handler.py +++ b/build/templates/cxx/external_deps_handler.py @@ -144,6 +144,15 @@ def main(): "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)) + elif dep.startswith("node"): + config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ + "node/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("napi"): + config_info = read_json_file("{}foundation/arkui/napi/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) diff --git a/build/third_party_gn/node/BUILD.gn b/build/third_party_gn/node/BUILD.gn new file mode 100644 index 00000000..45291a8b --- /dev/null +++ b/build/third_party_gn/node/BUILD.gn @@ -0,0 +1,31 @@ +#Copyright (c) 2025 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("node_header_config") { + include_dirs = [ "//third_party/node/src" ] +} + +ohos_static_library("node_header_notice") { + public_configs = [ ":node_header_config" ] + sources = [ + "//third_party/node/jsvm.h", + "//third_party/node/src/js_native_api.h", + "//third_party/node/src/js_native_api_types.h", + "//third_party/node/src/node_api.h", + "//third_party/node/src/node_api_types.h", + ] + part_name = "node" + subsystem_name = "thirdparty" +} diff --git a/build/third_party_gn/node/dummy_bundle.json b/build/third_party_gn/node/dummy_bundle.json new file mode 100644 index 00000000..be34ad76 --- /dev/null +++ b/build/third_party_gn/node/dummy_bundle.json @@ -0,0 +1,15 @@ +{ + "component": { + "build": { + "inner_kits": [ + { + "name": "//arkcompiler/toolchain/build/third_party_gn/node:node_header_notice", + "header": { + "header_files": [], + "header_base": "//third_party/node/src" + } + } + ] + } + } +} -- Gitee From 31bb15a664a1f2650f948b40434fe478e1e4e374 Mon Sep 17 00:00:00 2001 From: fangting Date: Thu, 3 Apr 2025 15:58:25 +0800 Subject: [PATCH 11/13] fix bug Issue:https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IBYD0S Signed-off-by: fangting --- build/templates/cxx/cxx.gni | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/templates/cxx/cxx.gni b/build/templates/cxx/cxx.gni index 00e33939..570327a7 100755 --- a/build/templates/cxx/cxx.gni +++ b/build/templates/cxx/cxx.gni @@ -208,6 +208,12 @@ template("ohos_shared_library") { subsystem_name = "arkcompiler" part_name = "common" } + not_needed(invoker, + [ + "sanitize", + "branch_protector_ret", + ]) + output_dir = "${root_out_dir}/${subsystem_name}/${part_name}" shared_library(target_name) { forward_variables_from(invoker, @@ -314,6 +320,11 @@ template("ohos_source_set") { } assert(subsystem_name != "") assert(part_name != "") + not_needed(invoker, + [ + "sanitize", + "branch_protector_ret", + ]) source_set(target_name) { forward_variables_from(invoker, -- Gitee From b3463889a06f3cfbae4ada7277085b84bbe99a32 Mon Sep 17 00:00:00 2001 From: wuzhefengh Date: Fri, 4 Apr 2025 22:34:55 +0800 Subject: [PATCH 12/13] [Bugfix]: Isolate the mac compilation until its ready Current compilations of lsp and static-linker are not ready on mac_arm64 platform, so just simply disabling them until they can be compiled on mac_arm64. Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/IBYQGU Testings: pass related CIs. Signed-off-by: wuzhefengh Change-Id: Ia0cfbe72afb7f5dcbe9028d7b56be35451d0b4f3 --- build/core/gn/BUILD.gn | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index fc7bbe19..d91c7f3c 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -75,9 +75,11 @@ group("ets_frontend") { target_os == "mac") { deps = [ "$ets_frontend_root/es2panda:es2panda", - "$ets_frontend_root/ets2panda/lsp:lsp_packages", "$ets_frontend_root/merge_abc:merge_abc", ] + if (target_os != "mac") { + deps += [ "$ets_frontend_root/ets2panda/lsp:lsp_packages" ] + } } } @@ -94,9 +96,11 @@ group("static_core") { "$ark_root/static_core/compiler:libarktscompiler", "$ark_root/static_core/libpandabase:libarktsbase", "$ark_root/static_core/libpandafile:libarktsfile", - "$ark_root/static_core/static_linker:static_linker", ] - if (target_os != "mingw") { + if (target_os != "mac") { + deps += [ "$ark_root/static_core/static_linker:static_linker" ] + } + if (target_os != "mingw" && target_os != "mac") { deps += [ "$ark_root/static_core/runtime:libarkruntime" ] } } @@ -108,7 +112,7 @@ group("hybrid") { ":static_core", "$ark_root/static_core/plugins/ets:etsstdlib(${host_toolchain})", ] - if (target_os != "mingw") { + if (target_os != "mingw" && target_os != "mac") { deps += [ "$ark_root/static_core/plugins/ets/runtime/interop_js:ets_interop_js_napi", "$ark_root/static_core/tools/ark_js_napi_cli:ark_js_napi_cli", -- Gitee From bfe53e0ca89994d4a0615167f8e8adf3b5a491e1 Mon Sep 17 00:00:00 2001 From: yanzhiqi1 Date: Wed, 9 Apr 2025 16:18:37 +0800 Subject: [PATCH 13/13] fix security warnings Issue: #IC23AX Signed-off-by: yanzhiqi1 --- tooling/agent/tracing_impl.cpp | 8 ++++++++ tooling/client/domain/debugger_client.cpp | 4 ++++ tooling/client/domain/runtime_client.cpp | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/tooling/agent/tracing_impl.cpp b/tooling/agent/tracing_impl.cpp index b4540572..49054bcc 100644 --- a/tooling/agent/tracing_impl.cpp +++ b/tooling/agent/tracing_impl.cpp @@ -93,6 +93,10 @@ void TracingImpl::DispatcherImpl::RequestMemoryDump(const DispatchRequest &reque { std::unique_ptr params = RequestMemoryDumpParams::Create(request.GetParams()); + if (params == nullptr) { + SendResponse(request, DispatchResponse::Fail("wrong params")); + return; + } std::string dumpGuid; bool success = false; DispatchResponse response = tracing_->RequestMemoryDump(std::move(params), dumpGuid, success); @@ -103,6 +107,10 @@ void TracingImpl::DispatcherImpl::Start(const DispatchRequest &request) { std::unique_ptr params = StartParams::Create(request.GetParams()); + if (params == nullptr) { + SendResponse(request, DispatchResponse::Fail("wrong params")); + return; + } DispatchResponse response = tracing_->Start(std::move(params)); SendResponse(request, response); } diff --git a/tooling/client/domain/debugger_client.cpp b/tooling/client/domain/debugger_client.cpp index 0cf24c78..821fd330 100644 --- a/tooling/client/domain/debugger_client.cpp +++ b/tooling/client/domain/debugger_client.cpp @@ -381,6 +381,10 @@ void DebuggerClient::PausedReply(const std::unique_ptr json) std::map> data; for (int32_t i = 0; i < callFrames->GetSize(); i++) { std::unique_ptr callFrameInfo = CallFrame::Create(*(callFrames->Get(i))); + if (callFrameInfo == nullptr) { + LOGE("arkdb: get call frame info error"); + return; + } data.emplace(i + 1, std::move(callFrameInfo)); } diff --git a/tooling/client/domain/runtime_client.cpp b/tooling/client/domain/runtime_client.cpp index a46c1bc6..0293330c 100644 --- a/tooling/client/domain/runtime_client.cpp +++ b/tooling/client/domain/runtime_client.cpp @@ -297,6 +297,10 @@ void RuntimeClient::HandleHeapUsage(std::unique_ptr json) Session *session = SessionManager::getInstance().GetSessionById(sessionId_); VariableManager &variableManager = session->GetVariableManager(); std::unique_ptr heapUsageReturns = GetHeapUsageReturns::Create(*result); + if (heapUsageReturns == nullptr) { + LOGE("arkdb: get heap usage returns error"); + return; + } variableManager.SetHeapUsageInfo(std::move(heapUsageReturns)); variableManager.ShowHeapUsageInfo(); } -- Gitee