Skip to contentSkip to conversation

package/olsr: fix build with GCC >= 15

PATCH Applied Thomas Petazzoni via buildroot 1 participant 3 messages Aug 26 – Sep 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/olsr: fix build with GCC >= 15

This commit introduces a patch, submitted upstream, that fixes the build of OLSR with GCC >= 15.

Fixes:

https://autobuild.buildroot.net/results/650edf74dec513ad540f80f4d3ef8c8222dfd711/

---
 ...es.h-fix-boolean-type-check-with-C23.patch | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/olsr/0007-src-olsr_types.h-fix-boolean-type-check-with-C23.patch
package/olsr/0007-src-olsr_types.h-fix-boolean-type-check-with-C23.patch new file +35 -0
new file mode 100644
index 0000000000..dbb167fe96
@@ -0,0 +1,35 @@
+From 6d7aab6d01ffa68f79b0b238d812a074051d94c4 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 26 Aug 2026 00:00:00 +0000
+Subject: [PATCH] src/olsr_types.h: fix boolean type check with C23
+
+GCC 15 defaults to GNU C23. In C23, bool, true and false are keywords,
+and <stdbool.h> no longer defines __bool_true_false_are_defined. Therefore
+the existing preprocessor check incorrectly rejects a valid C23 environment.
+
+Keep the check for older C standards, where these identifiers must be
+provided as macros by <stdbool.h> or by the GNU C fallback.
+
+Upstream: https://github.com/OLSR/olsrd/pull/139
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/olsr_types.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/olsr_types.h b/src/olsr_types.h
+index 36d2b723..ce2a0559 100644
+--- a/src/olsr_types.h
++++ b/src/olsr_types.h
+@@ -82,7 +82,8 @@ typedef signed int int32_t;
+ 
+ /* add some safe-gaurds */
+ #ifndef _MSC_VER
+-#if !defined bool || !defined true || !defined false || !defined __bool_true_false_are_defined
++#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 202311L) && \
++    (!defined bool || !defined true || !defined false || !defined __bool_true_false_are_defined)
+ #error You have no C99-like boolean types. Please extend src/olsr_type.h!
+ #endif /* !defined bool || !defined true || !defined false || !defined __bool_true_false_are_defined */
+ #endif /* _MSC_VER */
+-- 
+2.55.0
+
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · Thomas Petazzoni via buildroot

This commit introduces a patch, submitted upstream, that fixes the build of OLSR with GCC >= 15.

Fixes:

https://autobuild.buildroot.net/results/650edf74dec513ad540f80f4d3ef8c8222dfd711/

Applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Thomas Petazzoni via buildroot

In reply of:

Quoted 8 lines

This commit introduces a patch, submitted upstream, that fixes the build of OLSR with GCC >= 15.

Fixes:

https://autobuild.buildroot.net/results/650edf74dec513ad540f80f4d3ef8c8222dfd711/

Applied to 2026.05.x. Thanks

Quoted 53 lines
---
 ...es.h-fix-boolean-type-check-with-C23.patch | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/olsr/0007-src-olsr_types.h-fix-boolean-type-check-with-C23.patch
package/olsr/0007-src-olsr_types.h-fix-boolean-type-check-with-C23.patch new file +35 -0
new file mode 100644
index 0000000000..dbb167fe96
@@ -0,0 +1,35 @@
+From 6d7aab6d01ffa68f79b0b238d812a074051d94c4 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 26 Aug 2026 00:00:00 +0000
+Subject: [PATCH] src/olsr_types.h: fix boolean type check with C23
+
+GCC 15 defaults to GNU C23. In C23, bool, true and false are keywords,
+and <stdbool.h> no longer defines __bool_true_false_are_defined. Therefore
+the existing preprocessor check incorrectly rejects a valid C23 environment.
+
+Keep the check for older C standards, where these identifiers must be
+provided as macros by <stdbool.h> or by the GNU C fallback.
+
+Upstream: https://github.com/OLSR/olsrd/pull/139
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/olsr_types.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/olsr_types.h b/src/olsr_types.h
+index 36d2b723..ce2a0559 100644
+--- a/src/olsr_types.h
++++ b/src/olsr_types.h
+@@ -82,7 +82,8 @@ typedef signed int int32_t;
+ 
+ /* add some safe-gaurds */
+ #ifndef _MSC_VER
+-#if !defined bool || !defined true || !defined false || !defined __bool_true_false_are_defined
++#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 202311L) && \
++    (!defined bool || !defined true || !defined false || !defined __bool_true_false_are_defined)
+ #error You have no C99-like boolean types. Please extend src/olsr_type.h!
+ #endif /* !defined bool || !defined true || !defined false || !defined __bool_true_false_are_defined */
+ #endif /* _MSC_VER */
+-- 
+2.55.0
+
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot