aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-04-19 14:08:01 -0700
committerKhem Raj <raj.khem@gmail.com>2022-04-20 10:58:01 -0700
commit47d2307ae77e347674a2d99d32d17fd5537a8a9f (patch)
tree2d4a99954acb33dce3dd50c75c7e1c4bd2c0085e /meta-networking
parent5a52bffde19bab1f049bd0398fc95c53c69e3711 (diff)
downloadmeta-openembedded-47d2307ae77e347674a2d99d32d17fd5537a8a9f.tar.gz
ot-br-posix: Fix build with gcc
Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Stefan Schmidt <stefan.schmidt@huawei.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch40
-rw-r--r--meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch b/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch
new file mode 100644
index 0000000000..f0bb392a9f
--- /dev/null
+++ b/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch
@@ -0,0 +1,40 @@
+From aa706d714294b83db696de2beca9a722a512796f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 Apr 2022 14:04:40 -0700
+Subject: [PATCH] cmake: Disable nonnull-compare warning on gcc
+
+GCC finds a legit warning which clang does not on code like this
+
+class Message;
+void SendResponse(Message & aMessage)
+{
+ if ((&aMessage) != nullptr) { return; }
+}
+
+Perhaps it should be fixed upstream but for now disable treating this
+warning as error when using gcc
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 59a567e729..3134740ff6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -57,6 +57,10 @@ endif()
+
+ set(CMAKE_CXX_EXTENSIONS OFF)
+
++if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
++ add_compile_options(-Wno-error=nonnull-compare)
++endif()
++
+ if (OTBR_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+ message(STATUS "Coverage: ON")
+ target_compile_options(otbr-config INTERFACE -g -O0 --coverage)
+--
+2.36.0
+
diff --git a/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb b/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb
index c1af388627..a16b77849e 100644
--- a/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb
+++ b/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb
@@ -16,6 +16,7 @@ PV = "0.3.0+git${SRCPV}"
SRC_URI = "gitsm://github.com/openthread/ot-br-posix.git;protocol=https;branch=main \
file://0001-otbr-agent.service.in-remove-pre-exec-hook-for-mdns-.patch \
+ file://0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch \
"
S = "${WORKDIR}/git"