Skip to contentSkip to conversation

srecord: fix build failure with gcc-15

PATCH New [email protected] 1 participant 1 message Apr 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 srecord: fix build failure with gcc-15

From: "mark.yang" <[email protected]>

srecord/input/file/hp64k.h:82:21: error: ‘uint16_t’ has not been declared

   82 |     bool read_u16be(uint16_t *dest);
      |                     ^~~~~~~~
/home/abuild/rpmbuild/BUILD/srecord-1.65.0-build/srecord-1.65.0-Source/./srecord/input/file/hp64k.h:1:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
  +++ |+#include <cstdint>
    1 | //

make[2]: *** [srecord/CMakeFiles/lib_srecord.dir/build.make:222: srecord/CMakeFiles/lib_srecord.dir/arglex/tool/input.cc.o] Error 1

* From gcc 13, cstdint header must be explicitly included for uint_X data types.
* See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes

---
 ...e-with-gcc-15-by-adding-cstdint-head.patch | 36 +++++++++++++++++++
 .../recipes-support/srecord/srecord_1.65.0.bb |  4 ++-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/srecord/files/0001-fix-build-failure-with-gcc-15-by-adding-cstdint-head.patch
meta-oe/recipes-support/srecord/files/0001-fix-build-failure-with-gcc-15-by-adding-cstdint-head.patch new file +36 -0
new file mode 100644
index 0000000000..fe55fc5c87
@@ -0,0 +1,36 @@
+From 69290e4d727492a63a2a4424368a476b86ef8183 Mon Sep 17 00:00:00 2001
+From: "mark.yang" <[email protected]>
+Date: Mon, 7 Apr 2025 17:18:34 +0900
+Subject: [PATCH] fix build failure with gcc 15 by adding cstdint header
+
+Fixes #79
+
+srecord/input/file/hp64k.h:82:21: error: ‘uint16_t’ has not been declared
+   82 |     bool read_u16be(uint16_t *dest);
+      |                     ^~~~~~~~
+/home/abuild/rpmbuild/BUILD/srecord-1.65.0-build/srecord-1.65.0-Source/./srecord/input/file/hp64k.h:1:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
+  +++ |+#include <cstdint>
+    1 | //
+make[2]: *** [srecord/CMakeFiles/lib_srecord.dir/build.make:222: srecord/CMakeFiles/lib_srecord.dir/arglex/tool/input.cc.o] Error 1
+
+    * From gcc 13, cstdint header must be explicitly included for uint_X data types.
+    * See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Submitted [https://github.com/sierrafoxtrot/srecord/pull/80]
+Signed-off-by: mark.yang <[email protected]>
+---
+ srecord/input/file/hp64k.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/srecord/input/file/hp64k.h b/srecord/input/file/hp64k.h
+index a3f8a6d..205e1e4 100644
+--- a/srecord/input/file/hp64k.h
++++ b/srecord/input/file/hp64k.h
+@@ -21,6 +21,7 @@
+ #define LIB_INPUT_FILE_HP64K
+ 
+ #include <srecord/input/file.h>
++#include <cstdint>
+ 
+ namespace srecord {
+ 
meta-oe/recipes-support/srecord/srecord_1.65.0.bb +3 -1
index 3e8a87d07f..b4294975bd 100644
@@ -7,7 +7,9 @@ SRC_URI = " \
     https://sourceforge.net/projects/${BPN}/files/srecord/${@oe.utils.trim_version('${PV}', 2)}/${BP}-Source.tar.gz \
     file://0001-Disable-doxygen.patch \
     file://0001-cmake-Do-not-try-to-compute-library-dependencies-dur.patch \
-    file://0001-cmake-respect-explicit-install-prefix.patch"
+    file://0001-cmake-respect-explicit-install-prefix.patch \
+    file://0001-fix-build-failure-with-gcc-15-by-adding-cstdint-head.patch \
+"
 SRC_URI[sha256sum] = "81c3d07cf15ce50441f43a82cefd0ac32767c535b5291bcc41bd2311d1337644"
 S = "${WORKDIR}/${BP}-Source"