diff --git a/BUILD.gn b/BUILD.gn index 7e6db5b7ac9e5f31c31770b730ef3c7fcf3d7889..a132e9736d5e890e735050d84a23acfc5567a8b0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,46 +11,54 @@ # 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_independent_build)) { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.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)", + "$ark_root/libpandabase:libarkbase(//build/toolchain/mac:clang_x64)", + "$ark_root/libpandafile:libarkfile(//build/toolchain/mac:clang_x64)", + "$ark_root/libziparchive:libarkziparchive(//build/toolchain/mac:clang_x64)", + ] + } } } diff --git a/ark_config.gni b/ark_config.gni index 92618d5fcbba7f6d3cfd5c81465d4ffea74bc7ca..38968f6a0fd82ab835818dfafa830ad316962a3e 100644 --- a/ark_config.gni +++ b/ark_config.gni @@ -15,13 +15,24 @@ if (!defined(ark_standalone_build)) { ark_standalone_build = false } +if (defined(ark_independent_build)) { + third_party_gn_path = "$build_root/third_party_gn" + third_party_path = "//third_party" +} else { + third_party_gn_path = "//third_party" +} + if (ark_standalone_build) { ark_root = "//" ark_third_party_root = "//ark-third-party" with_ecmascript = true use_pbqp = true } else { - ark_root = "//ark/runtime_core" + if (defined(ark_independent_build)) { + ark_root = "//runtime_core" + } else { + ark_root = "//ark/runtime_core" + } ark_third_party_root = "//third_party" with_ecmascript = false use_pbqp = false @@ -40,13 +51,13 @@ if (ark_standalone_build) { } } else { sdk_libc_secshared_dep = - "$ark_third_party_root/bounds_checking_function:libsec_shared" + "$third_party_gn_path/bounds_checking_function:libsec_shared" sdk_libc_secshared_config = - "$ark_third_party_root/bounds_checking_function:libsec_public_config" + "$third_party_gn_path/bounds_checking_function:libsec_public_config" if (is_mingw || is_mac || is_linux) { sdk_libc_secshared_dep = - "$ark_third_party_root/bounds_checking_function:libsec_static" + "$third_party_gn_path/bounds_checking_function:libsec_static" } } diff --git a/assembler/BUILD.gn b/assembler/BUILD.gn index 6f111ef95fde98a26c51eccb1ce20342552b68c0..eecd8abefa7e0e6cfa9503cb5d26f96bfea700bf 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_independent_build)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} config("arkassembler_public_config") { include_dirs = [ @@ -67,19 +72,6 @@ source_set("libarkassembler_static") { ] } -ohos_shared_library("libarkassembler") { - deps = [ ":libarkassembler_static" ] - if (!is_standard_system) { - relative_install_dir = "ark" - } - output_extension = "so" - if (is_mingw) { - output_extension = "dll" - } - subsystem_name = "ark" - part_name = "ark" -} - source_set("libarkassembler_frontend_set_static") { sources = libarkassembler_sources @@ -100,13 +92,6 @@ source_set("libarkassembler_frontend_set_static") { ] } -ohos_static_library("libarkassembler_frontend_static") { - deps = [ ":libarkassembler_frontend_set_static" ] - - subsystem_name = "ark" - part_name = "ark" -} - source_set("ark_asm_static") { sources = [ "pandasm.cpp" ] @@ -132,11 +117,52 @@ source_set("ark_asm_static") { } } -ohos_executable("ark_asm") { - deps = [ ":ark_asm_static" ] +if (!defined(ark_independent_build)) { + ohos_shared_library("libarkassembler") { + deps = [ ":libarkassembler_static" ] + if (!is_standard_system) { + relative_install_dir = "ark" + } + output_extension = "so" + if (is_mingw) { + output_extension = "dll" + } + subsystem_name = "ark" + part_name = "ark" + } + + ohos_static_library("libarkassembler_frontend_static") { + deps = [ ":libarkassembler_frontend_set_static" ] - install_enable = true - subsystem_name = "ark" + 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" ] + } + + ark_executable("ark_asm") { + deps = [ ":ark_asm_static" ] + ldflags = [ + "-shared", + "-ldl", + "-lm", + ] + } } ark_isa_gen("isa_gen_libarkassembler") { diff --git a/dprof/BUILD.gn b/dprof/BUILD.gn index 41d8695f92fd36ee02ed5d4ceda90ea97c8bc68a..a00038fe75b478aeed9f847d32e6d0f0b7d04eee 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_independent_build)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} config("libdprof_config") { include_dirs = [ @@ -39,9 +44,15 @@ source_set("libdprof_static") { deps = [ "$ark_root/libpandabase:libarkbase" ] } -ohos_static_library("libdprof") { - deps = [ ":libdprof_static" ] +if (!defined(ark_independent_build)) { + 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..6c91dc7c9e5dc9bb321bc479bde6af5534b63fb6 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_independent_build)) { + 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 60f12726a913e1e954612456bc6db2e5caa38e4c..5002723ccbf3a3f02e25b7417bd18e595a57d3ac 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_independent_build)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} config("arkbase_public_config") { include_dirs = [ @@ -145,23 +150,34 @@ source_set("libarkbase_frontend_set_static") { deps = libarkbase_deps } -ohos_shared_library("libarkbase") { - deps = [ ":libarkbase_static" ] - - output_extension = "so" - if (is_mingw) { - output_extension = "dll" +if (!defined(ark_independent_build)) { + ohos_shared_library("libarkbase") { + deps = [ ":libarkbase_static" ] + + if (!is_mingw && !is_mac) { + output_extension = "so" + } + if (!is_standard_system) { + relative_install_dir = "ark" + } + subsystem_name = "ark" + part_name = "ark" } - if (!is_standard_system) { - relative_install_dir = "ark" + + ohos_static_library("libarkbase_frontend_static") { + deps = [ ":libarkbase_frontend_set_static" ] + + subsystem_name = "ark" + part_name = "ark" } - subsystem_name = "ark" - part_name = "ark" -} +} else { + ark_shared_library("libarkbase") { + deps = [ ":libarkbase_static" ] -ohos_static_library("libarkbase_frontend_static") { - deps = [ ":libarkbase_frontend_set_static" ] + output_extension = "so" + } - subsystem_name = "ark" - part_name = "ark" + ark_static_library("libarkbase_frontend_static") { + deps = [ ":libarkbase_frontend_set_static" ] + } } diff --git a/libpandafile/BUILD.gn b/libpandafile/BUILD.gn index b703cca4a8f82fceed299b163bcd245ce1899c69..6d8cc6ac6606fb4c6fcd0417bc217da13e167513 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_independent_build)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} config("arkfile_public_config") { include_dirs = [ @@ -76,20 +81,6 @@ source_set("libarkfile_static") { ] } -ohos_shared_library("libarkfile") { - deps = [ ":libarkfile_static" ] - - if (!is_standard_system) { - relative_install_dir = "ark" - } - output_extension = "so" - if (is_mingw) { - output_extension = "dll" - } - subsystem_name = "ark" - part_name = "ark" -} - source_set("libarkfile_frontend_set_static") { sources = libarkfile_sources @@ -109,11 +100,35 @@ source_set("libarkfile_frontend_set_static") { ] } -ohos_static_library("libarkfile_frontend_static") { - deps = [ ":libarkfile_frontend_set_static" ] +if (!defined(ark_independent_build)) { + ohos_shared_library("libarkfile") { + deps = [ ":libarkfile_static" ] + + if (!is_standard_system) { + relative_install_dir = "ark" + } + if (!is_mingw && !is_mac) { + 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 01c048aa293f97a20a8e8d7d4e135001f820f75e..19af2fd0a22c25adffe7bd9fb0ad13acb7b688d6 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_independent_build)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} config("arkziparchive_config") { include_dirs = [ @@ -45,26 +50,12 @@ source_set("libarkziparchive_static") { ] if (!ark_standalone_build) { - deps += [ "//third_party/zlib:libz" ] + deps += [ "$third_party_gn_path/zlib:libz" ] } else { deps += [ "$ark_third_party_root/miniz:libminiz" ] } } -ohos_shared_library("libarkziparchive") { - deps = [ ":libarkziparchive_static" ] - - if (!is_standard_system) { - relative_install_dir = "ark" - } - output_extension = "so" - if (is_mingw) { - output_extension = "dll" - } - subsystem_name = "ark" - part_name = "ark" -} - source_set("libarkziparchive_frontend_set_static") { sources = [ "zip_archive.cpp" ] @@ -80,15 +71,39 @@ source_set("libarkziparchive_frontend_set_static") { ] if (!ark_standalone_build) { - deps += [ "//third_party/zlib:libz" ] + deps += [ "$third_party_gn_path/zlib:libz" ] } else { deps += [ "$ark_third_party_root/miniz:libminiz" ] } } -ohos_static_library("libarkziparchive_frontend_static") { - deps = [ ":libarkziparchive_frontend_set_static" ] +if (!defined(ark_independent_build)) { + ohos_shared_library("libarkziparchive") { + deps = [ ":libarkziparchive_static" ] - subsystem_name = "ark" - part_name = "ark" + if (!is_standard_system) { + relative_install_dir = "ark" + } + if (!is_mingw && !is_mac) { + output_extension = "so" + } + 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 c8a381299030f3478d0f099bbc6e0736dc178dc9..e94160d8550afcf16f759387eaa42663a44ecbd0 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_independent_build)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/config/arm.gni") + import("//build/ohos.gni") +} else { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} + import("$ark_root/verification/verification.gni") config("arkruntime_public_config") { @@ -271,25 +277,6 @@ source_set("libarkruntime_set_static") { } } -ohos_static_library("libarkruntime_static") { - deps = [ ":libarkruntime_set_static" ] - - 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") { include_dirs = [ "$ark_root/compiler", @@ -345,11 +332,48 @@ source_set("arkruntime_interpreter_impl_static") { ] } -ohos_static_library("arkruntime_interpreter_impl") { - deps = [ ":arkruntime_interpreter_impl_static" ] +if (!defined(ark_independent_build)) { + ohos_static_library("libarkruntime_static") { + deps = [ ":libarkruntime_set_static" ] + + output_extension = "a" + subsystem_name = "ark" + part_name = "ark" + } + + ohos_shared_library("libarkruntime") { + deps = [ ":libarkruntime_static" ] - subsystem_name = "ark" - part_name = "ark" + 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") { @@ -406,10 +430,12 @@ bridge_archs = [ "arm", "armhf", "amd64", - "x86", "x86_64", "x64", ] +if (!defined(ark_independent_build)) { + bridge_archs += [ "x86" ] +} 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..22396c3165bb70d8edc4e4248cbe61576978bc17 100644 --- a/runtime/asm_defines/BUILD.gn +++ b/runtime/asm_defines/BUILD.gn @@ -11,38 +11,43 @@ # 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_independent_build)) { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.gni") +} else { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") -config("asmdefines_public_config") { - include_dirs = [ "$target_gen_dir/generated/" ] + 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" + } } -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") { @@ -52,5 +57,9 @@ action("asm_defines_generator") { rebase_path("$target_gen_dir/generated/libasm_defines.S", root_build_dir), rebase_path(outputs[0]), ] - deps = [ ":asm_defines" ] + if (!defined(ark_independent_build)) { + deps = [ ":asm_defines" ] + } else { + deps = [ "$root_core_gn:asm_defines" ] + } } 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..ecfdbe74c4fc1e5b46cdd3cc7ad628e9e88c648e 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_independent_build)) { + import("//runtime_core/ark_config.gni") + import("$build_root/ark.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..1e4e202328cf4875019cf3219959c49fe7bc5d9a 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_independent_build)) { + import("//runtime_core/ark_config.gni") +} else { + import("//ark/runtime_core/ark_config.gni") +} type_sources = [ "$ark_root/verification/type/type_param.cpp",