Skip to contentSkip to conversation

opensaf: Upgrade to 5.2.0

PATCH New Khem Raj 1 participant 1 message Apr 26, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 opensaf: Upgrade to 5.2.0

Fix build with gcc7

---
v1 -> v2:
- Remove unwanted .service file associations

 .../opensaf/0001-Remove-unused-variables.patch     |  43 +++++++
 ...isable-format-overflow-if-supported-by-gc.patch | 127 +++++++++++++++++++++
 ...gure-Pass-linker-specific-options-with-Wl.patch |  29 +++++
 .../opensaf/opensaf/0001-plmcd-error-fix.patch     |  43 -------
 .../opensaf/install-samples-from-srcdir.patch      |  11 --
 .../opensaf/{opensaf_5.0.0.bb => opensaf_5.2.0.bb} |  37 +++---
 6 files changed, 215 insertions(+), 75 deletions(-)
 create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-Remove-unused-variables.patch
 create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
 create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
 delete mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch
 delete mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/install-samples-from-srcdir.patch
 rename meta-networking/recipes-daemons/opensaf/{opensaf_5.0.0.bb => opensaf_5.2.0.bb} (67%)
meta-networking/recipes-daemons/opensaf/opensaf/0001-Remove-unused-variables.patch new file +43 -0
new file mode 100644
index 000000000..1c88b81cd
@@ -0,0 +1,43 @@
+From a441a75fbb8451268a8a57616c7158cddc1823aa Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 22 Apr 2017 12:40:19 -0700
+Subject: [PATCH] Remove unused variables
+
+Fixes build errors with gcc7 e.g.
+
+../opensaf-5.2.0/src/amf/amfd/imm.cc: In member function 'bool ImmObjCreate::immobj_update_required()':
+../opensaf-5.2.0/src/amf/amfd/imm.cc:2174:28: error: unused variable 'pos' [-Werror=unused-variable]
+     std::string::size_type pos;
+                            ^~~
+../opensaf-5.2.0/src/amf/amfd/imm.cc:2215:28: error: unused variable 'pos' [-Werror=unused-variable]
+     std::string::size_type pos;
+                            ^~~
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/amf/amfd/imm.cc | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/amf/amfd/imm.cc b/src/amf/amfd/imm.cc
+index 7932364..4f47b65 100644
+--- a/src/amf/amfd/imm.cc
++++ b/src/amf/amfd/imm.cc
+@@ -2171,7 +2171,6 @@ bool ImmObjCreate::immobj_update_required() {
+   if (class_type == AVSV_SA_AMF_SI_ASSIGNMENT) {
+     std::string su_name;
+     std::string sisu_name;
+-    std::string::size_type pos;
+     while ((attribute = attrValues_[i++]) != nullptr) {
+       if (!strcmp(attribute->attrName, "safSISU")) {
+         sisu_name = Amf::to_string(
+@@ -2212,7 +2211,6 @@ bool ImmObjCreate::immobj_update_required() {
+   } else if (class_type == AVSV_SA_AMF_CSI_ASSIGNMENT) {
+     std::string comp_name;
+     std::string csicomp_name;
+-    std::string::size_type pos;
+     AVD_CSI *csi = nullptr;
+     AVD_COMP *comp = nullptr;
+     AVD_COMP_CSI_REL *compcsi = nullptr;
+-- 
+2.12.2
+
meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch new file +127 -0

127 lines not on this page · raw message

meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch new file +29 -0
new file mode 100644
index 000000000..5756a027b
@@ -0,0 +1,29 @@
+From 6248b717b4861d16b80235fd8e57d64e4f636428 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 13 Apr 2017 17:39:07 -0700
+Subject: [PATCH] configure: Pass linker specific options with -Wl
+
+This helps make it pass the options to linker correctly
+and we can use non-gcc compilers
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index df4fc58..02771c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -553,7 +553,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ 	if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then
+ 		OSAF_HARDEN_FLAGS=""
+ 	fi
+-	OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -zrelro -znow"
++	OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now"
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+ 
+-- 
+2.12.2
+
meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch deleted +0 -43

43 lines not on this page · raw message

meta-networking/recipes-daemons/opensaf/opensaf/install-samples-from-srcdir.patch deleted +0 -11
deleted file mode 100644
index 016b64f2e..000000000
@@ -1,11 +0,0 @@
---- opensaf-4.5.0.orig/Makefile.am	2014-12-31 14:45:54.088797989 +0800
-+++ opensaf-4.5.0/Makefile.am	2014-12-31 14:45:08.328796688 +0800
-@@ -219,7 +219,7 @@ install-data-local:
- 	$(mkinstalldirs) $(DESTDIR)$(pkgpiddir)
- 	$(mkinstalldirs) $(DESTDIR)$(lockdir)
- 	$(mkinstalldirs) $(DESTDIR)$(pkglocalstatedir)
--	cp -R samples/ $(DESTDIR)$(pkgdatadir)
-+	cp -R $(srcdir)/samples/ $(DESTDIR)$(pkgdatadir)
- 
- install-data-hook:
- 	@for i in $$(grep -lr -e 'xxLIBDIRxx' -e 'xxLOGDIRxx' -e 'xxCLCCLIDIRxx' $(DESTDIR)$(pkgimmxml_svcdir)/*.xml) ; do \
meta-networking/recipes-daemons/opensaf/opensaf_5.2.0.bb renamed from meta-networking/recipes-daemons/opensaf/opensaf_5.0.0.bb +16 -21
similarity index 67%
rename from meta-networking/recipes-daemons/opensaf/opensaf_5.0.0.bb
rename to meta-networking/recipes-daemons/opensaf/opensaf_5.2.0.bb
index 6ceb225e9..babf03e09 100644
@@ -15,14 +15,17 @@ LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
 
 DEPENDS = "libxml2 python"
+TOOLCHAIN = "gcc"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
-           file://install-samples-from-srcdir.patch \
-           file://0001-plmcd-error-fix.patch \
-           "
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
 
-SRC_URI[md5sum] = "94cd1a4c0406e6a45bb04c003f8690e7"
-SRC_URI[sha256sum] = "4b4188a0f3d0ed1ed0e3d77de27c45e2c96b437401de08e7df2ed9ecd54bb999"
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
+           file://0001-configure-Pass-linker-specific-options-with-Wl.patch \
+           file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
+           file://0001-Remove-unused-variables.patch \
+"
+SRC_URI[md5sum] = "08991fd467ae9dcea3c8747be8e3981e"
+SRC_URI[sha256sum] = "903478244afe37e329be93050f1d48fa18c84ea17862134c4217b920e267a04a"
 
 inherit autotools useradd systemd pkgconfig
 
@@ -30,37 +33,29 @@ USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "-f -r opensaf"
 USERADD_PARAM_${PN} =  "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
 
-SYSTEMD_SERVICE_${PN} += "opensafd.service plmcboot.service plmcd.service"
+SYSTEMD_SERVICE_${PN} += "opensafd.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
-PACKAGECONFIG[systemd] = "--enable-systemd-daemon"
+PACKAGECONFIG[systemd] = ",,systemd"
 PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03 --enable-ais-plm,,openhpi"
 
-EXTRA_OECONF += " --libdir=${libdir}/opensaf "
-EXTRA_OEMAKE += " -Wl,-rpath,${libdir}/opensaf "
+PACKAGECONFIG_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
 
-PKGLIBDIR="${libdir}/opensaf/opensaf"
-
-do_configure_prepend () {
-        ( cd ${S}; autoreconf -f -i -s )
-}
+PKGLIBDIR="${libdir}"
 
 do_install_append() {
+    cp -av --no-preserve=ownership ${B}/lib/.libs/*.so* ${D}${libdir}
     rm -fr "${D}${localstatedir}/lock"
     rm -fr "${D}${localstatedir}/run"
     rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${B}/osaf/services/infrastructure/nid/config/opensafd.service \
-        ${D}${systemd_unitdir}/system
-    install -m 0644 ${B}/contrib/plmc/config/*.service ${D}/${systemd_unitdir}/system
-
+    rmdir --ignore-fail-on-non-empty "${D}${datadir}/java"
     if [ ! -d "${D}${sysconfdir}/init.d" ]; then
         install -d ${D}${sysconfdir}/init.d
         install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/
     fi
 }
 
-FILES_${PN} += "${localstatedir}/run ${systemd_unitdir}/system/*.service"
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
 FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a"
 
 INSANE_SKIP_${PN} = "dev-so"
Signature · 1 line
2.12.2