diff --git a/0005-feat-for-embedded-fix-ipc-compile-error.patch b/0005-feat-for-embedded-fix-ipc-compile-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..4263f36632095a16726a05f3875b3a547075b59d --- /dev/null +++ b/0005-feat-for-embedded-fix-ipc-compile-error.patch @@ -0,0 +1,25 @@ +From 418c6f30c6e8daf69cef14c1afd6924eb9634e6d Mon Sep 17 00:00:00 2001 +From: s_c_c +Date: Fri, 22 Mar 2024 11:19:48 +0800 +Subject: [PATCH] feat for embedded fix ipc compile error + +--- + ipc/native/src/mock/source/binder_invoker.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ipc/native/src/mock/source/binder_invoker.cpp b/ipc/native/src/mock/source/binder_invoker.cpp +index 946940c..75e4010 100644 +--- a/ipc/native/src/mock/source/binder_invoker.cpp ++++ b/ipc/native/src/mock/source/binder_invoker.cpp +@@ -746,7 +746,7 @@ int BinderInvoker::WaitForCompletion(MessageParcel *reply, int32_t *acquireResul + case BR_ACQUIRE_RESULT: { + int32_t result = input_.ReadInt32(); + if (acquireResult != nullptr) { +- *acquireResult = result ? ERR_NONE : ERR_INVALID_OPERATION; ++ *acquireResult = result ? (int32_t)ERR_NONE : (int32_t)ERR_INVALID_OPERATION; + continueLoop = false; + } + break; +-- +2.20.1 (Apple Git-117) + diff --git a/0006-feat-for-embedded-fix-dsoftbus-compile-errors.patch b/0006-feat-for-embedded-fix-dsoftbus-compile-errors.patch new file mode 100644 index 0000000000000000000000000000000000000000..a77b1485eb025d301a04b5d316893e7faede2372 --- /dev/null +++ b/0006-feat-for-embedded-fix-dsoftbus-compile-errors.patch @@ -0,0 +1,90 @@ +From 6954a88be47ff349b22a6a8668f84ae0d745a294 Mon Sep 17 00:00:00 2001 +From: s_c_c +Date: Fri, 22 Mar 2024 14:58:13 +0800 +Subject: [PATCH] feat for embedded fix dsoftbus compile errors + +--- + .../nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c | 2 +- + components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c | 4 ++-- + core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c | 4 ++-- + sdk/BUILD.gn | 1 + + .../trans_channel/proxy/src/client_trans_proxy_file_manager.c | 3 ++- + 5 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c b/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c +index 2c0d51f..4123ac4 100644 +--- a/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c ++++ b/components/nstackx/fillp/src/fillp_lib/src/fillp/fillp_input.c +@@ -736,7 +736,7 @@ static void MoveUnackToUnrecvByPackInfo(struct FillpPcb *pcb, FILLP_UINT32 ackSe + } + } + +-static void FillpPackInputLog(FILLP_CONST struct FillpPcb *pcb) ++__attribute__((unused)) static void FillpPackInputLog(FILLP_CONST struct FillpPcb *pcb) + { + FILLP_LOGDBG("fillp_sock_id:%d nackSend:%u,nackFailed:%u,nackRcv:%u,packSend:%u,packFailed:%u,packRcv:%u", + FILLP_GET_SOCKET(pcb)->index, pcb->statistics.debugPcb.nackSend, pcb->statistics.debugPcb.nackFailed, +diff --git a/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c b/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c +index 3496a1b..ea0a21a 100644 +--- a/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c ++++ b/components/nstackx/nstackx_ctrl/core/coap_discover/coap_app.c +@@ -40,8 +40,8 @@ + + #ifdef DFINDER_SUPPORT_MULTI_NIF + static CoapCtxType g_coapCtxArr[NSTACKX_MAX_LISTENED_NIF_NUM] = { +- {NULL, {0}, 0, NSTACKX_FALSE}, +- {NULL, {0}, 0, NSTACKX_FALSE} ++ {NULL, {{0}}, 0, NSTACKX_FALSE}, ++ {NULL, {{0}}, 0, NSTACKX_FALSE} + }; + #else + static coap_context_t *g_ctx = NULL; +diff --git a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c +index 07f88c2..cffb774 100644 +--- a/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c ++++ b/core/common/dfx/hisysevent_adapter/softbus_hisysevt_nstack.c +@@ -110,7 +110,7 @@ static int CopyEventParamVal(SoftBusEvtParamType type, void *dst, const void *sr + + static int NstackEventParaToSoftBusEventPara(SoftBusEvtParam *dst, const NstackDfxEvtParam *src) + { +- if (src->type >= SOFTBUS_EVT_PARAMTYPE_BUTT) { ++ if (src->type >= (int)SOFTBUS_EVT_PARAMTYPE_BUTT) { + LOG_ERR("softbus paramType max %d, nstack paramType %d", + SOFTBUS_EVT_PARAMTYPE_BUTT, src->type); + return SOFTBUS_ERR; +@@ -133,7 +133,7 @@ static int NstackDfxEvtToSoftBusReportMsg(SoftBusEvtReportMsg *msg, const Nstack + LOG_ERR("eventName mismatch, nstack event name %s", info->eventName); + return SOFTBUS_ERR; + } +- if (info->type >= SOFTBUS_EVT_TYPE_BUTT) { ++ if (info->type >= (int)SOFTBUS_EVT_TYPE_BUTT) { + LOG_ERR("eventType mismatch, nstack event type %d", info->type); + return SOFTBUS_ERR; + } +diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn +index 10fbe2f..7d1c5e9 100644 +--- a/sdk/BUILD.gn ++++ b/sdk/BUILD.gn +@@ -98,4 +98,5 @@ target(build_type, "softbus_client") { + part_name = "dsoftbus" + subsystem_name = "communication" + } ++ cflags += [ "-Wno-unknown-pragmas" ] + } +diff --git a/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c b/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c +index 6f63a66..b42b4ce 100644 +--- a/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c ++++ b/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager.c +@@ -1394,7 +1394,8 @@ static int32_t PutToRecvFileList(FileRecipientInfo *recipient, const SingleFileI + SoftBusCloseFile(fd); + return SOFTBUS_FILE_ERR; + } +- (void)ftruncate(fd, 0); ++ int ret = ftruncate(fd, 0); ++ (void)ret; + recipient->recvFileInfo.fileStatus = NODE_BUSY; + recipient->recvFileInfo.fileOffset = 0; + recipient->recvFileInfo.timeOut = 0; +-- +2.20.1 (Apple Git-117) + diff --git a/0007-feat-for-embedded-fix-sqlite-stringop-warning.patch b/0007-feat-for-embedded-fix-sqlite-stringop-warning.patch new file mode 100644 index 0000000000000000000000000000000000000000..25d53940e001195c72b6c58a1cd5a8f868d0a846 --- /dev/null +++ b/0007-feat-for-embedded-fix-sqlite-stringop-warning.patch @@ -0,0 +1,24 @@ +From 04af936af6889ac13426100f0d0bba5c59bd8687 Mon Sep 17 00:00:00 2001 +From: s_c_c +Date: Fri, 22 Mar 2024 11:26:29 +0800 +Subject: [PATCH] feat for embedded fix sqlite stringop warning + +--- + BUILD.gn | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/BUILD.gn b/BUILD.gn +index af76d78..4c0f65b 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -80,6 +80,7 @@ ohos_shared_library("sqlite") { + cflags_c = [ + "-fvisibility=hidden", + "-Wno-implicit-fallthrough", ++ "-Wno-error=stringop-overflow", + ] + ldflags = [ "-Wl,--exclude-libs,ALL" ] + deps = [ "//third_party/openssl:libcrypto_shared" ] +-- +2.20.1 (Apple Git-117) + diff --git a/binder.BUILD.gn b/binder.BUILD.gn index dd0da82c3b875720c49dc2642edec81734c5fa1a..0c2276fdef55425ae2e27b91a3d8ede1f31a0e48 100644 --- a/binder.BUILD.gn +++ b/binder.BUILD.gn @@ -12,11 +12,12 @@ # limitations under the License. import("//build/ohos.gni") +import("//build/config/sysroot.gni") config("libdbinder_config") { include_dirs = [ - " /usr/include/c_utils", - "/usr/include/ipc", + "${sysroot}/usr/include/c_utils", + "${sysroot}/usr/include/ipc", ] libs = [ "dbinder.z" ] } diff --git a/communication_ipc.spec b/communication_ipc.spec index e13cc75dd5f292a5decfef21a12606ed9328d277..669834a25e727ddda60ca86e873cefb7646a16e4 100644 --- a/communication_ipc.spec +++ b/communication_ipc.spec @@ -12,7 +12,7 @@ Name: communication_ipc Version: 1.0.0 -Release: 3%{?dist} +Release: 6%{?dist} Summary: Inter-process communication (IPC) and Remote Procedure Call (RPC) License: Apache-2.0 and GPL-2.0 URL: https://gitee.com/openharmony/communication_ipc @@ -38,6 +38,9 @@ Patch1: 0001-remove-dependence-on-access-token-and-hitrace.patch Patch2: 0002-fix-build-error-from-header-include.patch Patch3: 0003-Adapt-binder-as-a-kernel-module-on-kernel-6.6.0-10.patch Patch4: 0004-adapt-compilation-for-softbus_client.patch +Patch5: 0005-feat-for-embedded-fix-ipc-compile-error.patch +Patch6: 0006-feat-for-embedded-fix-dsoftbus-compile-errors.patch +Patch7: 0007-feat-for-embedded-fix-sqlite-stringop-warning.patch BuildRequires: gcc, make, hilog, kernel-devel, uname-build-checks BuildRequires: commonlibrary_c_utils @@ -68,13 +71,16 @@ cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir} mv %{communication_path}/%{name} %{communication_path}/ipc %patch -P1 -p1 -d %{communication_path}/ipc %patch -P2 -p1 -d %{communication_path}/ipc +%patch -P5 -p1 -d %{communication_path}/ipc %setup -q -D -T -a 2 -c -n %{communication_path} mv %{communication_path}/communication_dsoftbus-%{oh_version} %{communication_path}/dsoftbus %patch -P4 -p1 -d %{communication_path}/dsoftbus +%patch -P6 -p1 -d %{communication_path}/dsoftbus %setup -q -D -T -a 3 -c -n %{third_party_path} mv %{third_party_path}/third_party_sqlite-%{oh_version} %{third_party_path}/sqlite +%patch -P7 -p1 -d %{third_party_path}/sqlite %setup -q -D -T -a 4 -c -n %{third_party_path} mv %{third_party_path}/third_party_libcoap-%{oh_version} %{third_party_path}/libcoap @@ -224,6 +230,15 @@ insmod /%{ashmem_dest_path}/*.ko %endif %changelog +* Wed Apr 3 2024 s_c_c - 1.0.0-6 +- Fix sdk and binder sysroot path for embedded + +* Tue Mar 26 2024 s_c_c - 1.0.0-5 +- Fix ipc_util_config include_dirs for embedded + +* Fri Mar 22 2024 s_c_c - 1.0.0-4 +- Fix ipc and dsoftbus compile errors for embedded + * Wed Dec 20 2023 Peng He - 1.0.0-3 - correct default ethernet interface from enp7s0 to eth0 diff --git a/ipc.BUILD.gn b/ipc.BUILD.gn index 7b6d93d21afc958fe24e561dcab84e03b9b05781..ee16893f9d8a8a90d14c6ea79ffd681015ff4292 100644 --- a/ipc.BUILD.gn +++ b/ipc.BUILD.gn @@ -13,6 +13,7 @@ import("//build/ohos.gni") import("//build/ohos_var.gni") +import("//build/config/sysroot.gni") SUBSYSTEM_DIR = "//foundation/communication/ipc" IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native" @@ -21,9 +22,9 @@ config("ipc_util_config") { # header file path include_dirs = [ - "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include", + "${sysroot}/usr/include/ipc", "$IPC_CORE_ROOT/src/core/include", "$IPC_CORE_ROOT/src/mock/include", - "//commonlibrary/c_utils/base/include", + "${sysroot}/usr/include/c_utils", ] } diff --git a/sdk.BUILD.gn b/sdk.BUILD.gn index 73934c3ce9fae4f80b6ccd82f6168ce76fc0d5bf..822696f3fb559dd6fbed7f69a576acdb39687867 100644 --- a/sdk.BUILD.gn +++ b/sdk.BUILD.gn @@ -13,18 +13,14 @@ import("//build/ohos.gni") import("//build/ohos_var.gni") +import("//build/config/sysroot.gni") dsoftbus_root_path = "//foundation/communication/dsoftbus" config("dsoftbus_sdk_interface") { include_dirs = [ - "$dsoftbus_root_path/interfaces/kits", - "$dsoftbus_root_path/interfaces/kits/bus_center", - "$dsoftbus_root_path/interfaces/kits/common", - "$dsoftbus_root_path/interfaces/kits/discovery", - "$dsoftbus_root_path/interfaces/kits/transport", + "${sysroot}/usr/include/dsoftbus", "$dsoftbus_root_path/sdk/transmission/session/cpp/include", - "$dsoftbus_root_path/interfaces/inner_kits/transport", "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include", ] libs = [ "softbus_client.z" ]