From 0b0d163074d7fd22b7bdf6ef120782e5b889abab Mon Sep 17 00:00:00 2001 From: ZhenyuPan Date: Wed, 22 Feb 2023 15:12:25 +0800 Subject: [PATCH] fixed 7ffcc8f from https://gitee.com/panzhenyu1/arkcompiler_toolchain/pulls/171 Fix load library error on iOS platform Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I6GY3J Signed-off-by: ZhenyuPan Change-Id: I0c32397ed47af1cff30161a6c52483d67ad38ebf --- build/third_party_gn/googletest/BUILD.gn | 8 -------- build/third_party_gn/openssl/BUILD.gn | 4 ---- toolchain.gni | 12 +++++++++--- tooling/BUILD.gn | 7 ++----- websocket/BUILD.gn | 10 ++++++---- websocket/test/BUILD.gn | 7 ++++++- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/build/third_party_gn/googletest/BUILD.gn b/build/third_party_gn/googletest/BUILD.gn index 58262ef4..17f39784 100644 --- a/build/third_party_gn/googletest/BUILD.gn +++ b/build/third_party_gn/googletest/BUILD.gn @@ -77,16 +77,12 @@ static_library("gtest") { sources -= [ "$googletest_dir/src/gtest-all.cc" ] public_configs = [ ":gtest_config" ] configs += [ ":gtest_private_config" ] - - # configs -= [ "//build/config/coverage:default_coverage" ] } static_library("gtest_main") { testonly = true sources = [ "$googletest_dir/src/gtest_main.cc" ] public_deps = [ ":gtest" ] - - # configs -= [ "//build/config/coverage:default_coverage" ] } config("gmock_private_config") { @@ -135,8 +131,6 @@ static_library("gmock") { sources -= [ "googlemock/src/gmock-all.cc" ] public_configs = [ ":gmock_config" ] configs += [ ":gmock_private_config" ] - - # configs -= [ "//build/config/coverage:default_coverage" ] deps = [ ":gtest" ] } @@ -147,6 +141,4 @@ static_library("gmock_main") { ":gmock", ":gtest", ] - - # configs -= [ "//build/config/coverage:default_coverage" ] } diff --git a/build/third_party_gn/openssl/BUILD.gn b/build/third_party_gn/openssl/BUILD.gn index f6f07233..58819271 100644 --- a/build/third_party_gn/openssl/BUILD.gn +++ b/build/third_party_gn/openssl/BUILD.gn @@ -914,7 +914,6 @@ ohos_source_set("crypto_source") { public_configs = [ ":crypto_config_public" ] - # remove_configs = [ "//build/config/coverage:default_coverage" ] subsystem_name = "security" part_name = "huks" } @@ -924,7 +923,6 @@ ohos_static_library("libcrypto_static") { public_configs = [ ":crypto_config_public" ] complete_static_lib = true - # remove_configs = [ "//build/config/coverage:default_coverage" ] subsystem_name = "security" part_name = "huks" } @@ -938,7 +936,6 @@ if (is_mingw || is_mac) { deps = [ ":crypto_source" ] public_configs = [ ":crypto_config_public" ] - # remove_configs = [ "//build/config/coverage:default_coverage" ] install_images = [ "system", "updater", @@ -953,7 +950,6 @@ ohos_shared_library("libcrypto_shared") { output_name = "libcrypto_openssl" public_configs = [ ":crypto_config_public" ] - # remove_configs = [ "//build/config/coverage:default_coverage" ] install_images = [ "system", "updater", diff --git a/toolchain.gni b/toolchain.gni index 0b93d331..2d5ca401 100644 --- a/toolchain.gni +++ b/toolchain.gni @@ -27,8 +27,14 @@ if (!ark_standalone_build) { ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn" import("$build_root/ark.gni") } - -sdk_libc_secshared_dep = - "$ark_third_party_root/bounds_checking_function:libsec_shared" +is_cross_platform_build = + defined(build_cross_platform_version) && build_cross_platform_version +if (is_cross_platform_build && target_os == "ios") { + sdk_libc_secshared_dep = + "$ark_third_party_root/bounds_checking_function:libsec_static" +} else { + sdk_libc_secshared_dep = + "$ark_third_party_root/bounds_checking_function:libsec_shared" +} sdk_libc_secshared_config = "$ark_third_party_root/bounds_checking_function:libsec_public_config" diff --git a/tooling/BUILD.gn b/tooling/BUILD.gn index ed8b0d04..302dba88 100644 --- a/tooling/BUILD.gn +++ b/tooling/BUILD.gn @@ -13,9 +13,6 @@ import("//arkcompiler/ets_runtime/js_runtime_config.gni") -is_cross_platform_build = - defined(build_cross_platform_version) && build_cross_platform_version - config("ark_ecma_debugger_config") { configs = [ "//arkcompiler/ets_runtime:ark_jsruntime_common_config", @@ -63,7 +60,7 @@ source_set("libark_ecma_debugger_set") { deps = [ "$ark_root/libpandafile:arkfile_header_deps" ] - if (is_cross_platform_build) { + if (is_cross_platform_build && target_os == "ios") { deps += [ "$ark_third_party_root/cJSON:cjson_static" ] } else { deps += [ "$ark_third_party_root/cJSON:cjson" ] @@ -143,7 +140,7 @@ source_set("libark_ecma_debugger_test_set") { deps = [ "$ark_root/libpandafile:arkfile_header_deps" ] - if (is_cross_platform_build) { + if (is_cross_platform_build && target_os == "ios") { deps += [ "$ark_third_party_root/cJSON:cjson_static" ] } else { deps += [ "$ark_third_party_root/cJSON:cjson" ] diff --git a/websocket/BUILD.gn b/websocket/BUILD.gn index 86b7a37a..2c09a11f 100644 --- a/websocket/BUILD.gn +++ b/websocket/BUILD.gn @@ -105,10 +105,12 @@ ohos_source_set("websocket") { sources = [ "websocket.cpp" ] - deps += [ - "$ark_third_party_root/openssl:libcrypto_shared", - sdk_libc_secshared_dep, - ] + deps += [ sdk_libc_secshared_dep ] + if (is_cross_platform_build && target_os == "ios") { + deps += [ "$ark_third_party_root/openssl:libcrypto_static" ] + } else { + deps += [ "$ark_third_party_root/openssl:libcrypto_shared" ] + } configs += [ ":websocket_config", diff --git a/websocket/test/BUILD.gn b/websocket/test/BUILD.gn index 5a196494..47924810 100644 --- a/websocket/test/BUILD.gn +++ b/websocket/test/BUILD.gn @@ -39,10 +39,15 @@ host_unittest_action("WebSocketTest") { ] deps = [ - "$ark_third_party_root/openssl:libcrypto_shared", "$toolchain_root/websocket:websocket", sdk_libc_secshared_dep, ] + + if (is_cross_platform_build && target_os == "ios") { + deps += [ "$ark_third_party_root/openssl:libcrypto_static" ] + } else { + deps += [ "$ark_third_party_root/openssl:libcrypto_shared" ] + } } group("unittest") { -- Gitee