From 964cf810d91d2427e60e977725677aaae19f5fc7 Mon Sep 17 00:00:00 2001 From: chenjx-huawei Date: Thu, 14 Dec 2023 16:10:15 +0800 Subject: [PATCH] Add build option for fuzz and bugfix build error when enable run_with_asan Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8OESN Signed-off-by: chenjx-huawei Change-Id: I298b7954c837aa839bc7d958b2e1dde6facf3511 --- BUILD.gn | 37 +++++++++++++++++-------------------- js_runtime_config.gni | 6 ++++++ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index d23afc112c..261977ecaa 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -156,30 +156,27 @@ group("ark_unittest") { } } -if (!run_with_asan) { - _builtins_dts_path_ = - rebase_path("./ecmascript/ts_types/lib_ark_builtins.d.ts") +_builtins_dts_path_ = rebase_path("./ecmascript/ts_types/lib_ark_builtins.d.ts") - _es2abc_builtins_d_abc_path_ = - "$target_out_dir/lib_ark_builtins/es2abc/lib_ark_builtins.d.abc" +_es2abc_builtins_d_abc_path_ = + "$target_out_dir/lib_ark_builtins/es2abc/lib_ark_builtins.d.abc" - es2abc_gen_abc("es2abc_gen_builtins_d_abc") { - extra_visibility = [ "*" ] +es2abc_gen_abc("es2abc_gen_builtins_d_abc") { + extra_visibility = [ "*" ] - # extra_dependencies = _deps_ - src_js = rebase_path(_builtins_dts_path_) - dst_file = rebase_path(_es2abc_builtins_d_abc_path_) - extension = "ts" - extra_args = [ - "--module", - "--merge-abc", - "--type-extractor", - "--type-dts-builtin", - ] + # extra_dependencies = _deps_ + src_js = rebase_path(_builtins_dts_path_) + dst_file = rebase_path(_es2abc_builtins_d_abc_path_) + extension = "ts" + extra_args = [ + "--module", + "--merge-abc", + "--type-extractor", + "--type-dts-builtin", + ] - in_puts = [ _builtins_dts_path_ ] - out_puts = [ _es2abc_builtins_d_abc_path_ ] - } + in_puts = [ _builtins_dts_path_ ] + out_puts = [ _es2abc_builtins_d_abc_path_ ] } group("ark_runtime_host_unittest") { diff --git a/js_runtime_config.gni b/js_runtime_config.gni index ecef409044..202f966a7c 100644 --- a/js_runtime_config.gni +++ b/js_runtime_config.gni @@ -21,6 +21,9 @@ declare_args() { enable_ark_intl = true run_regress_test = false + # If true, enable fuzz option. Default false. + enable_fuzz_option = false + TARGET = "x86_64" HOST_ARCH = 64 } @@ -46,6 +49,9 @@ hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits" qos_root = "//foundation/resourceschedule/qos_manager" compile_llvm_online = false run_with_asan = false +if (enable_fuzz_option) { + run_with_asan = true +} enable_leak_check = false enable_cow_array = true enable_coverage = false