summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-04-12 17:19:44 -0700
committerKhem Raj <raj.khem@gmail.com>2022-04-13 19:21:41 -0700
commit83b283c5282cfef7e5b6339852cf126bacb82bd3 (patch)
treea7b490b6de9e7a51c93e97548494008b9f554a8b /meta-networking/recipes-daemons
parentee3b2e19a6fdc63155699801056d884bd6d396dd (diff)
downloadmeta-openembedded-83b283c5282cfef7e5b6339852cf126bacb82bd3.tar.gz
opensaf: Fix build with gcc 12
Use configure logic to disable certain warnings if compiler supports them Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-daemons')
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0001-include-missing-array-header.patch32
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0002-configure-Disable-selected-warnings.patch28
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf_5.22.01.bb6
3 files changed, 64 insertions, 2 deletions
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0001-include-missing-array-header.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0001-include-missing-array-header.patch
new file mode 100644
index 000000000..e735d432a
--- /dev/null
+++ b/meta-networking/recipes-daemons/opensaf/opensaf/0001-include-missing-array-header.patch
@@ -0,0 +1,32 @@
1From 6168d43ddd353b92ad8bcd5c49dc68f18caa8a00 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 12 Apr 2022 17:07:49 -0700
4Subject: [PATCH 1/2] include missing <array> header
5
6Fixes
7src/osaf/consensus/key_value.cc:25:30: error: aggregate 'std::array<char, 128> buffer' has incomplete type and cannot be defined
8 25 | std::array<char, buf_size> buffer;
9 | ^~~~~~
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/osaf/consensus/key_value.cc | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/src/osaf/consensus/key_value.cc b/src/osaf/consensus/key_value.cc
18index 692dd3f..6e16cbf 100644
19--- a/src/osaf/consensus/key_value.cc
20+++ b/src/osaf/consensus/key_value.cc
21@@ -18,7 +18,7 @@
22 #include "base/getenv.h"
23 #include "base/logtrace.h"
24 #include "osaf/consensus/consensus.h"
25-
26+#include <array>
27 int KeyValue::Execute(const std::string& command, std::string& output) {
28 TRACE_ENTER();
29 constexpr size_t buf_size = 128;
30--
312.35.1
32
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0002-configure-Disable-selected-warnings.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0002-configure-Disable-selected-warnings.patch
new file mode 100644
index 000000000..a9953259c
--- /dev/null
+++ b/meta-networking/recipes-daemons/opensaf/opensaf/0002-configure-Disable-selected-warnings.patch
@@ -0,0 +1,28 @@
1From fe654d5340d18f04e4689ba19f843554909a0c00 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 12 Apr 2022 17:16:37 -0700
4Subject: [PATCH 2/2] configure: Disable selected warnings
5
6These warnings are emitted when compiling with gcc 11 and gcc 12
7Do not treat them as errors
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 configure.ac | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15--- a/configure.ac
16+++ b/configure.ac
17@@ -601,7 +601,10 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
18 fi
19 AC_SUBST(OSAF_HARDEN_FLAGS)
20
21-AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS=-Wno-error=format-overflow])
22+AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS='-Wno-error=format-overflow'])
23+AX_CHECK_COMPILE_FLAG([-Wuse-after-free],[NOWARNINGS+=' -Wno-error=use-after-free'])
24+AX_CHECK_COMPILE_FLAG([-Wstringop-truncation],[NOWARNINGS+=' -Wno-error=stringop-truncation'])
25+AX_CHECK_COMPILE_FLAG([-Warray-bounds],[NOWARNINGS+=' -Wno-error=array-bounds'])
26 AC_SUBST(NOWARNINGS)
27 #############################################
28 # List the output Makefiles
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf_5.22.01.bb b/meta-networking/recipes-daemons/opensaf/opensaf_5.22.01.bb
index 8ce324d30..930755d62 100644
--- a/meta-networking/recipes-daemons/opensaf/opensaf_5.22.01.bb
+++ b/meta-networking/recipes-daemons/opensaf/opensaf_5.22.01.bb
@@ -28,6 +28,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
28 file://0001-immom_python-convert-to-python3.patch \ 28 file://0001-immom_python-convert-to-python3.patch \
29 file://0001-Fix-build-with-fno-common.patch \ 29 file://0001-Fix-build-with-fno-common.patch \
30 file://0001-Use-correct-printf-format-for-__fsblkcnt_t.patch \ 30 file://0001-Use-correct-printf-format-for-__fsblkcnt_t.patch \
31 file://0001-include-missing-array-header.patch \
32 file://0002-configure-Disable-selected-warnings.patch \
31 " 33 "
32SRC_URI[sha256sum] = "f008d53c83087ce2014c6089bc4ef08e14c1b4091298b943f4ceade1aa6bf61e" 34SRC_URI[sha256sum] = "f008d53c83087ce2014c6089bc4ef08e14c1b4091298b943f4ceade1aa6bf61e"
33 35
@@ -48,8 +50,8 @@ PACKAGECONFIG[plm] = "--enable-ais-plm,--disable-ais-plm,libvirt openhpi"
48 50
49PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" 51PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
50 52
51CPPFLAGS += "-Wno-error=stringop-overflow= -Wno-error=stringop-truncation" 53CPPFLAGS += "-Wno-error"
52CXXFLAGS += "-Wno-error=stringop-overflow= -Wno-error=stringop-truncation -Wno-error=format-truncation=" 54CXXFLAGS += "-Wno-error"
53LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed" 55LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
54 56
55do_install:append() { 57do_install:append() {