[Buildroot] [git commit branch/2025.02.x] package/ledmon: add upstream patch to fix build w/ gcc-14

Arnout Vandecappelle arnout at rnout.be
Thu Oct 30 07:55:58 UTC 2025


commit: https://git.buildroot.net/buildroot/commit/?id=ff54fd9c756bce8106a99796402e691118fbcf89
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2025.02.x

Add an upstream patch to fix a build issue related to uint64_t:

utils.c: In function ‘get_uint64’:
utils.c:118:18: error: passing argument 1 of ‘str_toul’ from incompatible pointer type [-Wincompatible-pointer-types]
  118 |         str_toul(&defval, p, NULL, 16);
      |                  ^~~~~~~
      |                  |
      |                  uint64_t * {aka long long unsigned int *}
In file included from utils.c:48:
utils.h:412:29: note: expected ‘long unsigned int *’ but argument is of type ‘uint64_t *’ {aka ‘long long unsigned int *’}

Fixes:

  https://autobuild.buildroot.org/results/51af1d7bf71061f22d49213951a5f6a9565710c3/

Signed-off-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
Signed-off-by: Julien Olivain <ju.o at free.fr>
(cherry picked from commit c8923662cc7e1f0a1d30d0926f979c21d36aa9df)
Signed-off-by: Thomas Perale <thomas.perale at mind.be>
---
 package/ledmon/0003-Correct-get_uint64.patch | 43 ++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/package/ledmon/0003-Correct-get_uint64.patch b/package/ledmon/0003-Correct-get_uint64.patch
new file mode 100644
index 0000000000..2db4c04a6e
--- /dev/null
+++ b/package/ledmon/0003-Correct-get_uint64.patch
@@ -0,0 +1,43 @@
+From ed747ac3540cb38797f56533f9f51f5627e6b994 Mon Sep 17 00:00:00 2001
+From: Tony Asleson <tasleson at redhat.com>
+Date: Wed, 21 Aug 2024 12:27:28 -0500
+Subject: [PATCH] Correct get_uint64
+
+For large integer values, the existing implementation will be
+incorrect.
+
+The current implementation of converting strings to integer values
+uses a signed integer for the intermediate conversion and performs
+a range check. Since any value in an unsigned 64-bit integer is valid,
+the range check seems unnecessary. To mimic the same code path, we would
+need a larger integer type.
+
+Signed-off-by: Tony Asleson <tasleson at redhat.com>
+Signed-off-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
+Upstream: https://github.com/intel/ledmon/commit/ed747ac3540cb38797f56533f9f51f5627e6b994
+---
+ src/lib/utils.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/utils.c b/src/lib/utils.c
+index a7936c69b242..a6ee29ba7f22 100644
+--- a/src/lib/utils.c
++++ b/src/lib/utils.c
+@@ -98,8 +98,12 @@ uint64_t get_uint64(const char *path, uint64_t defval, const char *name)
+ 	if (!p)
+ 		return defval;
+ 
+-	str_toul(&defval, p, NULL, 16);
+-	return defval;
++	errno = 0;
++	uint64_t t = strtoull(p, NULL, 16);
++
++	if (errno)
++		return defval;
++	return t;
+ }
+ 
+ int get_int(const char *path, int defval, const char *name)
+-- 
+2.43.0
+


More information about the buildroot mailing list