[Buildroot] [git commit] package/rtl_433: fix build with gcc 4.8

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Dec 26 15:00:10 UTC 2021


commit: https://git.buildroot.net/buildroot/commit/?id=7ee6c37939f7413a953f6d2575d5757f682b23c0
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix the following build failure with gcc 4.8 raised since bump to
version 21.12 in commit 84b29ef40baf408b8b22085b336967aca83212db:

arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Wimplicit-fallthrough'

Fixes:
 - http://autobuild.buildroot.org/results/bea144f267215cd2dc27f235d6e3fb0adedb33ea

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 ...001-minor-Fix-a-compiler-flag-needs-GCC-7.patch | 27 +++++++++++++++++
 ...parse.c-fix-build-without-__has_attribute.patch | 34 ++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/package/rtl_433/0001-minor-Fix-a-compiler-flag-needs-GCC-7.patch b/package/rtl_433/0001-minor-Fix-a-compiler-flag-needs-GCC-7.patch
new file mode 100644
index 0000000000..dd3debf7ee
--- /dev/null
+++ b/package/rtl_433/0001-minor-Fix-a-compiler-flag-needs-GCC-7.patch
@@ -0,0 +1,27 @@
+From 2010e8f949ab7b4555b99dbf184e149a3f33df46 Mon Sep 17 00:00:00 2001
+From: "Christian W. Zuckschwerdt" <christian at zuckschwerdt.org>
+Date: Fri, 24 Dec 2021 11:03:06 +0100
+Subject: [PATCH] minor: Fix a compiler flag needs GCC 7
+
+[Retrieved from:
+https://github.com/merbanan/rtl_433/commit/2010e8f949ab7b4555b99dbf184e149a3f33df46]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a3f11ac99..bfa6595ca 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -74,7 +74,9 @@ if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" MATCHES
+     ADD_DEFINITIONS(-pedantic)
+     ADD_DEFINITIONS(-Wshadow)
+     ADD_DEFINITIONS(-Wmissing-prototypes)
+-    ADD_DEFINITIONS(-Wimplicit-fallthrough)
++    if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang" OR NOT "7.0.0" VERSION_GREATER CMAKE_C_COMPILER_VERSION)
++        ADD_DEFINITIONS(-Wimplicit-fallthrough)
++    endif()
+     #ADD_DEFINITIONS(-Wfloat-equal)
+     #ADD_DEFINITIONS(-Wbad-function-cast)
+     #ADD_DEFINITIONS(-Wdocumentation)
diff --git a/package/rtl_433/0002-src-optparse.c-fix-build-without-__has_attribute.patch b/package/rtl_433/0002-src-optparse.c-fix-build-without-__has_attribute.patch
new file mode 100644
index 0000000000..683754845f
--- /dev/null
+++ b/package/rtl_433/0002-src-optparse.c-fix-build-without-__has_attribute.patch
@@ -0,0 +1,34 @@
+From 1b74826f155406f86846d5c97b3534aab87cf6da Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+Date: Sun, 26 Dec 2021 15:21:39 +0100
+Subject: [PATCH] src/optparse.c: fix build without __has_attribute
+
+Fix build failure without __has_attribute (e.g. gcc 4.8) which is raised
+since
+https://github.com/merbanan/rtl_433/commit/6c8af75c757712bd58b169317795484a72e9a16c
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+[Upstream status: https://github.com/merbanan/rtl_433/pull/1918]
+---
+ src/optparse.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/optparse.c b/src/optparse.c
+index aa3d0b53..b5e2d37e 100644
+--- a/src/optparse.c
++++ b/src/optparse.c
+@@ -232,9 +232,11 @@ int atoi_time(char const *str, char const *error_hint)
+             }
+             // intentional fallthrough
+ #if defined(__GNUC__) || defined(__clang__)
++#if defined __has_attribute
+ #if __has_attribute(fallthrough)
+             __attribute__((fallthrough));
+ #endif
++#endif
+ #endif
+         case ':':
+             ++colons;
+-- 
+2.33.0
+



More information about the buildroot mailing list