diff --git a/BUILD.gn b/BUILD.gn index 7e6db5b7ac9e5f31c31770b730ef3c7fcf3d7889..15c6ae7f3321549fa0f5b0551efd781e8dd93e2a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,46 +11,51 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (defined(ark_flag)) { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} else { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") -group("ark_packages") { - if (host_os != "mac") { - deps = [ - "$ark_root/libpandabase:libarkbase", - "$ark_root/libpandafile:libarkfile", - "$ark_root/libziparchive:libarkziparchive", - ] + group("ark_packages") { + if (host_os != "mac") { + deps = [ + "$ark_root/libpandabase:libarkbase", + "$ark_root/libpandafile:libarkfile", + "$ark_root/libziparchive:libarkziparchive", + ] + } } -} -group("ark_host_linux_tools_packages") { - if (host_os != "mac") { - deps = [ - "$ark_root/assembler:ark_asm(${host_toolchain})", - "$ark_root/disassembler:ark_disasm(${host_toolchain})", - "$ark_root/libpandabase:libarkbase(${host_toolchain})", - "$ark_root/libpandafile:libarkfile(${host_toolchain})", - "$ark_root/libziparchive:libarkziparchive(${host_toolchain})", - ] + group("ark_host_linux_tools_packages") { + if (host_os != "mac") { + deps = [ + "$ark_root/assembler:ark_asm(${host_toolchain})", + "$ark_root/disassembler:ark_disasm(${host_toolchain})", + "$ark_root/libpandabase:libarkbase(${host_toolchain})", + "$ark_root/libpandafile:libarkfile(${host_toolchain})", + "$ark_root/libziparchive:libarkziparchive(${host_toolchain})", + ] + } } -} -group("ark_host_windows_tools_packages") { - if (host_os != "mac" && !ark_standalone_build) { - deps = [ - "$ark_root/assembler:ark_asm(//build/toolchain/mingw:mingw_x86_64)", - "$ark_root/disassembler:ark_disasm(//build/toolchain/mingw:mingw_x86_64)", - ] + group("ark_host_windows_tools_packages") { + if (host_os != "mac" && !ark_standalone_build) { + deps = [ + "$ark_root/assembler:ark_asm(//build/toolchain/mingw:mingw_x86_64)", + "$ark_root/disassembler:ark_disasm(//build/toolchain/mingw:mingw_x86_64)", + ] + } } -} -group("ark_host_mac_tools_packages") { - if (host_os == "mac") { - deps = [ - "$ark_root/assembler:ark_asm(//build/toolchain/mac:clang_x64)", - "$ark_root/disassembler:ark_disasm(//build/toolchain/mac:clang_x64)", - ] + group("ark_host_mac_tools_packages") { + if (host_os == "mac") { + deps = [ + "$ark_root/assembler:ark_asm(//build/toolchain/mac:clang_x64)", + "$ark_root/disassembler:ark_disasm(//build/toolchain/mac:clang_x64)", + ] + } } } diff --git a/ark_config.gni b/ark_config.gni index 92618d5fcbba7f6d3cfd5c81465d4ffea74bc7ca..efbd75969d069ac54b1290c28f8d1be58e8bb21e 100644 --- a/ark_config.gni +++ b/ark_config.gni @@ -21,8 +21,13 @@ if (ark_standalone_build) { with_ecmascript = true use_pbqp = true } else { - ark_root = "//ark/runtime_core" - ark_third_party_root = "//third_party" + if (!defined(ark_flag)) { + ark_root = "//ark/runtime_core" + ark_third_party_root = "//third_party" + } else { + ark_root = "//runtime_core" + ark_third_party_root = "//build/core/third_party" + } with_ecmascript = false use_pbqp = false } diff --git a/assembler/BUILD.gn b/assembler/BUILD.gn index d9e3073566aeabf8fdde2a7b09c8437a9f51a683..4fd26893f38146fc69f33c538ed5425130cb1eff 100644 --- a/assembler/BUILD.gn +++ b/assembler/BUILD.gn @@ -11,8 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} config("arkassembler_public_config") { include_dirs = [ @@ -47,10 +52,10 @@ libarkassembler_configs = [ "$ark_root/libpandafile:arkfile_public_config", ] -ohos_shared_library("libarkassembler") { +source_set("libarkassembler_static") { sources = libarkassembler_sources - configs = libarkassembler_configs + public_configs = libarkassembler_configs deps = [ ":ark_asm_ecmascript_meta_gen_h", @@ -65,18 +70,12 @@ ohos_shared_library("libarkassembler") { "$ark_root/libpandafile:libarkfile", sdk_libc_secshared_dep, ] - if (!is_standard_system) { - relative_install_dir = "ark" - } - output_extension = "so" - subsystem_name = "ark" - part_name = "ark" } -ohos_static_library("libarkassembler_frontend_static") { +source_set("libarkassembler_frontend_set_static") { sources = libarkassembler_sources - configs = libarkassembler_configs + public_configs = libarkassembler_configs deps = [ ":ark_asm_ecmascript_meta_gen_h", @@ -91,17 +90,14 @@ ohos_static_library("libarkassembler_frontend_static") { "$ark_root/libpandafile:libarkfile_frontend_static", sdk_libc_secshared_dep, ] - - subsystem_name = "ark" - part_name = "ark" } -ohos_executable("ark_asm") { +source_set("ark_asm_static") { sources = [ "pandasm.cpp" ] include_dirs = [ "$target_gen_dir" ] - configs = [ + public_configs = [ sdk_libc_secshared_config, ":arkassembler_public_config", "$ark_root:ark_config", @@ -119,9 +115,53 @@ ohos_executable("ark_asm") { if (!is_mac && !is_mingw && !ark_standalone_build) { ldflags = [ "-static-libstdc++" ] } +} + +if (!defined(ark_flag)) { + ohos_shared_library("libarkassembler") { + deps = [ ":libarkassembler_static" ] + if (!is_standard_system) { + relative_install_dir = "ark" + } + output_extension = "so" + subsystem_name = "ark" + part_name = "ark" + } + + ohos_static_library("libarkassembler_frontend_static") { + deps = [ ":libarkassembler_frontend_set_static" ] + + subsystem_name = "ark" + part_name = "ark" + } + + ohos_executable("ark_asm") { + deps = [ ":ark_asm_static" ] + + install_enable = true + subsystem_name = "ark" + } +} else { + ark_shared_library("libarkassembler") { + deps = [ ":libarkassembler_static" ] + output_extension = "so" + } + + ark_static_library("libarkassembler_frontend_static") { + deps = [ ":libarkassembler_frontend_set_static" ] + } - install_enable = true - subsystem_name = "ark" + ark_executable("ark_asm") { + deps = [ ":ark_asm_static" ] + ldflags = [ + "-shared", + "-ldl", + "-lm", + ] + if (!is_mac && !is_mingw && !ark_standalone_build) { + ldflags += [ "-static-libstdc++" ] + } + } } ark_isa_gen("isa_gen_libarkassembler") { diff --git a/dprof/BUILD.gn b/dprof/BUILD.gn index eadf956e4432934da9c63609cbabac0c649d3930..acdde0c1207e11328255a617d00ce5945b2116f5 100644 --- a/dprof/BUILD.gn +++ b/dprof/BUILD.gn @@ -11,8 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} config("libdprof_config") { include_dirs = [ @@ -22,14 +27,14 @@ config("libdprof_config") { ] } -ohos_static_library("libdprof") { +source_set("libdprof_static") { sources = [ "libdprof/dprof/ipc/ipc_message.cpp", "libdprof/dprof/ipc/ipc_unix_socket.cpp", "libdprof/dprof/profiling_data.cpp", ] - configs = [ + public_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", sdk_libc_secshared_config, @@ -37,7 +42,17 @@ ohos_static_library("libdprof") { ] deps = [ "$ark_root/libpandabase:libarkbase" ] +} + +if (!defined(ark_flag)) { + ohos_static_library("libdprof") { + deps = [ ":libdprof_static" ] - subsystem_name = "ark" - part_name = "ark" + subsystem_name = "ark" + part_name = "ark" + } +} else { + ark_static_library("libdprof") { + deps = [ ":libdprof_static" ] + } } diff --git a/isa/BUILD.gn b/isa/BUILD.gn index 85eeac7e9a2e0db82923ecb18a2beab567dade48..a5fd1f06e547a715cb80f07271e9092e10188824 100644 --- a/isa/BUILD.gn +++ b/isa/BUILD.gn @@ -11,7 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") +if (defined(ark_flag)) { + import("//runtime_core/ark_config.gni") +} else { + import("//ark/runtime_core/ark_config.gni") +} action("isa_combine") { script = "$ark_root/isa/combine.rb" diff --git a/libpandabase/BUILD.gn b/libpandabase/BUILD.gn index f8883664b9ac58d8bd59c35f7353ea236ec4b1b0..205e7f5aafdeb19d5f628af9b06c4a91a30576c9 100644 --- a/libpandabase/BUILD.gn +++ b/libpandabase/BUILD.gn @@ -11,8 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} config("arkbase_public_config") { include_dirs = [ @@ -122,28 +127,48 @@ libarkbase_deps = [ sdk_libc_secshared_dep, ] -ohos_shared_library("libarkbase") { - sources = libarkbase_sources +if (!defined(ark_flag)) { + ohos_shared_library("libarkbase") { + sources = libarkbase_sources - configs = libarkbase_configs + configs = libarkbase_configs - deps = libarkbase_deps + deps = libarkbase_deps - output_extension = "so" - if (!is_standard_system) { - relative_install_dir = "ark" + output_extension = "so" + if (!is_standard_system) { + relative_install_dir = "ark" + } + subsystem_name = "ark" + part_name = "ark" } - subsystem_name = "ark" - part_name = "ark" -} -ohos_static_library("libarkbase_frontend_static") { - sources = libarkbase_sources + ohos_static_library("libarkbase_frontend_static") { + sources = libarkbase_sources + + configs = libarkbase_configs - configs = libarkbase_configs + deps = libarkbase_deps + + subsystem_name = "ark" + part_name = "ark" + } +} else { + ark_shared_library("libarkbase") { + sources = libarkbase_sources - deps = libarkbase_deps + configs = libarkbase_configs - subsystem_name = "ark" - part_name = "ark" + deps = libarkbase_deps + + output_extension = "so" + } + + ark_static_library("libarkbase_frontend_static") { + sources = libarkbase_sources + + configs = libarkbase_configs + + deps = libarkbase_deps + } } diff --git a/libpandafile/BUILD.gn b/libpandafile/BUILD.gn index 7668c90834e005d3d3590ecfce34bbc31841fa14..15ce6edee06c5e9d1cb104cd8f4f4a867673cf52 100644 --- a/libpandafile/BUILD.gn +++ b/libpandafile/BUILD.gn @@ -11,8 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} config("arkfile_public_config") { include_dirs = [ @@ -24,8 +29,8 @@ config("arkfile_public_config") { if (!ark_standalone_build) { include_dirs += [ - "//third_party/zlib", - "//third_party/zlib/contrib/minizip", + "$ark_third_party_root/zlib", + "$ark_third_party_root/zlib/contrib/minizip", ] } else { include_dirs += [ "$ark_third_party_root/miniz" ] @@ -57,10 +62,10 @@ libarkfile_configs = [ ":arkfile_public_config", ] -ohos_shared_library("libarkfile") { +source_set("libarkfile_static") { sources = libarkfile_sources - configs = libarkfile_configs + public_configs = libarkfile_configs deps = [ ":isa_gen_libarkfile_bytecode_emitter_def_gen_h", @@ -74,19 +79,12 @@ ohos_shared_library("libarkfile") { "$ark_root/libziparchive:libarkziparchive", sdk_libc_secshared_dep, ] - - if (!is_standard_system) { - relative_install_dir = "ark" - } - output_extension = "so" - subsystem_name = "ark" - part_name = "ark" } -ohos_static_library("libarkfile_frontend_static") { +source_set("libarkfile_frontend_set_static") { sources = libarkfile_sources - configs = libarkfile_configs + public_configs = libarkfile_configs deps = [ ":isa_gen_libarkfile_bytecode_emitter_def_gen_h", @@ -100,9 +98,35 @@ ohos_static_library("libarkfile_frontend_static") { "$ark_root/libziparchive:libarkziparchive_frontend_static", sdk_libc_secshared_dep, ] +} + +if (!defined(ark_flag)) { + ohos_shared_library("libarkfile") { + deps = [ ":libarkfile_static" ] + + if (!is_standard_system) { + relative_install_dir = "ark" + } + output_extension = "so" + subsystem_name = "ark" + part_name = "ark" + } + + ohos_static_library("libarkfile_frontend_static") { + deps = [ ":libarkfile_frontend_set_static" ] + + part_name = "ark" + subsystem_name = "ark" + } +} else { + ark_shared_library("libarkfile") { + deps = [ ":libarkfile_static" ] + output_extension = "so" + } - part_name = "ark" - subsystem_name = "ark" + ark_static_library("libarkfile_frontend_static") { + deps = [ ":libarkfile_frontend_set_static" ] + } } ark_gen_file("libarkfile_type_gen_h") { diff --git a/libziparchive/BUILD.gn b/libziparchive/BUILD.gn index c180e409530a15376b10ae54d7c5b9b716aa9ea5..423ce9885b7187bdc9bad646b0511bda955d2de9 100644 --- a/libziparchive/BUILD.gn +++ b/libziparchive/BUILD.gn @@ -11,8 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} config("arkziparchive_config") { include_dirs = [ @@ -22,18 +27,18 @@ config("arkziparchive_config") { if (!ark_standalone_build) { include_dirs += [ - "//third_party/zlib", - "//third_party/zlib/contrib/minizip", + "$ark_third_party_root/zlib", + "$ark_third_party_root/zlib/contrib/minizip", ] } else { include_dirs += [ "$ark_third_party_root/miniz" ] } } -ohos_shared_library("libarkziparchive") { +source_set("libarkziparchive_static") { sources = [ "zip_archive.cpp" ] - configs = [ + public_configs = [ ":arkziparchive_config", "$ark_root:ark_config", sdk_libc_secshared_config, @@ -45,22 +50,16 @@ ohos_shared_library("libarkziparchive") { ] if (!ark_standalone_build) { - deps += [ "//third_party/zlib:libz" ] + deps += [ "$ark_third_party_root/zlib:libz" ] } else { deps += [ "$ark_third_party_root/miniz:libminiz" ] } - if (!is_standard_system) { - relative_install_dir = "ark" - } - output_extension = "so" - subsystem_name = "ark" - part_name = "ark" } -ohos_static_library("libarkziparchive_frontend_static") { +source_set("libarkziparchive_frontend_set_static") { sources = [ "zip_archive.cpp" ] - configs = [ + public_configs = [ ":arkziparchive_config", "$ark_root:ark_config", sdk_libc_secshared_config, @@ -72,11 +71,36 @@ ohos_static_library("libarkziparchive_frontend_static") { ] if (!ark_standalone_build) { - deps += [ "//third_party/zlib:libz" ] + deps += [ "$ark_third_party_root/zlib:libz" ] } else { deps += [ "$ark_third_party_root/miniz:libminiz" ] } +} + +if (!defined(ark_flag)) { + ohos_shared_library("libarkziparchive") { + deps = [ ":libarkziparchive_static" ] + if (!is_standard_system) { + relative_install_dir = "ark" + } + output_extension = "so" + subsystem_name = "ark" + part_name = "ark" + } - subsystem_name = "ark" - part_name = "ark" + ohos_static_library("libarkziparchive_frontend_static") { + deps = [ ":libarkziparchive_frontend_set_static" ] + + subsystem_name = "ark" + part_name = "ark" + } +} else { + ark_shared_library("libarkziparchive") { + deps = [ ":libarkziparchive_static" ] + output_extension = "so" + } + + ark_static_library("libarkziparchive_frontend_static") { + deps = [ ":libarkziparchive_frontend_set_static" ] + } } diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 4f259c25a447cc52a59a52cc9107152622aedad9..4d84b8899921ab012adda3dbd3929058eaf02795 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -11,9 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/config/arm.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/config/arm.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} + import("$ark_root/verification/verification.gni") config("arkruntime_public_config") { @@ -22,9 +28,9 @@ config("arkruntime_public_config") { "$target_gen_dir", "$target_gen_dir/generated", "$target_gen_dir/include", - "//third_party/icu/icu4c/source/common", - "//third_party/icu/icu4c/source/i18n", - "//third_party/icu/icu4c/source/", + "$ark_third_party_root/icu/icu4c/source/common", + "$ark_third_party_root/icu/icu4c/source/i18n", + "$ark_third_party_root/icu/icu4c/source/", ] configs = [ "$ark_root/verification/gen:verification_public_config" ] } @@ -63,7 +69,7 @@ group("arkruntime_header_deps") { ] } -ohos_static_library("libarkruntime_static") { +source_set("libarkruntime_set_static") { sources = [ "arch/asm_support.cpp", "assert_gc_scope.cpp", @@ -214,7 +220,7 @@ ohos_static_library("libarkruntime_static") { sources += core_vm_sources sources += verifier_sources - configs = [ + public_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", @@ -263,21 +269,6 @@ ohos_static_library("libarkruntime_static") { current_cpu == "x86_64") { ldflags = [ "-latomic" ] } - - output_extension = "a" - subsystem_name = "ark" - part_name = "ark" -} - -ohos_shared_library("libarkruntime") { - deps = [ ":libarkruntime_static" ] - - output_extension = "so" - if (!is_standard_system) { - relative_install_dir = "ark" - } - subsystem_name = "ark" - part_name = "ark" } config("arkruntime_interpreter_impl_config") { @@ -290,9 +281,9 @@ config("arkruntime_interpreter_impl_config") { "$target_gen_dir", "$target_gen_dir/generated", "$target_gen_dir/include", - "//third_party/icu/icu4c/source/common", - "//third_party/icu/icu4c/source/i18n", - "//third_party/icu/icu4c/source/", + "$ark_third_party_root/icu/icu4c/source/common", + "$ark_third_party_root/icu/icu4c/source/i18n", + "$ark_third_party_root/icu/icu4c/source/", ] cflags_cc = [ @@ -316,10 +307,10 @@ config("arkruntime_interpreter_impl_config") { } } -ohos_static_library("arkruntime_interpreter_impl") { +source_set("arkruntime_interpreter_impl_static") { sources = [ "interpreter/interpreter_impl.cpp" ] - configs = [ + public_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", @@ -333,9 +324,50 @@ ohos_static_library("arkruntime_interpreter_impl") { "$ark_root/libpandabase:libarkbase", "$ark_root/libpandafile:libarkfile", ] +} + +if (!defined(ark_flag)) { + ohos_static_library("libarkruntime_static") { + deps = [ ":libarkruntime_set_static" ] + + output_extension = "a" + subsystem_name = "ark" + part_name = "ark" + } - subsystem_name = "ark" - part_name = "ark" + ohos_shared_library("libarkruntime") { + deps = [ ":libarkruntime_static" ] + + output_extension = "so" + if (!is_standard_system) { + relative_install_dir = "ark" + } + subsystem_name = "ark" + part_name = "ark" + } + + ohos_static_library("arkruntime_interpreter_impl") { + deps = [ ":arkruntime_interpreter_impl_static" ] + + subsystem_name = "ark" + part_name = "ark" + } +} else { + ark_static_library("libarkruntime_static") { + deps = [ ":libarkruntime_set_static" ] + + output_extension = "a" + } + + ark_shared_library("libarkruntime") { + deps = [ ":libarkruntime_static" ] + + output_extension = "so" + } + + ark_static_library("arkruntime_interpreter_impl") { + deps = [ ":arkruntime_interpreter_impl_static" ] + } } template("gen_intrinsics_yaml") { @@ -387,15 +419,28 @@ ark_isa_gen("isa_gen_libarkruntime") { isa = "$root_gen_dir/isa/isa.yaml" isa_api = "$ark_root/isa/isapi.rb" bridge_dispatch_template = "templates/bridge_dispatch.S.erb" -bridge_archs = [ - "aarch64", - "arm", - "armhf", - "amd64", - "x86", - "x86_64", - "x64", -] +if (!defined(ark_flag)) { + bridge_archs = [ + "aarch64", + "arm", + "armhf", + "amd64", + "x86", + "x86_64", + "x64", + ] +} else { + bridge_archs = [ + "aarch64", + "arm", + "armhf", + "amd64", + + #"x86", + "x86_64", + "x64", + ] +} foreach(arch, bridge_archs) { ark_gen_file("bridge_dispatch_${arch}") { data_file = isa diff --git a/runtime/asm_defines/BUILD.gn b/runtime/asm_defines/BUILD.gn index bc2d3b2f062171fd7a287291a3007fac53e94f3a..e38276e5c060deaf63307539f45369fe9379e18c 100644 --- a/runtime/asm_defines/BUILD.gn +++ b/runtime/asm_defines/BUILD.gn @@ -11,38 +11,70 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} -config("asmdefines_public_config") { - include_dirs = [ "$target_gen_dir/generated/" ] +if (!defined(ark_flag)) { + ohos_static_library("asm_defines") { + sources = [ "defines.cpp" ] + configs = [ + "$ark_root:ark_config", + "$ark_root/runtime:arkruntime_public_config", + "$ark_root/libpandabase:arkbase_public_config", + sdk_libc_secshared_config, + "$ark_root/libpandafile:arkfile_public_config", + ] + cflags_cc = [ + "-Wno-invalid-offsetof", + "-S", + ] + output_dir = "$target_gen_dir/generated" + output_extension = "S" + output_name = "libasm_defines" + deps = [ + "$ark_root/libpandafile:libarkfile", + "$ark_root/runtime:arkruntime_gen_intrinsics_intrinsics_gen_h", + "$ark_root/runtime:arkruntime_gen_intrinsics_intrinsics_h", + "$ark_root/runtime:arkruntime_gen_intrinsics_unimplemented_intrinsics-inl_cpp", + sdk_libc_secshared_dep, + ] + subsystem_name = "ark" + part_name = "ark" + } +} else { + ark_static_library("asm_defines") { + sources = [ "defines.cpp" ] + configs = [ + "$ark_root:ark_config", + "$ark_root/runtime:arkruntime_public_config", + "$ark_root/libpandabase:arkbase_public_config", + sdk_libc_secshared_config, + "$ark_root/libpandafile:arkfile_public_config", + ] + cflags_cc = [ + "-Wno-invalid-offsetof", + "-S", + ] + output_dir = "$target_gen_dir/generated" + output_extension = "S" + output_name = "libasm_defines" + deps = [ + "$ark_root/libpandafile:libarkfile", + "$ark_root/runtime:arkruntime_gen_intrinsics_intrinsics_gen_h", + "$ark_root/runtime:arkruntime_gen_intrinsics_intrinsics_h", + "$ark_root/runtime:arkruntime_gen_intrinsics_unimplemented_intrinsics-inl_cpp", + sdk_libc_secshared_dep, + ] + } } -ohos_static_library("asm_defines") { - sources = [ "defines.cpp" ] - configs = [ - "$ark_root:ark_config", - "$ark_root/runtime:arkruntime_public_config", - "$ark_root/libpandabase:arkbase_public_config", - sdk_libc_secshared_config, - "$ark_root/libpandafile:arkfile_public_config", - ] - cflags_cc = [ - "-Wno-invalid-offsetof", - "-S", - ] - output_dir = "$target_gen_dir/generated" - output_extension = "S" - output_name = "libasm_defines" - deps = [ - "$ark_root/libpandafile:libarkfile", - "$ark_root/runtime:arkruntime_gen_intrinsics_intrinsics_gen_h", - "$ark_root/runtime:arkruntime_gen_intrinsics_intrinsics_h", - "$ark_root/runtime:arkruntime_gen_intrinsics_unimplemented_intrinsics-inl_cpp", - sdk_libc_secshared_dep, - ] - subsystem_name = "ark" - part_name = "ark" +config("asmdefines_public_config") { + include_dirs = [ "$target_gen_dir/generated/" ] } action("asm_defines_generator") { diff --git a/runtime/templates/bridge_helpers_x64.rb b/runtime/templates/bridge_helpers_x64.rb new file mode 100755 index 0000000000000000000000000000000000000000..166d414de56ab269aeb4cabb4be6bd8581b540c3 --- /dev/null +++ b/runtime/templates/bridge_helpers_x64.rb @@ -0,0 +1,25 @@ +# 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. + +def cmp_opcode(imm) + return "cmpl $#{imm}, %ecx" +end + +def jump_eq(target) + return "je #{target}" +end + +def handler_path(name) + return "bridge/arch/amd64/handle_#{name}_amd64.S" +end + diff --git a/runtime/templates/bridge_helpers_x86_64.rb b/runtime/templates/bridge_helpers_x86_64.rb new file mode 100755 index 0000000000000000000000000000000000000000..166d414de56ab269aeb4cabb4be6bd8581b540c3 --- /dev/null +++ b/runtime/templates/bridge_helpers_x86_64.rb @@ -0,0 +1,25 @@ +# 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. + +def cmp_opcode(imm) + return "cmpl $#{imm}, %ecx" +end + +def jump_eq(target) + return "je #{target}" +end + +def handler_path(name) + return "bridge/arch/amd64/handle_#{name}_amd64.S" +end + diff --git a/verification/gen/BUILD.gn b/verification/gen/BUILD.gn index 1459ccd4b3bdc809bde5a8e5534eb5aefeae5323..3bc1cefb0ddc8a431d163378bed706dd717ceb79 100644 --- a/verification/gen/BUILD.gn +++ b/verification/gen/BUILD.gn @@ -11,8 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (defined(ark_flag)) { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} else { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} config("verification_public_config") { include_dirs = [ diff --git a/verification/verification.gni b/verification/verification.gni index 74dabcad7552f325a0a6cc90a2db1c24501469f1..557ccdfa3f067df6f3ad6d46a24a52b65fc54ba9 100644 --- a/verification/verification.gni +++ b/verification/verification.gni @@ -11,7 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") +if (defined(ark_flag)) { + import("//runtime_core/ark_config.gni") +} else { + import("//ark/runtime_core/ark_config.gni") +} type_sources = [ "$ark_root/verification/type/type_param.cpp",