[Buildroot] [PATCH 1/1] package/rwmem: fix build with gcc 13

Fabrice Fontaine fontaine.fabrice at gmail.com
Sun Oct 1 14:37:08 UTC 2023


Fix the following build failure with gcc 13:

In file included from ../librwmem/itarget.h:3,
                 from ../librwmem/i2ctarget.h:4,
                 from ../librwmem/i2ctarget.cpp:1:
../librwmem/helpers.h:51:39: error: 'uint64_t' has not been declared
   51 | int parse_u64(const std::string& str, uint64_t* value);
      |                                       ^~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/38f6d0fb007c3dc3c21243721395f85649442407

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 .../rwmem/0001-include-missing-cstdint.patch  | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/rwmem/0001-include-missing-cstdint.patch

diff --git a/package/rwmem/0001-include-missing-cstdint.patch b/package/rwmem/0001-include-missing-cstdint.patch
new file mode 100644
index 0000000000..d8369d0739
--- /dev/null
+++ b/package/rwmem/0001-include-missing-cstdint.patch
@@ -0,0 +1,30 @@
+From 84e884f99e581515b49d8973538bb17e1e6c0dc0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Thu, 26 Jan 2023 20:45:57 -0800
+Subject: [PATCH] include missing <cstdint>
+
+gcc 13 moved some includes around and as a result <cstdint> is no
+longer transitively included [1]. Explicitly include it for
+uint{32,64}_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+Upstream: https://github.com/tomba/rwmem/commit/84e884f99e581515b49d8973538bb17e1e6c0dc0
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+---
+ librwmem/helpers.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/librwmem/helpers.h b/librwmem/helpers.h
+index a0a738b..8d02c9c 100644
+--- a/librwmem/helpers.h
++++ b/librwmem/helpers.h
+@@ -1,6 +1,7 @@
+ #pragma once
+ 
+ #include <cerrno>
++#include <cstdint>
+ #include <string>
+ #include <vector>
+ #include <string.h>
-- 
2.40.1




More information about the buildroot mailing list