From f5e06e12055bb6a6ad484fe9d1b3baa41c877f95 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 26 Oct 2015 15:00:49 +0100 Subject: [PATCH] iotivity: update to version 1.0.0 This brings IoTivity to version 1.0.0. The patches removed by this commit are merged upstream now. There are some new patches needed for new problems with Big Endian CPUs and also for musl. The plugin manager was removed in upstream IoTivity 1.0.0. Signed-off-by: Hauke Mehrtens --- net/iotivity/Makefile | 75 +++--- net/iotivity/patches/001-no_unit_test.patch | 36 ++- net/iotivity/patches/004-use-env.patch | 2 +- net/iotivity/patches/010-big-endian.patch | 26 ++ .../patches/011-musl-use-inttypes.patch | 31 +++ ...y-fix-getnameinfo-call-for-musl-libc.patch | 161 +++++++++++++ .../patches/030-remove-check-for-curl.patch | 53 ++++ ...-liboc-add-missing-depending-library.patch | 49 ---- ...ibTGMSDKLibrary.so-add-missing-depen.patch | 42 ---- ...ger-libSSMCore.so-add-missing-depend.patch | 32 --- ...uittopp.so-add-missing-depending-lib.patch | 39 --- ...libfanserver_mqtt_plugin.so-and-libl.patch | 42 ---- ...ation-libserver_builder.so-add-missi.patch | 69 ------ ...endency-to-liboc_logger.so-in-c-code.patch | 54 ----- ...vity_abstraction.so-add-missing-depe.patch | 37 --- ...ild-fail-if-unresolved-symbols-found.patch | 227 ------------------ ...esting-address-field-before-using-it.patch | 29 --- ...encapsulation-fix-build-without-curl.patch | 29 --- net/iotivity/patches/140-remove-glib2.patch | 29 ++- 19 files changed, 348 insertions(+), 714 deletions(-) create mode 100644 net/iotivity/patches/010-big-endian.patch create mode 100644 net/iotivity/patches/011-musl-use-inttypes.patch create mode 100644 net/iotivity/patches/012-connectivity-fix-getnameinfo-call-for-musl-libc.patch create mode 100644 net/iotivity/patches/030-remove-check-for-curl.patch delete mode 100644 net/iotivity/patches/060-liboc-add-missing-depending-library.patch delete mode 100644 net/iotivity/patches/061-things-manager-libTGMSDKLibrary.so-add-missing-depen.patch delete mode 100644 net/iotivity/patches/062-soft-sensor-manager-libSSMCore.so-add-missing-depend.patch delete mode 100644 net/iotivity/patches/063-mqtt-fan-libmosquittopp.so-add-missing-depending-lib.patch delete mode 100644 net/iotivity/patches/064-protocol-plugin-libfanserver_mqtt_plugin.so-and-libl.patch delete mode 100644 net/iotivity/patches/065-resource-manipulation-libserver_builder.so-add-missi.patch delete mode 100644 net/iotivity/patches/066-csdk-remove-dependency-to-liboc_logger.so-in-c-code.patch delete mode 100644 net/iotivity/patches/067-csdk-libconnectivity_abstraction.so-add-missing-depe.patch delete mode 100644 net/iotivity/patches/068-build-make-build-fail-if-unresolved-symbols-found.patch delete mode 100644 net/iotivity/patches/070-Avoid-Segv-by-testing-address-field-before-using-it.patch delete mode 100644 net/iotivity/patches/090-resource-encapsulation-fix-build-without-curl.patch diff --git a/net/iotivity/Makefile b/net/iotivity/Makefile index 3c0999864..728636cfb 100644 --- a/net/iotivity/Makefile +++ b/net/iotivity/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iotivity -PKG_VERSION:=0.9.2 +PKG_VERSION:=1.0.0 PKG_RELEASE=1 PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz PKG_SOURCE_URL:=https://downloads.iotivity.org/${PKG_VERSION}/ \ http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/ -PKG_MD5SUM:=cf32e10a8f355fe1327db98ffc9a6173 +PKG_MD5SUM:=4bcbabffc1734c664bbdf8fedfa60543 PKG_USE_MIPS16:=0 PKG_MAINTAINER:=Hauke Mehrtens @@ -22,8 +22,6 @@ PKG_MAINTAINER:=Hauke Mehrtens PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE.md -PKG_BUILD_DEPENDS:= +boost +libexpat - include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/scons.mk @@ -69,32 +67,6 @@ define Package/iotivity-things-manager-lib/description endef -define Package/iotivity-plugin-manager-lib - SECTION:=net - CATEGORY:=Network - DEPENDS:=iotivity +iotivity-cpp +libexpat +boost +boost-system - TITLE:=IoTivity plugin manager lib - URL:=https://www.iotivity.org -endef - -define Package/iotivity-plugin-manager-lib/description - IoTivity plugin manager lib -endef - - -define Package/iotivity-mqttclient - SECTION:=net - CATEGORY:=Network - DEPENDS:=iotivity +iotivity-cpp +iotivity-plugin-manager-lib +boost +boost-system - TITLE:=IoTivity mqtt Client - URL:=https://www.iotivity.org -endef - -define Package/iotivity-mqttclient/description - IoTivity mqtt Client -endef - - define Package/iotivity-oic-middle SECTION:=net CATEGORY:=Network @@ -135,7 +107,7 @@ endef PKG_TINYCBOR_NAME:=tinycbor -PKG_TINYCBOR_VERSION:=3e83c0dc6e55bc73e9a4a7343ab8e06c43127efa +PKG_TINYCBOR_VERSION:=43e3ac9490cf19459ec7b7bd13df3b66810fb62a PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2 PKG_TINYCBOR_PROTO:=git PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git @@ -152,15 +124,37 @@ define Download/iotivity-tinycbor endef $(eval $(call Download,iotivity-tinycbor)) +PKG_SQLITE_NAME:=sqlite +PKG_SQLITE_VERSION:=3081101 +PKG_SQLITE_SOURCE:=$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION).zip +PKG_SQLITE_SOURCE_URL:=http://www.sqlite.org/2015/ +PKG_SQLITE_SUBDIR:=$(PKG_SQLITE_NAME) +PKG_SQLITE_MD5SUM:=94907e831502e2080b76e281cfa24dde + +define Download/iotivity-sqlite + FILE:=$(PKG_SQLITE_SOURCE) + URL:=$(PKG_SQLITE_SOURCE_URL) + VERSION:=$(PKG_SQLITE_VERSION) + SUBDIR:=$(PKG_SQLITE_SUBDIR) + MD5SUM:=$(PKG_SQLITE_MD5SUM) +endef +$(eval $(call Download,iotivity-sqlite)) + SCONS_OPTIONS += \ TARGET_OS=linux \ - TARGET_TRANSPORT=ALL \ + TARGET_TRANSPORT=IP \ TARGET_ARCH=$(ARCH) \ STAGING_DIR=$(STAGING_DIR) \ LOGGING=true \ SECURED=1 \ - mqttclient examples samples libTGMSDK ConServerApp ConClientApp BootstrapServerApp + $(if $(CONFIG_PACKAGE_iotivity),liboctbstack) \ + $(if $(CONFIG_PACKAGE_iotivity-cpp),liboc) \ + $(if $(CONFIG_PACKAGE_iotivity-things-manager-lib),libTGMSDK) \ + $(if $(CONFIG_PACKAGE_iotivity-oic-middle),samples) \ + $(if $(CONFIG_PACKAGE_iotivity-things-manager),ConServerApp ConClientApp BootstrapServerApp) \ + $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \ + ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) SCONS_OPTIONS += VERBOSE=true @@ -169,6 +163,9 @@ endif define Build/Prepare $(call Build/Prepare/Default) $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE) + unzip -d $(PKG_BUILD_DIR)/extlibs/sqlite3/ $(DL_DIR)/$(PKG_SQLITE_SOURCE) + mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.h $(PKG_BUILD_DIR)/extlibs/sqlite3/ + mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.c $(PKG_BUILD_DIR)/extlibs/sqlite3/ endef @@ -197,16 +194,6 @@ define Package/iotivity-things-manager-lib/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/libTGMSDKLibrary.so $(1)/usr/lib/ endef -define Package/iotivity-plugin-manager-lib/install - $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/libpmimpl.so $(1)/usr/lib/ -endef - -define Package/iotivity-mqttclient/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/service/protocol-plugin/sample-app/linux/mqtt/mqttclient $(1)/usr/bin/ -endef - define Package/iotivity-oic-middle/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/examples/OICMiddle/OICMiddle $(1)/usr/bin/ @@ -229,8 +216,6 @@ endef $(eval $(call BuildPackage,iotivity)) $(eval $(call BuildPackage,iotivity-cpp)) $(eval $(call BuildPackage,iotivity-things-manager-lib)) -$(eval $(call BuildPackage,iotivity-plugin-manager-lib)) -$(eval $(call BuildPackage,iotivity-mqttclient)) $(eval $(call BuildPackage,iotivity-oic-middle)) $(eval $(call BuildPackage,iotivity-things-manager)) $(eval $(call BuildPackage,iotivity-example-garage)) diff --git a/net/iotivity/patches/001-no_unit_test.patch b/net/iotivity/patches/001-no_unit_test.patch index 60b20ddf8..981abf6fd 100644 --- a/net/iotivity/patches/001-no_unit_test.patch +++ b/net/iotivity/patches/001-no_unit_test.patch @@ -1,6 +1,6 @@ --- a/resource/SConscript +++ b/resource/SConscript -@@ -67,7 +67,7 @@ if target_os == 'linux': +@@ -71,7 +71,7 @@ if target_os == 'linux': SConscript('csdk/stack/samples/linux/secure/SConscript') # Build C/C++ unit tests @@ -11,14 +11,30 @@ env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh') --- a/service/resource-encapsulation/SConscript +++ b/service/resource-encapsulation/SConscript -@@ -101,7 +101,7 @@ SConscript('examples/SConscript') - ###################################################################### - # Build UnitTests Resource Client , resourceCache and resourceBroker +@@ -113,10 +113,10 @@ SConscript('examples/SConscript') + # Build UnitTests Resource Client , resourceCache and resourceBroker and + # DiscoveryManager ################################################ ###################### --SConscript('unittests/SConscript') --SConscript('src/resourceCache/unittests/SConscript') --SConscript('src/resourceBroker/unittest/SConscript') -+#SConscript('unittests/SConscript') -+#SConscript('src/resourceCache/unittests/SConscript') -+#SConscript('src/resourceBroker/unittest/SConscript') +-if target_os == 'linux': +- SConscript('unittests/SConscript') +- SConscript('src/resourceCache/unittests/SConscript') +- SConscript('src/resourceBroker/unittest/SConscript') ++# if target_os == 'linux': ++# SConscript('unittests/SConscript') ++# SConscript('src/resourceCache/unittests/SConscript') ++# SConscript('src/resourceBroker/unittest/SConscript') + + if target_os == 'android': + SConscript('android/SConscript') +\ No newline at end of file +--- a/service/things-manager/SConscript ++++ b/service/things-manager/SConscript +@@ -71,6 +71,6 @@ SConscript('sampleapp/SConscript') + ###################################################################### + # Build UnitTests Things Manager + ################################################ ###################### +-if target_os == 'linux': +- SConscript('unittests/SConscript') ++# if target_os == 'linux': ++# SConscript('unittests/SConscript') diff --git a/net/iotivity/patches/004-use-env.patch b/net/iotivity/patches/004-use-env.patch index 334d42946..4076d9b91 100644 --- a/net/iotivity/patches/004-use-env.patch +++ b/net/iotivity/patches/004-use-env.patch @@ -9,7 +9,7 @@ Subject: [PATCH 3/4] 004-use-env.patch --- a/build_common/SConscript +++ b/build_common/SConscript -@@ -129,6 +129,26 @@ tc_set_msg = ''' +@@ -137,6 +137,26 @@ tc_set_msg = ''' * cause inexplicable errors. * ******************************************************************************* ''' diff --git a/net/iotivity/patches/010-big-endian.patch b/net/iotivity/patches/010-big-endian.patch new file mode 100644 index 000000000..899bb34ab --- /dev/null +++ b/net/iotivity/patches/010-big-endian.patch @@ -0,0 +1,26 @@ +From d647872aee4871e286ddedf4931792086f5b4565 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Mon, 26 Oct 2015 14:32:39 +0100 +Subject: [PATCH] libcoap: remove fix build error on big endian systems + +In the big endian case an additional typedef is added in a wrong +position in TinyDTLS. This breaks compiling this code on big endian +systems. + +Change-Id: Iad854aba112ddb23bf490b064ec6fbf5d01ce6b6 +Signed-off-by: Hauke Mehrtens +--- + resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h ++++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h +@@ -194,7 +194,7 @@ typedef enum + #ifdef WORDS_BIGENDIAN + typedef union + { +- typedef struct ++ struct + { + unsigned int version:2; /* protocol version */ + unsigned int type:2; /* type flag */ diff --git a/net/iotivity/patches/011-musl-use-inttypes.patch b/net/iotivity/patches/011-musl-use-inttypes.patch new file mode 100644 index 000000000..bd74f37aa --- /dev/null +++ b/net/iotivity/patches/011-musl-use-inttypes.patch @@ -0,0 +1,31 @@ +From 9510445c5002b0e3502d2ac09723e1b2ddd03704 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Mon, 26 Oct 2015 14:39:55 +0100 +Subject: [PATCH] tinydtls: use types from inittype.h, fix musl libc + +The SHA2 code currently uses u_int32_t and similar types without +defining them. This type is not defined by the POSIX standard, but many +libc implementations have it as a non standard extension. In the musl +libc it is not implemented and I am getting a compile error when using +u_int32_t, I should use uint32_t, which is done when +SHA2_USE_INTTYPES_H is set. + +This fixes build with musl libs used in OpenWrt. + +Change-Id: I485435ddb8b1a2359caedd335ab54f91ca5e3f3e +Signed-off-by: Hauke Mehrtens +--- + extlibs/tinydtls/SConscript | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/extlibs/tinydtls/SConscript ++++ b/extlibs/tinydtls/SConscript +@@ -68,7 +68,7 @@ if not env.get('RELEASE'): + else: + env.AppendUnique(CPPDEFINES = ['NDEBUG']) + +-env.AppendUnique(CPPDEFINES = ['DTLSV12', 'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE']) ++env.AppendUnique(CPPDEFINES = ['DTLSV12', 'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE', 'SHA2_USE_INTTYPES_H']) + + + libtinydtls = env.StaticLibrary('libtinydtls', env.get('TINYDTLS_SRC'), OBJPREFIX='libtinydtls_') diff --git a/net/iotivity/patches/012-connectivity-fix-getnameinfo-call-for-musl-libc.patch b/net/iotivity/patches/012-connectivity-fix-getnameinfo-call-for-musl-libc.patch new file mode 100644 index 000000000..99f9b786e --- /dev/null +++ b/net/iotivity/patches/012-connectivity-fix-getnameinfo-call-for-musl-libc.patch @@ -0,0 +1,161 @@ +From 75a19e9059e671442abe40908ba80c2da614118d Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Mon, 26 Oct 2015 22:42:40 +0100 +Subject: [PATCH] connectivity: fix getnameinfo() call for musl libc + +The musl libc and also the libc from net/freebsd are currently checking +if the size of the sockaddr given to getnameinfo() matches the size for +this family and it fails when giving sizeof(struct sockaddr_storage). +This patch fixes this problem by making the caller also provide the +size of the struct sockaddr_storage. + +I am currently trying to get a fix for this problem into musl libc, but +IoTivity should still fix this. + +This also fixes a wrong error message. + +Change-Id: Ie9b89523b5ba20e536c03e3ad85c65bd5ff2ba53 +Signed-off-by: Hauke Mehrtens +--- + resource/csdk/connectivity/inc/caadapterutils.h | 12 ++++++++---- + .../csdk/connectivity/src/adapter_util/caadapternetdtls.c | 10 +++++----- + resource/csdk/connectivity/src/adapter_util/caadapterutils.c | 9 +++++---- + resource/csdk/connectivity/src/ip_adapter/caipserver.c | 2 +- + resource/csdk/connectivity/src/tcp_adapter/catcpserver.c | 2 +- + 5 files changed, 20 insertions(+), 15 deletions(-) + +--- a/resource/csdk/connectivity/inc/caadapterutils.h ++++ b/resource/csdk/connectivity/inc/caadapterutils.h +@@ -212,13 +212,16 @@ void CAClearNetInterfaceInfoList(u_array + */ + void CAClearServerInfoList(u_arraylist_t *serverInfoList); + ++#ifndef WITH_ARDUINO + /** + * Convert address from binary to string. +- * @param[in] ipaddr IP address info. +- * @param[out] host address string (must be CA_IPADDR_SIZE). +- * @param[out] port host order port number. ++ * @param[in] sockAddr IP address info. ++ * @param[in] sockAddrLen size of sockAddr. ++ * @param[out] host address string (must be CA_IPADDR_SIZE). ++ * @param[out] port host order port number. + */ +-void CAConvertAddrToName(const struct sockaddr_storage *sockaddr, char *host, uint16_t *port); ++void CAConvertAddrToName(const struct sockaddr_storage *sockAddr, socklen_t sockAddrLen, ++ char *host, uint16_t *port); + + /** + * Convert address from string to binary. +@@ -227,6 +230,7 @@ void CAConvertAddrToName(const struct so + * @param[out] ipaddr IP address info. + */ + void CAConvertNameToAddr(const char *host, uint16_t port, struct sockaddr_storage *sockaddr); ++#endif /* WITH_ARDUINO */ + + #ifdef __ANDROID__ + /** +--- a/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c ++++ b/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c +@@ -417,7 +417,7 @@ static int32_t CAReadDecryptedPayload(dt + ((addrInfo->addr.st.ss_family == AF_INET) ? CA_IPV4 : CA_IPV6) | CA_SECURE, .port = 0 }, + .identity = + { 0 } }; +- CAConvertAddrToName(&(addrInfo->addr.st), sep.endpoint.addr, &sep.endpoint.port); ++ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, sep.endpoint.addr, &sep.endpoint.port); + + if (NULL == g_caDtlsContext) + { +@@ -468,7 +468,7 @@ static int32_t CASendSecureData(dtls_con + + CAEndpoint_t endpoint = {.adapter = CA_DEFAULT_ADAPTER}; + +- CAConvertAddrToName(&(addrInfo->addr.st), endpoint.addr, &endpoint.port); ++ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, endpoint.addr, &endpoint.port); + endpoint.flags = addrInfo->addr.st.ss_family == AF_INET ? CA_IPV4 : CA_IPV6; + endpoint.flags |= CA_SECURE; + endpoint.adapter = CA_ADAPTER_IP; +@@ -515,7 +515,7 @@ static int32_t CAHandleSecureEvent(dtls_ + stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session; + char peerAddr[MAX_ADDR_STR_SIZE_CA] = { 0 }; + uint16_t port = 0; +- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port); ++ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, peerAddr, &port); + CARemovePeerFromPeerInfoList(peerAddr, port); + } + +@@ -553,7 +553,7 @@ static int32_t CAGetPskCredentials(dtls_ + stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session; + char peerAddr[MAX_ADDR_STR_SIZE_CA] = { 0 }; + uint16_t port = 0; +- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port); ++ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, peerAddr, &port); + + if(CA_STATUS_OK != CAAddIdToPeerInfoList(peerAddr, port, desc, descLen) ) + { +@@ -933,7 +933,7 @@ static int CAVerifyCertificate(struct dt + stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session; + char peerAddr[MAX_ADDR_STR_SIZE_CA] = { 0 }; + uint16_t port = 0; +- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port); ++ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, peerAddr, &port); + + CAResult_t result = CAAddIdToPeerInfoList(peerAddr, port, + crtChain[0].subject.data + DER_SUBJECT_HEADER_LEN + 2, crtChain[0].subject.data[DER_SUBJECT_HEADER_LEN + 1]); +--- a/resource/csdk/connectivity/src/adapter_util/caadapterutils.c ++++ b/resource/csdk/connectivity/src/adapter_util/caadapterutils.c +@@ -122,14 +122,15 @@ CAResult_t CAParseIPv4AddressInternal(co + * These two conversion functions return void because errors can't happen + * (because of NI_NUMERIC), and there's nothing to do if they do happen. + */ +-void CAConvertAddrToName(const struct sockaddr_storage *sockAddr, char *host, uint16_t *port) ++void CAConvertAddrToName(const struct sockaddr_storage *sockAddr, socklen_t sockAddrLen, ++ char *host, uint16_t *port) + { + VERIFY_NON_NULL_VOID(sockAddr, CA_ADAPTER_UTILS_TAG, "sockAddr is null"); + VERIFY_NON_NULL_VOID(host, CA_ADAPTER_UTILS_TAG, "host is null"); + VERIFY_NON_NULL_VOID(port, CA_ADAPTER_UTILS_TAG, "port is null"); + + int r = getnameinfo((struct sockaddr *)sockAddr, +- sizeof (struct sockaddr_storage), ++ sockAddrLen, + host, MAX_ADDR_STR_SIZE_CA, + NULL, 0, + NI_NUMERICHOST|NI_NUMERICSERV); +@@ -138,12 +139,12 @@ void CAConvertAddrToName(const struct so + if (EAI_SYSTEM == r) + { + OIC_LOG_V(ERROR, CA_ADAPTER_UTILS_TAG, +- "getaddrinfo failed: errno %s", strerror(errno)); ++ "getnameinfo failed: errno %s", strerror(errno)); + } + else + { + OIC_LOG_V(ERROR, CA_ADAPTER_UTILS_TAG, +- "getaddrinfo failed: %s", gai_strerror(r)); ++ "getnameinfo failed: %s", gai_strerror(r)); + } + return; + } +--- a/resource/csdk/connectivity/src/ip_adapter/caipserver.c ++++ b/resource/csdk/connectivity/src/ip_adapter/caipserver.c +@@ -299,7 +299,7 @@ static CAResult_t CAReceiveMessage(int f + } + } + +- CAConvertAddrToName(&srcAddr, sep.endpoint.addr, &sep.endpoint.port); ++ CAConvertAddrToName(&srcAddr, msg.msg_namelen, sep.endpoint.addr, &sep.endpoint.port); + + if (flags & CA_SECURE) + { +--- a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c ++++ b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c +@@ -478,7 +478,7 @@ static void CAAcceptHandler(void *data) + } + svritem->u4tcp.fd = sockfd; + +- CAConvertAddrToName((struct sockaddr_storage *)&clientaddr, ++ CAConvertAddrToName((struct sockaddr_storage *)&clientaddr, clientlen, + (char *) &svritem->addr, &svritem->u4tcp.port); + + ca_mutex_lock(g_mutexObjectList); diff --git a/net/iotivity/patches/030-remove-check-for-curl.patch b/net/iotivity/patches/030-remove-check-for-curl.patch new file mode 100644 index 000000000..a7191aa8f --- /dev/null +++ b/net/iotivity/patches/030-remove-check-for-curl.patch @@ -0,0 +1,53 @@ +--- a/service/resource-container/SConscript ++++ b/service/resource-container/SConscript +@@ -176,35 +176,21 @@ if target_os in ['linux', 'tizen', 'andr + # build hue sample bundle + ###################################################################### + +-conf2 = Configure(lib_env) +-if not conf2.CheckLib('curl'): +- print '''X +-*********************************** Error ************************************* +-* Cannot build hue sample. Please install libcurl. +-* Example (Ubuntu): +-* sudo apt-get install libcurl4-openssl-dev +-* sudo ldconfig +-* Hint: check with pkg-config --libs libcurl and clear scons cache. +-* Skipping hue sample build. +-******************************************************************************* +- ''' +-else: +- hue_resource_bundle_env = resource_container_env.Clone() +- hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC']) +- +- HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/' +- hue_resource_bundle_env.AppendUnique(CPPPATH = [ +- HUE_RESOURCE_BUNDLE_DIR + 'include', +- 'include/' +- ]) +- +- hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container']) +- +- hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')] +- +- HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src) +- hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle') +-lib_env = conf2.Finish() ++hue_resource_bundle_env = resource_container_env.Clone() ++hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC']) ++ ++HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/' ++hue_resource_bundle_env.AppendUnique(CPPPATH = [ ++ HUE_RESOURCE_BUNDLE_DIR + 'include', ++ 'include/' ++ ]) ++ ++hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container']) ++ ++hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')] ++ ++HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src) ++hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle') + + ###################################################################### + # build resource container unit tests diff --git a/net/iotivity/patches/060-liboc-add-missing-depending-library.patch b/net/iotivity/patches/060-liboc-add-missing-depending-library.patch deleted file mode 100644 index 572373c4e..000000000 --- a/net/iotivity/patches/060-liboc-add-missing-depending-library.patch +++ /dev/null @@ -1,49 +0,0 @@ -From b13839cceaae97d7d23b54586da1ad7ac85ab2b6 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 20:50:39 +0200 -Subject: [PATCH] liboc: add missing depending library - -liboc.so depends on liboctbstack.so, liboc_logger.so and pthread, this -patch adds these dependencies to the build. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: I971b45669adef31dc9cca719884ebeb74aaf735e -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1794 -Tested-by: jenkins-iotivity -Reviewed-by: Erich Keane ---- - resource/src/SConscript | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - ---- a/resource/src/SConscript -+++ b/resource/src/SConscript -@@ -40,18 +40,20 @@ oclib_env.AppendUnique(CPPPATH = [ - '../csdk/connectivity/lib/libcoap-4.1.1' - ]) - -+oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -+ -+oclib_env.AppendUnique(LIBS = ['octbstack', 'oc_logger']) -+ - target_os = env.get('TARGET_OS') -+if target_os == 'linux': -+ oclib_env.AppendUnique(LIBS = ['pthread']) -+ - if target_os not in ['windows', 'winrt']: - oclib_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC']) - - if target_os == 'android': - oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) -- oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -- oclib_env.AppendUnique(LIBS = ['octbstack', 'oc_logger', 'boost_thread', 'gnustl_shared', 'log']) -- --if target_os in ['darwin', 'ios']: -- oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -- oclib_env.AppendUnique(LIBS = ['octbstack', 'oc_logger']) -+ oclib_env.AppendUnique(LIBS = ['boost_thread', 'gnustl_shared', 'log']) - - ###################################################################### - # Source files and Targets diff --git a/net/iotivity/patches/061-things-manager-libTGMSDKLibrary.so-add-missing-depen.patch b/net/iotivity/patches/061-things-manager-libTGMSDKLibrary.so-add-missing-depen.patch deleted file mode 100644 index 572abee5c..000000000 --- a/net/iotivity/patches/061-things-manager-libTGMSDKLibrary.so-add-missing-depen.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0143dfaa7e6dace845412e97ebbf697d273b0d10 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 22:06:52 +0200 -Subject: [PATCH] things-manager: libTGMSDKLibrary.so: add missing depending - library - -libTGMSDKLibrary.so also depends on liboc.so, liboctbstack.so and -pthread, this patch adds these dependencies to the build. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: I174b38e747be247fc25544db629f8ad2b7eb5ef5 -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1795 -Tested-by: jenkins-iotivity -Reviewed-by: Uze Choi ---- - service/things-manager/SConscript | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/service/things-manager/SConscript -+++ b/service/things-manager/SConscript -@@ -35,14 +35,17 @@ target_os = env.get('TARGET_OS') - ###################################################################### - things_manager_env.AppendUnique(CPPPATH = ['../../extlibs/timer', 'sdk/inc', 'sdk/src']) - -+things_manager_env.PrependUnique(LIBS = ['oc', 'octbstack']) -+ - if target_os not in ['windows', 'winrt']: - things_manager_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os != 'android': - things_manager_env.AppendUnique(CXXFLAGS = ['-pthread']) -+ things_manager_env.AppendUnique(LIBS = ['pthread']) - - if target_os == 'android': - things_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) -- things_manager_env.PrependUnique(LIBS = ['oc', 'octbstack', 'gnustl_shared']) -+ things_manager_env.PrependUnique(LIBS = ['gnustl_shared']) - - ###################################################################### - # Source files and Targets diff --git a/net/iotivity/patches/062-soft-sensor-manager-libSSMCore.so-add-missing-depend.patch b/net/iotivity/patches/062-soft-sensor-manager-libSSMCore.so-add-missing-depend.patch deleted file mode 100644 index 7cb33ab7e..000000000 --- a/net/iotivity/patches/062-soft-sensor-manager-libSSMCore.so-add-missing-depend.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b52307797b91d7448a72874e4da7bed30c27a4f5 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 22:29:14 +0200 -Subject: [PATCH] soft-sensor-manager: libSSMCore.so: add missing depending - library - -libSSMCore.so also depends on libdl.so, this patch adds these -dependencies to the build. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: I76faff46fe96caef75fb6673c7e83d62b15b8489 -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1796 -Tested-by: jenkins-iotivity -Reviewed-by: Uze Choi ---- - service/soft-sensor-manager/SConscript | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/service/soft-sensor-manager/SConscript -+++ b/service/soft-sensor-manager/SConscript -@@ -157,7 +157,7 @@ static_libssmcore = ssmcore_env.StaticLi - - ssmcore_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) - ssmcore_env.AppendUnique(LIBS = ['oc', 'octbstack', 'oc_logger', -- 'connectivity_abstraction', 'coap']) -+ 'connectivity_abstraction', 'coap', 'dl']) - - shared_libssmcore = ssmcore_env.SharedLibrary( - target = 'SSMCore', diff --git a/net/iotivity/patches/063-mqtt-fan-libmosquittopp.so-add-missing-depending-lib.patch b/net/iotivity/patches/063-mqtt-fan-libmosquittopp.so-add-missing-depending-lib.patch deleted file mode 100644 index b3b1353b2..000000000 --- a/net/iotivity/patches/063-mqtt-fan-libmosquittopp.so-add-missing-depending-lib.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 60b43aed7e479bc6d7252f0dba2542fe7aab9195 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 22:38:02 +0200 -Subject: [PATCH] mqtt-fan: libmosquittopp.so: add missing depending library - -libmosquittopp.so also depends on libpthread.so, this patch adds these -dependencies to the build. In addition it puts the dependency to -mosquitto to the beginning of the list. This is needed because -mosquitto is a statically linked lib and it also has unresolved -symbols, but gcc only searches the dynamic libs defined after the -static for unresolved symbols in the static lib. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: I866a46305c31d37cf706b9f2b965e843c35c5667 -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1797 -Tested-by: jenkins-iotivity -Reviewed-by: Younghyun Joo -Reviewed-by: Uze Choi ---- - .../plugins/mqtt-fan/lib/cpp/SConscript | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript -+++ b/service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript -@@ -16,7 +16,10 @@ mosquittopp_env.AppendUnique(CPPPATH = [ - if target_os not in ['windows', 'winrt']: - mosquittopp_env.AppendUnique(CFLAGS = ['-Wall', '-ggdb', '-O2', '-fPIC']) - --mosquittopp_env.AppendUnique(LIBS = ['mosquitto', 'ssl', 'crypto']) -+if target_os == 'linux': -+ mosquittopp_env.AppendUnique(LIBS = ['pthread']) -+ -+mosquittopp_env.PrependUnique(LIBS = ['mosquitto', 'ssl', 'crypto']) - ###################################################################### - # Source files and Targets - ###################################################################### diff --git a/net/iotivity/patches/064-protocol-plugin-libfanserver_mqtt_plugin.so-and-libl.patch b/net/iotivity/patches/064-protocol-plugin-libfanserver_mqtt_plugin.so-and-libl.patch deleted file mode 100644 index 476678afd..000000000 --- a/net/iotivity/patches/064-protocol-plugin-libfanserver_mqtt_plugin.so-and-libl.patch +++ /dev/null @@ -1,42 +0,0 @@ -From d1fb4c055f168e68ffd2d5596eef8d96f6c6cfae Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 22:41:09 +0200 -Subject: [PATCH] protocol-plugin: libfanserver_mqtt_plugin.so and - liblightserver_mqtt_plugin.so add missing depending library - -libfanserver_mqtt_plugin.so and liblightserver_mqtt_plugin.so are also -depending on liboc.so and libcrypto.so, this patch adds these -dependencies to the build. In addition it puts the dependency to -mosquitto to the beginning of the list. This is needed because -mosquitto is a statically linked lib and it also has unresolved -symbols, but gcc only searches the dynamic libs defined after the -static for unresolved symbols in the static lib. - -mosquitto was only build as a static linked library so we can use the -normal LIBS mechanism and it will be statically linked. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: Ia130827d04bd3bb1a8863fc64d0097a076edc751 -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1798 -Tested-by: jenkins-iotivity -Reviewed-by: Younghyun Joo -Reviewed-by: Uze Choi ---- - service/protocol-plugin/plugins/SConscript | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/service/protocol-plugin/plugins/SConscript -+++ b/service/protocol-plugin/plugins/SConscript -@@ -47,8 +47,7 @@ if target_os == 'android': - plugins_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - plugins_env.AppendUnique(LIBS = ['gnustl_shared']) - --plugins_env.AppendUnique(LIBS = [File(env.get('BUILD_DIR') + '/libmosquitto.a'), -- 'mosquitto', 'ssl', 'rt']) -+plugins_env.PrependUnique(LIBS = ['mosquitto', 'ssl', 'crypto', 'rt', 'oc']) - - - ###################################################################### diff --git a/net/iotivity/patches/065-resource-manipulation-libserver_builder.so-add-missi.patch b/net/iotivity/patches/065-resource-manipulation-libserver_builder.so-add-missi.patch deleted file mode 100644 index 1d83fd8b7..000000000 --- a/net/iotivity/patches/065-resource-manipulation-libserver_builder.so-add-missi.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 2993af980993ebb70b686b1a521d98d26e85cfc2 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 20:55:50 +0200 -Subject: [PATCH] resource-manipulation: libserver_builder.so add missing - depending library - -libserver_builder.so is also depending on liboc.so and -librcs_common.so, this patch adds these dependencies to the build. - -liboctbstack.so is only needed when LOGGING=true is set. Without -liboctbstack.so libserver_builder.so misses the dependencies to the -OCLog and OCLogv symbols. -Add LIBPATH to make sure the libs will be found, this fixes a problem -in some jenkins tests. - -pthread is added two times, once should be enough. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: I6af126eb4af975b7231d01df922885c7dec5fc56 -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1799 -Tested-by: jenkins-iotivity -Reviewed-by: Uze Choi ---- - .../src/serverBuilder/SConscript | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - ---- a/service/resource-encapsulation/src/serverBuilder/SConscript -+++ b/service/resource-encapsulation/src/serverBuilder/SConscript -@@ -47,6 +47,8 @@ server_builder_env.AppendUnique(CPPPATH - - server_builder_env.AppendUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs', 'include']) - -+server_builder_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -+ - if target_os not in ['windows', 'winrt']: - server_builder_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os != 'android': -@@ -56,7 +58,10 @@ if target_os == 'android': - server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log']) - --server_builder_env.AppendUnique(LIBS = ['dl']) -+server_builder_env.AppendUnique(LIBS = ['dl', 'oc', 'rcs_common']) -+ -+if env.get('LOGGING'): -+ server_builder_env.AppendUnique(LIBS = ['octbstack']) - - if not release: - server_builder_env.AppendUnique(CXXFLAGS = ['--coverage']) -@@ -77,7 +82,6 @@ server_builder_env.InstallTarget([server - ###################################################################### - server_builder_test_env = server_builder_env.Clone(); - --server_builder_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) - server_builder_test_env.AppendUnique(CPPPATH = [ - env.get('SRC_DIR')+'/extlibs/hippomocks-master', - gtest_dir + '/include', -@@ -89,8 +93,6 @@ gtest_main = File(gtest_dir + '/lib/.lib - - server_builder_test_env.PrependUnique(LIBS = [ - 'rcs_server', -- 'rcs_common', -- 'oc', - 'octbstack', - 'oc_logger', - 'connectivity_abstraction', diff --git a/net/iotivity/patches/066-csdk-remove-dependency-to-liboc_logger.so-in-c-code.patch b/net/iotivity/patches/066-csdk-remove-dependency-to-liboc_logger.so-in-c-code.patch deleted file mode 100644 index 553494aa5..000000000 --- a/net/iotivity/patches/066-csdk-remove-dependency-to-liboc_logger.so-in-c-code.patch +++ /dev/null @@ -1,54 +0,0 @@ -From c02a2b8ad3efb0b59392b1c2d441e3f7144c1fda Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 22:45:40 +0200 -Subject: [PATCH] csdk: remove dependency to liboc_logger.so in c code - -The liboc_logger.so is only used by the c++ part and not by the c part, -remove it from the c only part. - -Change-Id: Ib0894974de8ef7150401f02fbd0ea864d1d6f2cd -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1801 -Tested-by: jenkins-iotivity -Reviewed-by: Charlie Lenahan -Reviewed-by: Erich Keane ---- - resource/csdk/connectivity/test/SConscript | 3 --- - .../samples/linux/SimpleClientServer/SConscript | 2 +- - .../csdk/stack/samples/linux/secure/SConscript | 2 +- - 3 files changed, 2 insertions(+), 5 deletions(-) - ---- a/resource/csdk/connectivity/test/SConscript -+++ b/resource/csdk/connectivity/test/SConscript -@@ -58,9 +58,6 @@ target_os = env.get('TARGET_OS') - if target_os not in ['arduino', 'darwin', 'ios']: - catest_env.AppendUnique(LIBS=['rt']) - --if target_os != 'darwin': -- catest_env.PrependUnique(LIBS = ['oc_logger']) -- - if env.get('SECURED') == '1': - catest_env.AppendUnique(LIBS = ['tinydtls']) - ---- a/resource/csdk/stack/samples/linux/SimpleClientServer/SConscript -+++ b/resource/csdk/stack/samples/linux/SimpleClientServer/SConscript -@@ -41,7 +41,7 @@ samples_env.AppendUnique(LIBPATH = [env. - if target_os in ['darwin', 'ios']: - samples_env.PrependUnique(LIBS = ['m','octbstack', 'ocsrm', 'connectivity_abstraction','coap' ]) - elif target_os not in ['arduino']: -- samples_env.PrependUnique(LIBS = ['m', 'octbstack', 'ocsrm', 'oc_logger', 'connectivity_abstraction', 'coap']) -+ samples_env.PrependUnique(LIBS = ['m', 'octbstack', 'ocsrm', 'connectivity_abstraction', 'coap']) - samples_env.AppendUnique(LIBS = ['rt']) - - if env.get('SECURED') == '1': ---- a/resource/csdk/stack/samples/linux/secure/SConscript -+++ b/resource/csdk/stack/samples/linux/secure/SConscript -@@ -41,7 +41,7 @@ if target_os not in ['windows', 'winrt'] - samples_env.AppendUnique(LIBS = ['-lpthread']) - - samples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) --samples_env.PrependUnique(LIBS = ['octbstack', 'm', 'oc_logger', 'connectivity_abstraction', 'coap']) -+samples_env.PrependUnique(LIBS = ['octbstack', 'm', 'connectivity_abstraction', 'coap']) - if env.get('SECURED') == '1': - samples_env.AppendUnique(LIBS = ['tinydtls']) - diff --git a/net/iotivity/patches/067-csdk-libconnectivity_abstraction.so-add-missing-depe.patch b/net/iotivity/patches/067-csdk-libconnectivity_abstraction.so-add-missing-depe.patch deleted file mode 100644 index eeb290433..000000000 --- a/net/iotivity/patches/067-csdk-libconnectivity_abstraction.so-add-missing-depe.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 32e39b18fb4fd01408898a0ccba751f0033800c7 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Wed, 22 Jul 2015 23:05:19 +0200 -Subject: [PATCH] csdk: libconnectivity_abstraction.so: add missing depending - library - -libconnectivity_abstractionso depends on libcoap.so and librt.so when -build as shared lib, which is the case for the Tizen build. This patch -adds these dependencies to the build. - -Without this the dynamic loader will not automatically load these -libraries and it could result in unresolved dependencies at runtime. - -Change-Id: Ib972be2b766d7fbccac9b246ae6f11e6182af94c -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1825 -Tested-by: jenkins-iotivity -Reviewed-by: Uze Choi -Tested-by: Uze Choi ---- - resource/csdk/connectivity/src/SConscript | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/resource/csdk/connectivity/src/SConscript -+++ b/resource/csdk/connectivity/src/SConscript -@@ -108,6 +108,11 @@ if 'BLE' in ca_transport: - print "Include path is %s" % env.get('CPPPATH') - print "Files path is %s" % env.get('CA_SRC') - if ca_os in ['android', 'tizen']: -+ env.AppendUnique(LIBS = ['coap']) -+ if env.get('SECURED') == '1': -+ env.AppendUnique(LIBS = ['tinydtls']) -+ if ca_os != 'android': -+ env.AppendUnique(LIBS = ['rt']) - calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC')) - else: - calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC')) diff --git a/net/iotivity/patches/068-build-make-build-fail-if-unresolved-symbols-found.patch b/net/iotivity/patches/068-build-make-build-fail-if-unresolved-symbols-found.patch deleted file mode 100644 index cf4037063..000000000 --- a/net/iotivity/patches/068-build-make-build-fail-if-unresolved-symbols-found.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 2533c88e18de689dbb26cfd4d585b1a991533c76 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 21 Jul 2015 22:00:18 +0200 -Subject: [PATCH] build: make build fail if unresolved symbols found - -gcc links shared libs also when there are still some unresolved -symbols, you have to specify it explicitly to make it fail in such -cases. I think a compiler should fail in such cases otherwise -someone will add some not intended dependencies or some existing -dependencies are not getting declared. - -This patch makes gcc fail in such cases. I have only activated this for -libs build in a Linux build and explicitly deactivates it for windows -(does this even work at all?) This should be build tested with Android -also. - -This was build tested for Linux and Android. - -This patch depends on some other patches I send which are fixing the -problems I found with this change. - -Change-Id: I9ab79896ca2e86e9226cd9b39060a0763ef89694 -Signed-off-by: Hauke Mehrtens -Reviewed-on: https://gerrit.iotivity.org/gerrit/1802 -Tested-by: jenkins-iotivity -Reviewed-by: Erich Keane -Reviewed-by: Hun-je Yeon -Reviewed-by: Uze Choi ---- - extlibs/expat/SConscript | 3 +++ - .../csdk/connectivity/samples/android/SConscript | 1 + - resource/csdk/connectivity/src/SConscript | 3 +++ - resource/oc_logger/SConscript | 3 +++ - resource/src/SConscript | 3 +++ - service/notification-manager/SConscript | 3 +++ - service/protocol-plugin/plugin-manager/SConscript | 4 ++++ - .../plugin-manager/src/Android/jni/SConscript | 1 + - service/protocol-plugin/plugins/SConscript | 3 +++ - .../plugins/mqtt-fan/lib/cpp/SConscript | 3 +++ - .../resource-manipulation/src/common/SConscript | 5 ++++- - .../src/resourceContainer/SConscript | 3 +++ - .../src/resourceContainer/unittests/SConscript | 3 +++ - .../src/serverBuilder/SConscript | 3 +++ - service/soft-sensor-manager/SConscript | 3 +++ - service/things-manager/SConscript | 3 +++ - service/things-manager/sdk/java/jni/SConscript | 3 +++ - 17 files changed, 49 insertions(+), 1 deletion(-) - ---- a/extlibs/expat/SConscript -+++ b/extlibs/expat/SConscript -@@ -35,6 +35,9 @@ if target_os not in ['windows', 'winrt'] - '-fexceptions', '-fno-common']) - expat_env.AppendUnique(CPPDEFINES = ['HAVE_EXPAT_CONFIG_H']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ expat_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - ###################################################################### - # Source files and Targets - ###################################################################### ---- a/resource/csdk/connectivity/src/SConscript -+++ b/resource/csdk/connectivity/src/SConscript -@@ -27,6 +27,9 @@ env.AppendUnique(CPPPATH = [ os.path.joi - if ca_os not in ['arduino', 'windows', 'winrt']: - env.AppendUnique(CPPDEFINES = ['WITH_POSIX']) - -+if ca_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if ca_os in ['darwin','ios']: - env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE']) - ---- a/resource/oc_logger/SConscript -+++ b/resource/oc_logger/SConscript -@@ -42,6 +42,9 @@ if target_os not in ['arduino', 'windows - liboc_logger_env.AppendUnique(CFLAGS = ['-Wall', '-std=c99', '-fPIC']) - liboc_logger_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x', '-fPIC']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ liboc_logger_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - ###################################################################### - # Source files and Targets - ###################################################################### ---- a/resource/src/SConscript -+++ b/resource/src/SConscript -@@ -51,6 +51,9 @@ if target_os == 'linux': - if target_os not in ['windows', 'winrt']: - oclib_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ oclib_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'android': - oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - oclib_env.AppendUnique(LIBS = ['boost_thread', 'gnustl_shared', 'log']) ---- a/service/notification-manager/SConscript -+++ b/service/notification-manager/SConscript -@@ -65,6 +65,9 @@ notimgr_env.PrependUnique(LIBS = [ - if target_os not in ['windows', 'winrt']: - notimgr_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ notimgr_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'linux': - notimgr_env.AppendUnique(LIBS = ['pthread']) - ---- a/service/protocol-plugin/plugin-manager/SConscript -+++ b/service/protocol-plugin/plugin-manager/SConscript -@@ -61,6 +61,10 @@ if target_os == 'android': - pmimpl_env = plugin_manager_env.Clone() - pmimpl_env.PrependUnique(CCFLAGS = ['-fPIC']) - pmimpl_env.PrependUnique(LIBS = File(env.get('BUILD_DIR') + '/libcpluff.a')) -+ -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ pmimpl_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - pmimpl = pmimpl_env.SharedLibrary('pmimpl', pmimpl_src) - - plugin_manager_env.InstallTarget([ppm, pmimpl], 'libppm') ---- a/service/protocol-plugin/plugin-manager/src/Android/jni/SConscript -+++ b/service/protocol-plugin/plugin-manager/src/Android/jni/SConscript -@@ -23,6 +23,7 @@ ppm_jni_env.PrependUnique(LIBS = ['pmimp - ppm_jni_env.AppendUnique(CPPPATH = [ppm_sdk+'/src']) - ppm_jni_env.AppendUnique(CPPPATH = [ppm_sdk+'/../lib/cpluff/libcpluff']) - ppm_jni_env.AppendUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs/rapidxml']) -+ppm_jni_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) - - ###################################################################### - # Source files and Targets ---- a/service/protocol-plugin/plugins/SConscript -+++ b/service/protocol-plugin/plugins/SConscript -@@ -40,6 +40,9 @@ if target_os not in ['windows', 'winrt'] - plugins_env.PrependUnique(CCFLAGS = ['-fPIC']) - plugins_env.AppendUnique(LINKFLAGS = ['-fPIC']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ plugins_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os not in ['arduino', 'android']: - plugins_env.AppendUnique(LIBS = ['pthread']) - ---- a/service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript -+++ b/service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript -@@ -16,6 +16,9 @@ mosquittopp_env.AppendUnique(CPPPATH = [ - if target_os not in ['windows', 'winrt']: - mosquittopp_env.AppendUnique(CFLAGS = ['-Wall', '-ggdb', '-O2', '-fPIC']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ mosquittopp_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'linux': - mosquittopp_env.AppendUnique(LIBS = ['pthread']) - ---- a/service/resource-encapsulation/src/resourceContainer/SConscript -+++ b/service/resource-encapsulation/src/resourceContainer/SConscript -@@ -88,6 +88,9 @@ if target_os not in ['windows', 'winrt'] - if target_os != 'android': - resource_container_env.AppendUnique(CXXFLAGS = ['-pthread']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'android': - resource_container_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - resource_container_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log']) ---- a/service/resource-encapsulation/src/resourceContainer/unittests/SConscript -+++ b/service/resource-encapsulation/src/resourceContainer/unittests/SConscript -@@ -144,6 +144,9 @@ if int(containerJavaSupport): - test_bundle_env = container_gtest_env.Clone() - test_bundle_env.AppendUnique(CCFLAGS = ['-fPIC']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ test_bundle_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - TEST_BUNDLE_DIR = 'TestBundle/' - test_bundle_env.AppendUnique(CPPPATH = [ - TEST_BUNDLE_DIR + 'include', ---- a/service/resource-encapsulation/src/serverBuilder/SConscript -+++ b/service/resource-encapsulation/src/serverBuilder/SConscript -@@ -54,6 +54,9 @@ if target_os not in ['windows', 'winrt'] - if target_os != 'android': - server_builder_env.AppendUnique(CXXFLAGS = ['-pthread']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'android': - server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log']) ---- a/service/soft-sensor-manager/SConscript -+++ b/service/soft-sensor-manager/SConscript -@@ -45,6 +45,9 @@ if target_os not in ['windows', 'winrt'] - soft_sensor_manager_env.AppendUnique(LIBS = ['pthread']) - soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-pthread']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ soft_sensor_manager_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'android': - soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - soft_sensor_manager_env.AppendUnique(LIBS = ['gnustl_shared']) ---- a/service/things-manager/SConscript -+++ b/service/things-manager/SConscript -@@ -43,6 +43,9 @@ if target_os not in ['windows', 'winrt'] - things_manager_env.AppendUnique(CXXFLAGS = ['-pthread']) - things_manager_env.AppendUnique(LIBS = ['pthread']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ things_manager_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - if target_os == 'android': - things_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - things_manager_env.PrependUnique(LIBS = ['gnustl_shared']) ---- a/service/things-manager/sdk/java/jni/SConscript -+++ b/service/things-manager/sdk/java/jni/SConscript -@@ -27,6 +27,9 @@ tm_jni_env.AppendUnique(CPPPATH = [tm_sd - tm_jni_env.AppendUnique(CPPPATH = [base_jni]) - tm_jni_env.AppendUnique(CPPPATH = ['tm/inc', 'jniutil/inc', extlibs+'/timer/']) - -+if target_os not in ['darwin', 'ios', 'windows', 'winrt']: -+ tm_jni_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) -+ - ###################################################################### - # Source files and Targets - ###################################################################### diff --git a/net/iotivity/patches/070-Avoid-Segv-by-testing-address-field-before-using-it.patch b/net/iotivity/patches/070-Avoid-Segv-by-testing-address-field-before-using-it.patch deleted file mode 100644 index 47e7676c9..000000000 --- a/net/iotivity/patches/070-Avoid-Segv-by-testing-address-field-before-using-it.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a8f5ed3ff337bce5222967fdf8c0b475fd28e74a Mon Sep 17 00:00:00 2001 -From: John Light -Date: Thu, 30 Jul 2015 15:14:07 -0700 -Subject: [PATCH] Avoid Segv by testing address field before using it. - -sIssue reported off dev list by Gabriel Schulhof. - -Change-Id: Ifa529da59fb784fd5cdef6ca333635cf99ed1f59 -Signed-off-by: John Light -Reviewed-on: https://gerrit.iotivity.org/gerrit/2160 -Tested-by: jenkins-iotivity -Reviewed-by: Erich Keane ---- - .../src/ip_adapter/linux/caipnwmonitor.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/resource/csdk/connectivity/src/ip_adapter/linux/caipnwmonitor.c -+++ b/resource/csdk/connectivity/src/ip_adapter/linux/caipnwmonitor.c -@@ -57,6 +57,10 @@ u_arraylist_t *CAIPGetInterfaceInformati - struct ifaddrs *ifa = NULL; - for (ifa = ifp; ifa; ifa = ifa->ifa_next) - { -+ if (!ifa->ifa_addr) -+ { -+ continue; -+ } - int family = ifa->ifa_addr->sa_family; - if ((ifa->ifa_flags & IFF_LOOPBACK) || (AF_INET != family && AF_INET6 != family)) - { diff --git a/net/iotivity/patches/090-resource-encapsulation-fix-build-without-curl.patch b/net/iotivity/patches/090-resource-encapsulation-fix-build-without-curl.patch deleted file mode 100644 index 933238350..000000000 --- a/net/iotivity/patches/090-resource-encapsulation-fix-build-without-curl.patch +++ /dev/null @@ -1,29 +0,0 @@ -From e767f892e7736008b60f85d2c2690d660661814b Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 13 Aug 2015 15:03:11 +0200 -Subject: [PATCH] resource-encapsulation: fix build without curl - -The hue plugin needs curl and it should only be build when libcurl is available. -Without this patch, the build fails without curl installed, this patch fixes the problem and makes the build worm without curl and without the hue stuff. - -Without this patch I am getting this error message: -scons: *** -File "/service/third_party_libs.scons", line 50, in ? - -Change-Id: I5b4da555ff84b9b605cc6c119990d60ff670bd0d -Signed-off-by: Hauke Mehrtens ---- - .../src/resourceContainer/SConscript | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/service/resource-encapsulation/src/resourceContainer/SConscript -+++ b/service/resource-encapsulation/src/resourceContainer/SConscript -@@ -177,7 +177,7 @@ else: - - HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src) - hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle') -- lib_env = conf2.Finish() -+lib_env = conf2.Finish() - - ###################################################################### - # build resource container unit tests diff --git a/net/iotivity/patches/140-remove-glib2.patch b/net/iotivity/patches/140-remove-glib2.patch index 54593c5fa..36bb82c8a 100644 --- a/net/iotivity/patches/140-remove-glib2.patch +++ b/net/iotivity/patches/140-remove-glib2.patch @@ -1,22 +1,33 @@ +--- a/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript ++++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript +@@ -31,7 +31,7 @@ this_build_dir = os.path.join(root_build + + # The Linux BLE adapter implementation uses GDBus to make D-Bus based + # method calls to BlueZ. Pull in the necessary dependencies. +-env.ParseConfig("pkg-config gio-unix-2.0 --cflags --libs") ++# env.ParseConfig("pkg-config gio-unix-2.0 --cflags --libs") + + # Set up commands to generate GDBus code from the D-Bus introspection + # XML. --- a/resource/csdk/security/provisioning/sample/SConscript +++ b/resource/csdk/security/provisioning/sample/SConscript -@@ -53,7 +53,7 @@ provisioning_env.PrependUnique(LIBS = [' - - if env.get('SECURED') == '1': - provisioning_env.AppendUnique(LIBS = ['tinydtls']) +@@ -58,7 +58,7 @@ if env.get('SECURED') == '1': + if env.get('DTLS_WITH_X509') == '1': + provisioning_env.AppendUnique(LIBS = ['CKManager']) + provisioning_env.AppendUnique(LIBS = ['asn1']) -provisioning_env.ParseConfig('pkg-config --libs glib-2.0'); -+#provisioning_env.ParseConfig('pkg-config --libs glib-2.0'); ++# provisioning_env.ParseConfig('pkg-config --libs glib-2.0'); provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG']) --- a/resource/csdk/security/provisioning/SConscript +++ b/resource/csdk/security/provisioning/SConscript -@@ -62,7 +62,7 @@ provisioning_env.PrependUnique(LIBS = [' - - provisioning_env.AppendUnique(LIBS = ['tinydtls']) +@@ -73,7 +73,7 @@ provisioning_env.AppendUnique(LIBS = ['t + if env.get('DTLS_WITH_X509') == '1': + provisioning_env.AppendUnique(LIBS = ['CKManger']) -provisioning_env.ParseConfig('pkg-config --libs glib-2.0'); -+#provisioning_env.ParseConfig('pkg-config --libs glib-2.0'); ++# provisioning_env.ParseConfig('pkg-config --libs glib-2.0'); if target_os == 'android': provisioning_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])