Fix standalone build fail

Fix ark cli error

Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/I869QD

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Ife2e025f01a046f215fbedd0e70781916e6bd411
This commit is contained in:
wengchangcheng 2023-10-08 19:58:49 +08:00
parent 5e2a93f734
commit ec3521274f
30 changed files with 122 additions and 288 deletions

View File

@ -13,7 +13,66 @@
import("//arkcompiler/toolchain/toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
}
config("ark_platform_config") {
configs = [ ":hiviewdfx_config" ]
defines = []
if (is_ohos) {
defines += [
"OHOS_PLATFORM",
"UNIX_PLATFORM",
]
} else if (is_mingw) {
defines += [ "WINDOWS_PLATFORM" ]
} else if (target_os == "android") {
if (!ark_standalone_build) {
defines += [
"ANDROID_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
} else if (target_os == "ios") {
defines += [
"UNIX_PLATFORM",
"IOS_PLATFORM",
]
} else if (is_mac) {
defines += [
"MAC_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
}
config("ark_toolchain_common_config") {
configs = [
":ark_platform_config",
":ark_toolchain_public_config",
":hiviewdfx_config",
]
defines = [ "PANDA_ENABLE_LTO" ]
cflags_cc = [
"-Wall",
@ -106,7 +165,7 @@ config("ark_toolchain_public_config") {
# Dependent on runtime_core include
"$ark_root",
"$js_root",
"$toolchain_root",
".",
]
}
@ -118,10 +177,7 @@ config("toolchain_test_config") {
"./websocket/test/*",
]
configs = [
"$toolchain_root:ark_toolchain_public_config",
"$toolchain_root:ark_toolchain_common_config",
]
configs = [ ":ark_toolchain_common_config" ]
ldflags = [ "-Wl,-rpath=\$ORIGIN/" ]
}
@ -130,11 +186,11 @@ group("ark_toolchain_packages") {
deps = []
if (host_os != "mac") {
deps += [
"$toolchain_root/inspector:ark_debugger",
"$toolchain_root/inspector:connectserver_debugger",
"$toolchain_root/tooling:libark_ecma_debugger",
"$toolchain_root/tooling/client:libark_client",
"$toolchain_root/tooling/client/ark_cli:arkdb",
"./inspector:ark_debugger",
"./inspector:connectserver_debugger",
"./tooling:libark_ecma_debugger",
"./tooling/client:libark_client",
"./tooling/client/ark_cli:arkdb",
]
}
}

View File

@ -78,11 +78,18 @@ group("runtime_core") {
}
group("toolchain") {
deps = []
if (target_cpu != "mipsel") {
deps = [
deps += [
"$toolchain_root/inspector:ark_debugger",
"$toolchain_root/inspector:connectserver_debugger",
"$toolchain_root/tooling:libark_ecma_debugger",
]
}
if (target_os != "mingw") {
deps += [
"$toolchain_root/tooling/client:libark_client",
"$toolchain_root/tooling/client/ark_cli:arkdb",
]
}
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include <string>
#ifdef ANDROID_PLATFORM

View File

@ -13,59 +13,6 @@
import("//arkcompiler/toolchain/toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
}
config("ark_platform_config") {
configs = [ ":hiviewdfx_config" ]
defines = []
if (is_ohos) {
defines += [
"OHOS_PLATFORM",
"UNIX_PLATFORM",
]
} else if (is_mingw) {
defines += [ "WINDOWS_PLATFORM" ]
} else if (target_os == "android") {
if (!ark_standalone_build) {
defines += [
"ANDROID_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
} else if (target_os == "ios") {
defines += [
"UNIX_PLATFORM",
"IOS_PLATFORM",
]
} else if (is_mac) {
defines += [
"MAC_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
}
ohos_source_set("ark_debugger_static") {
stack_protector_ret = false
deps = [ sdk_libc_secshared_dep ]
@ -87,9 +34,9 @@ ohos_source_set("ark_debugger_static") {
deps += [ "../websocket:websocket" ]
sources = [
"../common/log_wrapper.cpp",
"inspector.cpp",
"library_loader.cpp",
"log_wrapper.cpp",
"ws_server.cpp",
]
@ -97,7 +44,7 @@ ohos_source_set("ark_debugger_static") {
external_deps = hiviewdfx_ext_deps
deps += hiviewdfx_deps
configs += [ ":ark_platform_config" ]
configs += [ "..:ark_toolchain_common_config" ]
subsystem_name = "arkcompiler"
part_name = "toolchain"
}
@ -136,20 +83,20 @@ ohos_source_set("connectserver_debugger_static") {
deps += [ "../websocket:websocket" ]
sources = [
"../common/log_wrapper.cpp",
"connect_inspector.cpp",
"connect_server.cpp",
"log_wrapper.cpp",
]
if (target_os == "ios") {
sources -= [ "log_wrapper.cpp" ]
sources -= [ "../common/log_wrapper.cpp" ]
}
# hiviewdfx libraries
external_deps = hiviewdfx_ext_deps
deps += hiviewdfx_deps
configs += [ ":ark_platform_config" ]
configs += [ "..:ark_toolchain_common_config" ]
subsystem_name = "arkcompiler"
part_name = "toolchain"
}

View File

@ -15,7 +15,7 @@
#include "connect_inspector.h"
#include <mutex>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
namespace OHOS::ArkCompiler::Toolchain {
std::mutex g_connectMutex;

View File

@ -17,7 +17,7 @@
#include <mutex>
#include <shared_mutex>
#include <unistd.h>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
namespace OHOS::ArkCompiler::Toolchain {
std::shared_mutex g_sendMutex;

View File

@ -20,7 +20,7 @@
#include <thread>
#include <unordered_map>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "library_loader.h"
#if defined(IOS_PLATFORM)

View File

@ -15,7 +15,7 @@
#include "library_loader.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#if defined(UNIX_PLATFORM)
#include <dlfcn.h>

View File

@ -21,7 +21,7 @@
#include <sys/types.h>
#include <unistd.h>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
namespace OHOS::ArkCompiler::Toolchain {
std::shared_mutex g_mutex;

View File

@ -13,28 +13,9 @@
import("../toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
}
config("ark_ecma_debugger_config") {
configs = [
":hiviewdfx_config",
"..:ark_toolchain_common_config",
"//arkcompiler/ets_runtime:ark_jsruntime_common_config",
"//arkcompiler/ets_runtime:ark_jsruntime_public_config",
]
@ -49,6 +30,7 @@ config("ark_ecma_debugger_config") {
}
debugger_sources = [
"../common/log_wrapper.cpp",
"agent/debugger_impl.cpp",
"agent/runtime_impl.cpp",
"agent/tracing_impl.cpp",

View File

@ -13,25 +13,6 @@
import("//arkcompiler/toolchain/toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
}
ohos_source_set("libark_client_set") {
stack_protector_ret = false
defines = []
@ -64,17 +45,17 @@ ohos_source_set("libark_client_set") {
]
deps += [
"$ark_third_party_root/libuv:uv",
"$ark_third_party_root/openssl:libcrypto_shared",
"../:libark_ecma_debugger_set",
"//third_party/libuv:uv",
"..:libark_ecma_debugger_set",
sdk_libc_secshared_dep,
]
external_deps += [ "ets_runtime:libark_jsruntime" ]
configs += [ ":hiviewdfx_config" ]
configs += [ "../..:ark_toolchain_common_config" ]
cflags_cc = [ "-Wno-error=vla-extension" ]
cflags_cc = [ "-Wno-vla-extension" ]
subsystem_name = "arkcompiler"
part_name = "toolchain"

View File

@ -13,70 +13,6 @@
import("//arkcompiler/toolchain/toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
if (is_linux) {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_LINUX",
"PANDA_USE_FUTEX",
]
} else if (is_mingw) {
cflags_cc += [
"-std=c++17",
"-Wno-ignored-attributes",
]
defines += [
"PANDA_TARGET_WINDOWS",
"_CRTBLD",
"__LIBMSVCRT__",
]
} else if (is_mac) {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_MACOS",
]
} else if (target_os == "android") {
defines += [
"PANDA_TARGET_ANDROID",
"PANDA_TARGET_UNIX",
"PANDA_USE_FUTEX",
]
if (!ark_standalone_build) {
defines += [ "ENABLE_ANLOG" ]
}
} else if (target_os == "ios") {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_TARGET_IOS",
]
} else {
defines += [
"PANDA_TARGET_UNIX",
"PANDA_USE_FUTEX",
]
if (!is_standard_system && (current_cpu != "arm" || is_wearable_product)) {
defines += [ "PANDA_TARGET_MOBILE" ]
}
}
}
ohos_executable("arkdb") {
sources = [
"cli_command.cpp",
@ -96,12 +32,13 @@ ohos_executable("arkdb") {
deps = [ "../:libark_client_set" ]
external_deps = [
"ets_runtime:libark_jsruntime",
"hitrace:hitrace_meter",
]
external_deps = [ "ets_runtime:libark_jsruntime" ]
configs = [ ":hiviewdfx_config" ]
# hiviewdfx libraries
external_deps += hiviewdfx_ext_deps
deps += hiviewdfx_deps
configs = [ "../../..:ark_toolchain_common_config" ]
install_enable = false

View File

@ -23,7 +23,7 @@
#include "domain/debugger_client.h"
#include "domain/runtime_client.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "manager/breakpoint_manager.h"
#include "manager/domain_manager.h"
#include "manager/stack_manager.h"

View File

@ -23,7 +23,7 @@
#include "domain/heapprofiler_client.h"
#include "domain/profiler_client.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "manager/domain_manager.h"
#include "websocket/websocket_client.h"

View File

@ -63,7 +63,7 @@ std::vector<std::string> SplitString(const std::string &str, const std::string &
return value;
}
void ReleaseHandle(uv_async_t *handle)
void ReleaseHandle([[maybe_unused]] uv_async_t *releaseHandle)
{
uv_close(reinterpret_cast<uv_handle_t*>(g_inputSignal), [](uv_handle_t* handle) {
if (handle != nullptr) {
@ -108,7 +108,7 @@ void InputOnMessage(uv_async_t *handle)
}
}
void GetInputCommand(void *arg)
void GetInputCommand([[maybe_unused]] void *arg)
{
std::cout << ">>> ";
std::string inputStr;
@ -152,7 +152,7 @@ void SocketOnMessage(uv_async_t *handle)
}
}
void GetSocketMessage(void *arg)
void GetSocketMessage([[maybe_unused]] void *arg)
{
while (g_cliSocket.IsConnected()) {
std::string decMessage = g_cliSocket.Decode();

View File

@ -17,7 +17,7 @@
#include <map>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "manager/breakpoint_manager.h"
#include "manager/stack_manager.h"
#include "pt_json.h"

View File

@ -14,7 +14,7 @@
*/
#include "domain/heapprofiler_client.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "utils/utils.h"
#include <map>

View File

@ -15,7 +15,7 @@
#include "domain/profiler_client.h"
#include "pt_types.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "utils/utils.h"
#include <map>

View File

@ -15,7 +15,7 @@
#include "domain/runtime_client.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "manager/variable_manager.h"
#include "pt_json.h"

View File

@ -15,7 +15,7 @@
#include "manager/breakpoint_manager.h"
#include "ark_cli/cli_command.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
using PtJson = panda::ecmascript::tooling::PtJson;
using Result = panda::ecmascript::tooling::Result;

View File

@ -15,7 +15,7 @@
#include "domain_manager.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "manager/breakpoint_manager.h"
#include "pt_json.h"

View File

@ -14,7 +14,7 @@
*/
#include "manager/stack_manager.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
namespace OHOS::ArkCompiler::Toolchain {
StackManager StackManager::instance_;

View File

@ -19,7 +19,7 @@
#include <map>
#include <variant>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "pt_json.h"
#include "pt_types.h"

View File

@ -15,7 +15,9 @@
#include "manager/variable_manager.h"
#include "log_wrapper.h"
#include <iomanip>
#include "common/log_wrapper.h"
using PtJson = panda::ecmascript::tooling::PtJson;
namespace OHOS::ArkCompiler::Toolchain {

View File

@ -14,7 +14,7 @@
*/
#include "utils/utils.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include <ctime>
namespace OHOS::ArkCompiler::Toolchain {

View File

@ -19,7 +19,7 @@
#include <unistd.h>
#include <securec.h>
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "websocket_client.h"

View File

@ -13,83 +13,6 @@
import("//arkcompiler/toolchain/toolchain.gni")
config("hiviewdfx_config") {
defines = []
if (enable_dump_in_faultlog) {
defines += [ "ENABLE_DUMP_IN_FAULTLOG" ]
}
if (enable_bytrace) {
defines += [ "ENABLE_BYTRACE" ]
cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ]
}
if (enable_hitrace) {
defines += [ "ENABLE_HITRACE" ]
}
if (enable_hilog) {
defines += [ "ENABLE_HILOG" ]
}
include_dirs = [ "$hilog_root/include" ]
}
config("websocket_platform_config") {
configs = [ ":hiviewdfx_config" ]
defines = []
if (is_ohos) {
defines += [
"OHOS_PLATFORM",
"UNIX_PLATFORM",
]
} else if (is_mingw) {
defines += [ "WINDOWS_PLATFORM" ]
} else if (is_mac) {
defines += [
"MAC_PLATFORM",
"UNIX_PLATFORM",
]
} else if (target_os == "android") {
if (!ark_standalone_build) {
defines += [
"ANDROID_PLATFORM",
"UNIX_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
} else if (target_os == "ios") {
defines += [
"UNIX_PLATFORM",
"IOS_PLATFORM",
]
} else {
defines += [ "UNIX_PLATFORM" ]
}
if (current_cpu == "arm") {
defines += [
"PANDA_TARGET_ARM32_ABI_SOFT=1",
"PANDA_TARGET_ARM32",
"PANDA_TARGET_32",
]
} else if (current_cpu == "arm64") {
defines += [
"PANDA_TARGET_ARM64",
"PANDA_TARGET_64",
"PANDA_ENABLE_GLOBAL_REGISTER_VARIABLES",
"PANDA_USE_32_BIT_POINTER",
]
} else if (current_cpu == "x86") {
defines += [ "PANDA_TARGET_X86" ]
} else if (current_cpu == "amd64" || current_cpu == "x64" ||
current_cpu == "x86_64") {
defines += [
"PANDA_TARGET_64",
"PANDA_TARGET_AMD64",
"PANDA_USE_32_BIT_POINTER",
]
}
}
ohos_source_set("websocket") {
stack_protector_ret = false
defines = []
@ -127,7 +50,9 @@ ohos_source_set("websocket") {
deps += [ "$ark_third_party_root/openssl:libcrypto_shared" ]
}
configs += [ ":websocket_platform_config" ]
configs += [ "..:ark_toolchain_common_config" ]
cflags_cc = [ "-Wno-vla-extension" ]
subsystem_name = "arkcompiler"
part_name = "toolchain"

View File

@ -23,14 +23,11 @@ host_unittest_action("WebSocketTest") {
sources = [
# test file
"../../inspector/log_wrapper.cpp",
"../../common/log_wrapper.cpp",
"websocket_test.cpp",
]
configs = [
"//arkcompiler/toolchain:toolchain_test_config",
"$toolchain_root/websocket:websocket_platform_config",
]
configs = [ "$toolchain_root:toolchain_test_config" ]
deps = [
"$toolchain_root/websocket:websocket",

View File

@ -16,7 +16,7 @@
#include "websocket.h"
#include "define.h"
#include "log_wrapper.h"
#include "common/log_wrapper.h"
#include "securec.h"
namespace OHOS::ArkCompiler::Toolchain {
@ -357,7 +357,7 @@ bool WebSocket::InitTcpWebSocket(int port, uint32_t timeoutLimit)
return false;
}
sockaddr_in addr_sin = {0};
sockaddr_in addr_sin = {};
addr_sin.sin_family = AF_INET;
addr_sin.sin_port = htons(port);
addr_sin.sin_addr.s_addr = INADDR_ANY;