[yocto] [meta-oic][PATCH 2/3] iotivity-sensorboard: Use regular LDFLAGS variable and pthread
Philippe Coval
philippe.coval at osg.samsung.com
Wed Sep 14 07:09:20 PDT 2016
Without this change and error on linkage is displayed :
ld: observer.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Also YOCTOLDFLAGS are replaced with regular LDFLAGS,
to use quality check.
Without this, QA check is failing and this message is reported:
do_package_qa: QA Issue: No GNU_HASH in the elf binary:
Change-Id: I80e4ab17128b8539a45843611e4aec3650e2ddef
Bug: https://jira.iotivity.org/browse/IOT-1111
Cc: iotivity-dev at lists.iotivity.org
Cc: yocto at yoctoproject.org
Origin: https://github.com/tizenteam/meta-oic
Signed-off-by: Philippe Coval <philippe.coval at osg.samsung.com>
---
...DFLAGS-variable-from-env-and-add-pthread-.patch | 50 ++++++++++++++++++++++
.../iotivity-sensorboard_1.0.0.bb | 1 +
2 files changed, 51 insertions(+)
create mode 100644 recipes-apps/iotivity-sensorboard/files/0001-Build-Use-LDFLAGS-variable-from-env-and-add-pthread-.patch
diff --git a/recipes-apps/iotivity-sensorboard/files/0001-Build-Use-LDFLAGS-variable-from-env-and-add-pthread-.patch b/recipes-apps/iotivity-sensorboard/files/0001-Build-Use-LDFLAGS-variable-from-env-and-add-pthread-.patch
new file mode 100644
index 0000000..cb3b16d
--- /dev/null
+++ b/recipes-apps/iotivity-sensorboard/files/0001-Build-Use-LDFLAGS-variable-from-env-and-add-pthread-.patch
@@ -0,0 +1,50 @@
+From c6fc833f4ce28c2a811fa1077f5e0975eadc4a23 Mon Sep 17 00:00:00 2001
+From: Philippe Coval <philippe.coval at osg.samsung.com>
+Date: Tue, 13 Sep 2016 18:14:07 +0200
+Subject: [PATCH] Build: Use LDFLAGS variable from env and add -pthread flag
+
+Without this change and error on linkage is displayed :
+
+ ld: observer.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
+ libpthread.so.0: error adding symbols: DSO missing from command line
+ collect2: error: ld returned 1 exit status
+
+Also YOCTOLDFLAGS are replaced with regular LDFLAGS,
+to use quality check.
+
+Without this, QA check is failing and this message is reported:
+
+ do_package_qa: QA Issue: No GNU_HASH in the elf binary:
+
+Change-Id: I2f73b1c09908be38a9053943a894832519312751
+Bug: https://jira.iotivity.org/browse/IOT-1111
+Origin: https://github.com/TizenTeam/meta-oic
+Signed-off-by: Philippe Coval <philippe.coval at osg.samsung.com>
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index e78b777..5d09cc1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,7 @@
+ YOCTOCXXFLAGS=-I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/iotivity/resource/ -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/iotivity/resource/stack -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/iotivity/resource/ocrandom -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/iotivity/resource/logger -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/iotivity/resource/oc_logger
+
+ YOCTOLDFLAGS=-loc -loctbstack -loc_logger -lmraa
++YOCTOLDFLAGS+=-pthread
+
+ all: sensorboard
+
+@@ -12,7 +13,7 @@ endif
+ $(CXX) -std=c++0x -c -o $@ $< $(YOCTOCXXFLAGS)
+
+ sensorboard: server.o observer.o
+- $(CXX) -o sensorboard server.o observer.o $(YOCTOLDFLAGS)
++ $(CXX) -o $@ $^ $(LDFLAGS) $(YOCTOLDFLAGS)
+
+ clean:
+ rm -rf sensorboard *.o
+--
+1.9.1
+
diff --git a/recipes-apps/iotivity-sensorboard/iotivity-sensorboard_1.0.0.bb b/recipes-apps/iotivity-sensorboard/iotivity-sensorboard_1.0.0.bb
index 71518bd..828c81e 100644
--- a/recipes-apps/iotivity-sensorboard/iotivity-sensorboard_1.0.0.bb
+++ b/recipes-apps/iotivity-sensorboard/iotivity-sensorboard_1.0.0.bb
@@ -7,6 +7,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://server.cpp;beginline=1;endline=19;md5=a692dd0c72bcfa341a4ba826b37caf15"
SRC_URI = "file://iotivity-sensorboard.tar.gz \
+ file://0001-Build-Use-LDFLAGS-variable-from-env-and-add-pthread-.patch \
"
S = "${WORKDIR}/iotivity-sensorboard"
--
1.9.1
More information about the yocto
mailing list