Skip to contentSkip to conversation

heaptrack: Update to latest tip of trunk

PATCH New Khem Raj 1 participant 4 messages Nov 11, 2025

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 heaptrack: Update to latest tip of trunk

* It has cmake 4 fixes
* Drop all patches, they are no more needed
* Fix build with glibc-2.43/c23
* Enabled on riscv64, since libunwind now supports it

---
 .../0001-libheaptrack-Fix-build-on-c23.patch  |  47 +++++++
 ...heaptrack-Replace-__pid_t-with-pid_t.patch |  26 ----
 ...-unw_set_caching_policy-before-using.patch |  41 ------
 ...t-Include-dlfcn.h-for-dlopen-dlclose.patch |  38 ------
 ...d-Make-noexcept-attribute-conditiona.patch | 118 ------------------
 ...04-backtrace-Always-include-stdint.h.patch |  42 -------
 .../heaptrack/heaptrack_1.2.0.bb              |  63 ----------
 .../heaptrack/heaptrack_1.5.0.bb              |  33 +++++
 8 files changed, 80 insertions(+), 328 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack/0001-libheaptrack-Fix-build-on-c23.patch
 delete mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack/0001-libheaptrack-Replace-__pid_t-with-pid_t.patch
 delete mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack/0001-track-Check-for-unw_set_caching_policy-before-using.patch
 delete mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack/0002-heaptrack_inject-Include-dlfcn.h-for-dlopen-dlclose.patch
 delete mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack/0003-heaptrack_preload-Make-noexcept-attribute-conditiona.patch
 delete mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack/0004-backtrace-Always-include-stdint.h.patch
 delete mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack_1.2.0.bb
 create mode 100644 meta-oe/recipes-devtools/heaptrack/heaptrack_1.5.0.bb
meta-oe/recipes-devtools/heaptrack/heaptrack/0001-libheaptrack-Fix-build-on-c23.patch new file +47 -0
new file mode 100644
index 0000000000..67669e2811
@@ -0,0 +1,47 @@
+From 5afb9b9267b59f60b53978858e21ec2369659de7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 10 Nov 2025 18:53:38 -0800
+Subject: [PATCH] libheaptrack: Fix build on c23
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+C23/glibc is now including once_init in stdlib.h
+
+https://patchwork.sourceware.org/project/glibc/patch/[email protected]/#213088
+
+This is a name collision with the new C once_flag/call_once that
+glibc exposes (via <stdlib.h>) and C++’s std::once_flag/std::call_once
+
+Fixes
+../sources/heaptrack-1.5.0+git/src/track/libheaptrack.cpp:301:16: error: reference to 'once_flag' is ambiguous
+  301 |         static once_flag once;
+      |                ^
+../recipe-sysroot/usr/include/bits/types/once_flag.h:24:21: note: candidate found by name lookup is 'once_flag'
+   24 | typedef __once_flag once_flag;
+      |                     ^
+../recipe-sysroot/usr/lib/aarch64-yoe-linux/15.2.0/../../../include/c++/15.2.0/mutex:809:10: note: candidate found by name lookup is 'std::once_flag'
+  809 |   struct once_flag
+      |          ^
+
+Upstream-Status: Submitted [https://invent.kde.org/sdk/heaptrack/-/merge_requests/56]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/track/libheaptrack.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/track/libheaptrack.cpp b/src/track/libheaptrack.cpp
+index 4be3dcd..f7576a2 100644
+--- a/src/track/libheaptrack.cpp
++++ b/src/track/libheaptrack.cpp
+@@ -298,8 +298,8 @@ public:
+         }
+
+         // do some once-only initializations
+-        static once_flag once;
+-        call_once(once, [] {
++        static std::once_flag once;
++        std::call_once(once, [] {
+             debugLog<MinimalOutput>("%s", "doing once-only initialization");
+
+             Trace::setup();
meta-oe/recipes-devtools/heaptrack/heaptrack/0001-libheaptrack-Replace-__pid_t-with-pid_t.patch deleted +0 -26
deleted file mode 100644
index 9681086a52..0000000000
@@ -1,26 +0,0 @@
-From 18671cd6028f996c138c6eb4282caf313f3fc605 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Mon, 23 Nov 2020 15:25:18 -0800
-Subject: [PATCH] libheaptrack: Replace __pid_t with pid_t
-
-__pid_t is for internal libc use
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
----
- src/track/libheaptrack.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/track/libheaptrack.cpp b/src/track/libheaptrack.cpp
-index e138bce..4120ecd 100644
---- a/src/track/libheaptrack.cpp
-+++ b/src/track/libheaptrack.cpp
-@@ -79,7 +79,7 @@ chrono::milliseconds elapsedTime()
-     return chrono::duration_cast<chrono::milliseconds>(clock::now() - startTime());
- }
-
--__pid_t gettid()
-+pid_t gettid()
- {
-     return syscall(SYS_gettid);
- }
meta-oe/recipes-devtools/heaptrack/heaptrack/0001-track-Check-for-unw_set_caching_policy-before-using.patch deleted +0 -41

41 lines not on this page · raw message

meta-oe/recipes-devtools/heaptrack/heaptrack/0002-heaptrack_inject-Include-dlfcn.h-for-dlopen-dlclose.patch deleted +0 -38
deleted file mode 100644
index 5fa802cb38..0000000000
@@ -1,38 +0,0 @@
-From 8ebcf5f2dd27dbeb6c81e9c40a5d17916cb243e6 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Mon, 23 Nov 2020 15:26:31 -0800
-Subject: [PATCH] heaptrack_inject: Include dlfcn.h for dlopen/dlclose
-
-Do not use __WORDSIZE which is for libc internal use
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
----
- src/track/heaptrack_inject.cpp | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/track/heaptrack_inject.cpp b/src/track/heaptrack_inject.cpp
-index 325d87e..fb1c154 100644
---- a/src/track/heaptrack_inject.cpp
-+++ b/src/track/heaptrack_inject.cpp
-@@ -28,6 +28,7 @@
- #include <link.h>
- #include <malloc.h>
- #include <unistd.h>
-+#include <dlfcn.h>
-
- #include <sys/mman.h>
-
-@@ -39,9 +40,10 @@
-  * @brief Experimental support for symbol overloading after runtime injection.
-  */
-
--#if __WORDSIZE == 64
-+#include <limits.h>
-+#if ULONG_MAX == 0xffffffffffffffff
- #define ELF_R_SYM(i) ELF64_R_SYM(i)
--#elif __WORDSIZE == 32
-+#elif ULONG_MAX == 0xffffffff
- #define ELF_R_SYM(i) ELF32_R_SYM(i)
- #else
- #error unsupported word size
meta-oe/recipes-devtools/heaptrack/heaptrack/0003-heaptrack_preload-Make-noexcept-attribute-conditiona.patch deleted +0 -118

118 lines not on this page · raw message

meta-oe/recipes-devtools/heaptrack/heaptrack/0004-backtrace-Always-include-stdint.h.patch deleted +0 -42

42 lines not on this page · raw message

meta-oe/recipes-devtools/heaptrack/heaptrack_1.2.0.bb deleted +0 -63

63 lines not on this page · raw message

meta-oe/recipes-devtools/heaptrack/heaptrack_1.5.0.bb new file +33 -0
new file mode 100644
index 0000000000..172a74fa6a
@@ -0,0 +1,33 @@
+SUMMARY = "Heap memory profiler for Linux"
+DESCRIPTION = "Heaptrack traces all memory allocations and annotates these \
+events with stack traces. Dedicated analysis tools then allow you to interpret \
+the heap memory profile to find hotspots to reduce memory, leaks, allocation \
+hotspots and temporary allocations"
+HOMEPAGE = "https://phabricator.kde.org/source/heaptrack/"
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://LICENSES/Apache-2.0.txt;md5=c846ebb396f8b174b10ded4771514fcc \
+                    file://LICENSES/BSD-3-Clause.txt;md5=f225922a2c12dfa5218fb70c49db3ea6 \
+                    file://LICENSES/BSL-1.0.txt;md5=4c66a2bad475d1a8f152667a4d0ada34 \
+                    file://LICENSES/GPL-2.0-or-later.txt;md5=3d26203303a722dedc6bf909d95ba815 \
+                    file://LICENSES/LGPL-2.1-only.txt;md5=41890f71f740302b785c27661123bff5 \
+                    file://LICENSES/LGPL-2.1-or-later.txt;md5=147a320ed8b16b036829a0c71d424153 \
+                    file://LICENSES/MIT.txt;md5=7dda4e90ded66ab88b86f76169f28663"
+
+DEPENDS = "zlib boost libunwind elfutils"
+
+SRC_URI = "git://github.com/KDE/heaptrack.git;protocol=https;branch=master \
+           file://0001-libheaptrack-Fix-build-on-c23.patch \
+		  "
+SRCREV = "0a15d643791e9829ef3f754ac10e3bed966152c5"
+PV .= "+git"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DHEAPTRACK_BUILD_GUI=OFF"
+
+# libunwind is not yet ported to RISCV32
+COMPATIBLE_HOST:riscv32 = "null"
+
+BBCLASSEXTEND = "native"
+
+TOOLCHAIN = "gcc"
author
#1 lore raw

PATCH 2/4 packagegroup-meta-oe: Enable heaptrack on riscv64

---
 meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb +1 -1
index 0458662f97..d7d6c08693 100644
@@ -311,7 +311,7 @@ RDEPENDS:packagegroup-meta-oe-devtools:remove:mips64el = "luajit nodejs"
 RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc = "android-tools breakpad lshw luajit uftrace"
 RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc64 = "android-tools breakpad lshw luajit ply uftrace"
 RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc64le = "android-tools breakpad lshw luajit ply uftrace"
-RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv64 = "breakpad concurrencykit heaptrack lshw ltrace luajit nodejs ply"
+RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv64 = "breakpad concurrencykit lshw ltrace luajit nodejs ply"
 RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv32 = "breakpad concurrencykit heaptrack lshw ltrace luajit nodejs ply uftrace"
 RDEPENDS:packagegroup-meta-oe-devtools:remove:libc-musl:riscv32 = "php"
 RDEPENDS:packagegroup-meta-oe-devtools:remove:aarch64 = "concurrencykit"
author
#2 lore raw

PATCH 3/4 snort3: Upgrade to 3.9.7.0

In reply to Khem Raj

Fix build with C23 glibc while here

---
 .../snort/snort3/0001-Fix-build-on-c23.patch  | 43 +++++++++++++++++++
 .../{snort3_3.9.1.0.bb => snort3_3.9.7.0.bb}  |  8 ++--
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 meta-networking/recipes-connectivity/snort/snort3/0001-Fix-build-on-c23.patch
 rename meta-networking/recipes-connectivity/snort/{snort3_3.9.1.0.bb => snort3_3.9.7.0.bb} (85%)
meta-networking/recipes-connectivity/snort/snort3/0001-Fix-build-on-c23.patch new file +43 -0
new file mode 100644
index 0000000000..884a4b8fe6
@@ -0,0 +1,43 @@
+From ae5566a7df4851bd47081ef0e00e2a0513b7f331 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 10 Nov 2025 19:41:16 -0800
+Subject: [PATCH] Fix build on c23
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+C23/glibc is now including once_init in stdlib.h
+
+https://patchwork.sourceware.org/project/glibc/patch/[email protected]/#213088
+
+This is a name collision with the new C once_flag/call_once that
+glibc exposes (via <stdlib.h>) and C++’s std::once_flag/std::call_once
+
+Upstream-Status: Submitted [https://github.com/snort3/snort3/pull/431]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/loggers/alert_fast.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/loggers/alert_fast.cc b/src/loggers/alert_fast.cc
+index 7b5deab2..3f88bff6 100644
+--- a/src/loggers/alert_fast.cc
++++ b/src/loggers/alert_fast.cc
+@@ -53,7 +53,7 @@ using namespace std;
+ #define FAST_BUF (4*K_BYTES)
+
+ static THREAD_LOCAL TextLog* fast_log = nullptr;
+-static once_flag init_flag;
++static std::once_flag init_flag;
+
+ #define S_NAME "alert_fast"
+ #define F_NAME S_NAME ".txt"
+@@ -319,7 +319,7 @@ void FastLogger::set_buffer_ids(Inspector* gadget)
+ const BufferIds& FastLogger::get_buffer_ids(Inspector* gadget, Packet* p)
+ {
+     // lazy init required because loggers don't have a configure (yet)
+-    call_once(init_flag, set_buffer_ids, gadget);
++    std::call_once(init_flag, set_buffer_ids, gadget);
+
+     InspectionBuffer buf;
+     const std::vector<unsigned>& idv =
meta-networking/recipes-connectivity/snort/snort3_3.9.7.0.bb renamed from meta-networking/recipes-connectivity/snort/snort3_3.9.1.0.bb +5 -3
similarity index 85%
rename from meta-networking/recipes-connectivity/snort/snort3_3.9.1.0.bb
rename to meta-networking/recipes-connectivity/snort/snort3_3.9.7.0.bb
index 598b1f4dfb..64a63ce918 100644
@@ -7,11 +7,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5"
 
 DEPENDS = "flex-native hwloc libdaq libdnet libpcap libpcre libtirpc libunwind luajit zlib"
 
-SRC_URI = "git://github.com/snort3/snort3.git;protocol=https;branch=master \
+SRC_URI = "git://github.com/snort3/snort3.git;protocol=https;branch=master;tag=${PV} \
            file://0001-cmake-Check-for-HP-libunwind.patch \
-           file://0001-cmake-Pass-noline-flag-to-flex.patch"
+           file://0001-cmake-Pass-noline-flag-to-flex.patch \
+		   file://0001-Fix-build-on-c23.patch \
+		  "
 
-SRCREV = "6730d53f99f3714654804d07203f33e6b1b8a107"
+SRCREV = "892f9f3b04d604797851d60e89d6cfe640a047cd"
 
 PACKAGES =+ "${PN}-scripts"
 
author
#3 lore raw

PATCH 4/4 libldb: Fix build with glibc 2.43

In reply to Khem Raj
---
 .../libldb/libldb/c23_memset_explicit.patch   | 248 ++++++++++++++++++
 .../recipes-support/libldb/libldb_2.8.2.bb    |   1 +
 2 files changed, 249 insertions(+)
 create mode 100644 meta-networking/recipes-support/libldb/libldb/c23_memset_explicit.patch
meta-networking/recipes-support/libldb/libldb/c23_memset_explicit.patch new file +248 -0
new file mode 100644
index 0000000000..bd817d8cf5
@@ -0,0 +1,248 @@
+C23 introduced memset_explicit with the same parameters as
+memset (3 args). New glibc implements it, so the symbol now
+exists in the global namespace with that prototype, causing
+“too many arguments” when your code passes 4 args.
+
+Provide a compatibility macro to address the problem
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+--- a/lib/replace/replace.c
++++ b/lib/replace/replace.c
+@@ -1,4 +1,4 @@
+-/*
++/*
+    Unix SMB/CIFS implementation.
+    replacement routines for broken systems
+    Copyright (C) Andrew Tridgell 1992-1998
+@@ -8,7 +8,7 @@
+      ** NOTE! The following LGPL license applies to the replace
+      ** library. This does NOT imply that all of Samba is released
+      ** under the LGPL
+-
++
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+@@ -44,6 +44,18 @@
+ void replace_dummy(void);
+ void replace_dummy(void) {}
+
++#if defined(HAVE_MEMSET_EXPLICIT)
++#  define LDB_MEMSET_EXPLICIT(dest, destsz, ch, n) memset_explicit((dest),(ch),(n))
++#elif defined(HAVE_MEMSET_S)
++#  define LDB_MEMSET_EXPLICIT(dest, destsz, ch, n) memset_s((dest),(destsz),(ch),(n))
++#else
++#  define LDB_MEMSET_EXPLICIT(dest, destsz, ch, n) do { \
++        volatile unsigned char *p = (volatile unsigned char*)(dest); \
++        size_t _N = (n); unsigned char _CH = (unsigned char)(ch); \
++        for (size_t _i = 0; _i < _N; ++_i) p[_i] = _CH; \
++    } while (0)
++#endif
++
+ #ifndef HAVE_FTRUNCATE
+  /*******************************************************************
+ ftruncate for operating systems that don't have it
+@@ -91,7 +103,7 @@ size_t rep_strlcpy(char *d, const char *
+ #endif
+
+ #ifndef HAVE_STRLCAT
+-/* like strncat but does not 0 fill the buffer and always null
++/* like strncat but does not 0 fill the buffer and always null
+    terminates. bufsize is the length of the buffer, which should
+    be one more than the maximum resulting string length */
+ size_t rep_strlcat(char *d, const char *s, size_t bufsize)
+@@ -116,7 +128,7 @@ size_t rep_strlcat(char *d, const char *
+
+ #ifndef HAVE_MKTIME
+ /*******************************************************************
+-a mktime() replacement for those who don't have it - contributed by
++a mktime() replacement for those who don't have it - contributed by
+ C.A. Lademann <[email protected]>
+ Corrections by [email protected]
+ ********************************************************************/
+@@ -137,7 +149,7 @@ time_t rep_mktime(struct tm *t)
+     return((time_t)-1);
+
+   n = t->tm_year + 1900 - 1;
+-  epoch = (t->tm_year - 70) * YEAR +
++  epoch = (t->tm_year - 70) * YEAR +
+     ((n / 4 - n / 100 + n / 400) - (1969 / 4 - 1969 / 100 + 1969 / 400)) * DAY;
+
+   y = t->tm_year + 1900;
+@@ -147,7 +159,7 @@ time_t rep_mktime(struct tm *t)
+     epoch += mon [m] * DAY;
+     if(m == 1 && y % 4 == 0 && (y % 100 != 0 || y % 400 == 0))
+       epoch += DAY;
+-
++
+     if(++m > 11) {
+       m = 0;
+       y++;
+@@ -156,7 +168,7 @@ time_t rep_mktime(struct tm *t)
+
+   epoch += (t->tm_mday - 1) * DAY;
+   epoch += t->tm_hour * HOUR + t->tm_min * MINUTE + t->tm_sec;
+-
++
+   if((u = localtime(&epoch)) != NULL) {
+     t->tm_sec = u->tm_sec;
+     t->tm_min = u->tm_min;
+@@ -176,7 +188,7 @@ time_t rep_mktime(struct tm *t)
+
+ #ifndef HAVE_INITGROUPS
+ /****************************************************************************
+- some systems don't have an initgroups call
++ some systems don't have an initgroups call
+ ****************************************************************************/
+ int rep_initgroups(char *name, gid_t id)
+ {
+@@ -194,7 +206,7 @@ int rep_initgroups(char *name, gid_t id)
+ 	int    i,j;
+ 	struct group *g;
+ 	char   *gr;
+-
++
+ 	if((grouplst = malloc(sizeof(gid_t) * max_gr)) == NULL) {
+ 		errno = ENOMEM;
+ 		return -1;
+@@ -250,9 +262,9 @@ void *rep_memmove(void *dest,const void
+
+ 	if (d < s) {
+ 		/* we can forward copy */
+-		if (s-d >= sizeof(int) &&
+-		    !(s%sizeof(int)) &&
+-		    !(d%sizeof(int)) &&
++		if (s-d >= sizeof(int) &&
++		    !(s%sizeof(int)) &&
++		    !(d%sizeof(int)) &&
+ 		    !(size%sizeof(int))) {
+ 			/* do it all as words */
+ 			int *idest = (int *)dest;
+@@ -267,9 +279,9 @@ void *rep_memmove(void *dest,const void
+ 		}
+ 	} else {
+ 		/* must backward copy */
+-		if (d-s >= sizeof(int) &&
+-		    !(s%sizeof(int)) &&
+-		    !(d%sizeof(int)) &&
++		if (d-s >= sizeof(int) &&
++		    !(s%sizeof(int)) &&
++		    !(d%sizeof(int)) &&
+ 		    !(size%sizeof(int))) {
+ 			/* do it all as words */
+ 			int *idest = (int *)dest;
+@@ -281,7 +293,7 @@ void *rep_memmove(void *dest,const void
+ 			char *cdest = (char *)dest;
+ 			char *csrc = (char *)src;
+ 			for (i=size-1;i>=0;i--) cdest[i] = csrc[i];
+-		}
++		}
+ 	}
+ 	return(dest);
+ }
+@@ -334,16 +346,16 @@ void rep_vsyslog (int facility_priority,
+  size_t rep_strnlen(const char *s, size_t max)
+ {
+         size_t len;
+-
++
+         for (len = 0; len < max; len++) {
+                 if (s[len] == '\0') {
+                         break;
+                 }
+         }
+-        return len;
++        return len;
+ }
+ #endif
+-
++
+ #ifndef HAVE_STRNDUP
+ /**
+  Some platforms don't have strndup.
+@@ -351,7 +363,7 @@ void rep_vsyslog (int facility_priority,
+ char *rep_strndup(const char *s, size_t n)
+ {
+ 	char *ret;
+-
++
+ 	n = strnlen(s, n);
+ 	ret = malloc(n+1);
+ 	if (!ret)
+@@ -407,7 +419,7 @@ int rep_chroot(const char *dname)
+
+ /*****************************************************************
+  Possibly replace mkstemp if it is broken.
+-*****************************************************************/
++*****************************************************************/
+
+ #ifndef HAVE_SECURE_MKSTEMP
+ int rep_mkstemp(char *template)
+@@ -425,7 +437,7 @@ int rep_mkstemp(char *template)
+ char *rep_mkdtemp(char *template)
+ {
+ 	char *dname;
+-
++
+ 	if ((dname = mktemp(template))) {
+ 		if (mkdir(dname, 0700) >= 0) {
+ 			return dname;
+@@ -532,7 +544,7 @@ long long int rep_strtoll(const char *st
+ {
+ #ifdef HAVE_STRTOQ
+ 	return strtoq(str, endptr, base);
+-#elif defined(HAVE___STRTOLL)
++#elif defined(HAVE___STRTOLL)
+ 	return __strtoll(str, endptr, base);
+ #elif SIZEOF_LONG == SIZEOF_LONG_LONG
+ 	return (long long int) strtol(str, endptr, base);
+@@ -568,7 +580,7 @@ unsigned long long int rep_strtoull(cons
+ {
+ #ifdef HAVE_STRTOUQ
+ 	return strtouq(str, endptr, base);
+-#elif defined(HAVE___STRTOULL)
++#elif defined(HAVE___STRTOULL)
+ 	return __strtoull(str, endptr, base);
+ #elif SIZEOF_LONG == SIZEOF_LONG_LONG
+ 	return (unsigned long long int) strtoul(str, endptr, base);
+@@ -599,7 +611,7 @@ unsigned long long int rep_strtoull(cons
+ #endif /* HAVE_STRTOULL */
+
+ #ifndef HAVE_SETENV
+-int rep_setenv(const char *name, const char *value, int overwrite)
++int rep_setenv(const char *name, const char *value, int overwrite)
+ {
+ 	char *p;
+ 	size_t l1, l2;
+@@ -644,10 +656,10 @@ int rep_unsetenv(const char *name)
+ 	for (i=0;environ[i];i++) /* noop */ ;
+
+ 	count=i;
+-
++
+ 	for (i=0;i<count;) {
+ 		if (strncmp(environ[i], name, len) == 0 && environ[i][len] == '=') {
+-			/* note: we do _not_ free the old variable here. It is unsafe to
++			/* note: we do _not_ free the old variable here. It is unsafe to
+ 			   do so, as the pointer may not have come from malloc */
+ 			memmove(&environ[i], &environ[i+1], (count-i)*sizeof(char *));
+ 			count--;
+@@ -688,7 +700,7 @@ int rep_utimes(const char *filename, con
+ #endif
+
+ #ifndef HAVE_DUP2
+-int rep_dup2(int oldfd, int newfd)
++int rep_dup2(int oldfd, int newfd)
+ {
+ 	errno = ENOSYS;
+ 	return -1;
+@@ -970,7 +982,7 @@ int rep_memset_s(void *dest, size_t dest
+ 	}
+
+ #if defined(HAVE_MEMSET_EXPLICIT)
+-	memset_explicit(dest, destsz, ch, count);
++	LDB_MEMSET_EXPLICIT(dest, destsz, ch, count);
+ #else /* HAVE_MEMSET_EXPLICIT */
+ 	memset(dest, ch, count);
+ # if defined(HAVE_GCC_VOLATILE_MEMORY_PROTECTION)
meta-networking/recipes-support/libldb/libldb_2.8.2.bb +1 -0
index 6038066169..016b649cd9 100644
@@ -13,6 +13,7 @@ SRC_URI = "https://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
            file://0001-do-not-import-target-module-while-cross-compile.patch \
            file://0002-ldb-Add-configure-options-for-packages.patch \
            file://0003-Fix-pyext_PATTERN-for-cross-compilation.patch \
+           file://c23_memset_explicit.patch \
            file://run-ptest \
           "