Skip to contentSkip to conversation

canvenient: include <sys/time.h> for struct timeval on musl

PATCH New Khem Raj 1 participant 26 messages Sep 29

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/26 canvenient: include <sys/time.h> for struct timeval on musl

canvenient_socketcan.c uses struct timeval without pulling in a header that declares it; glibc gets it transitively, musl doesn't.

AI-Generated: Uses Claude Code

---
 .../canvenient/canvenient_1.02.bb             |  4 ++-
 ...etCAN-include-sys-time.h-for-struct-.patch | 30 +++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-devtools/canvenient/files/0001-CANvenient_SocketCAN-include-sys-time.h-for-struct-.patch
meta-oe/recipes-devtools/canvenient/canvenient_1.02.bb +3 -1
index ea5634ec07..ec4a568f01 100644
@@ -17,7 +17,9 @@ DEPENDS = "libsocketcan"
 
 PV .= "+git"
 
-SRC_URI = "git://github.com/CANopenTerm/CANvenient.git;protocol=https;branch=main"
+SRC_URI = "git://github.com/CANopenTerm/CANvenient.git;protocol=https;branch=main \
+           file://0001-CANvenient_SocketCAN-include-sys-time.h-for-struct-.patch \
+           "
 
 SRCREV  = "23408935f230f59632eafd56056824f8e91cd896"
 
meta-oe/recipes-devtools/canvenient/files/0001-CANvenient_SocketCAN-include-sys-time.h-for-struct-.patch new file +30 -0
new file mode 100644
index 0000000000..86369edb6c
@@ -0,0 +1,30 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:54:51 +0000
+Subject: [PATCH] CANvenient_SocketCAN: include sys/time.h for struct timeval
+
+On glibc, <linux/can.h>/<sys/socket.h> transitively pull in a full
+definition of struct timeval via <sys/time.h>. musl's headers do not
+provide this transitive include, so struct timeval is only forward
+declared (via <sys/types.h>) and the file fails to build with
+"variable has incomplete type 'struct timeval'". Include
+<sys/time.h> explicitly so the type is fully defined regardless of
+libc.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/drivers/CANvenient_SocketCAN.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/drivers/CANvenient_SocketCAN.c b/src/drivers/CANvenient_SocketCAN.c
+index 1111111..2222222 100644
+--- a/src/drivers/CANvenient_SocketCAN.c
++++ b/src/drivers/CANvenient_SocketCAN.c
+@@ -24,6 +24,7 @@
+ #include <linux/can.h>
+ #include <linux/can/raw.h>
+ #include <libsocketcan.h>
++#include <sys/time.h>
+ #include <time.h>
+ #include <unistd.h>
+ #endif
author
#1 lore raw

PATCH 2/26 floret: add missing <cstdint> include for int64_t on musl

args.h uses int64_t without including <cstdint>; glibc headers pull it in transitively via other includes, musl's don't.

AI-Generated: Uses Claude Code

---
 ...-missing-cstdint-include-for-int64_t.patch | 32 +++++++++++++++++++
 .../recipes-support/floret/floret_0.10.5.bb   |  4 ++-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/floret/files/0002-args.h-add-missing-cstdint-include-for-int64_t.patch
meta-oe/recipes-support/floret/files/0002-args.h-add-missing-cstdint-include-for-int64_t.patch new file +32 -0
new file mode 100644
index 0000000000..cfececbad7
@@ -0,0 +1,32 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:54:51 +0000
+Subject: [PATCH] args.h: add missing <cstdint> include for int64_t
+
+args.h declares getAutotuneModelSize() returning int64_t but never
+includes <cstdint> itself. On glibc/libstdc++ this compiles because
+some other transitively-included standard header happens to declare
+int64_t first, but that is not guaranteed. musl's libc++/libstdc++
+headers do not provide this transitive declaration, so args.h fails
+to parse with "unknown type name 'int64_t'". The existing
+0001-PATCH-floret patch adds <cstdint> to args.cc, but only after
+it includes "args.h", so it does not help args.h parse itself.
+Include <cstdint> directly in args.h so the header is self-contained.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/args.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/args.h b/src/args.h
+index 1111111..2222222 100644
+--- a/src/args.h
++++ b/src/args.h
+@@ -8,6 +8,7 @@
+
+ #pragma once
+
++#include <cstdint>
+ #include <istream>
+ #include <ostream>
+ #include <string>
meta-oe/recipes-support/floret/floret_0.10.5.bb +3 -1
index 52c46b2a4b..fd96ed701c 100644
@@ -16,7 +16,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=4ce16d1d2b4c556959d654417007b713"
 DEPENDS = "zlib"
 
 SRC_URI = "git://github.com/explosion/floret.git;protocol=https;branch=main;tag=v${PV} \
-           file://0001-PATCH-floret-Adjust-CMake-flags-for-cross-compilation.patch"
+           file://0001-PATCH-floret-Adjust-CMake-flags-for-cross-compilation.patch \
+           file://0002-args.h-add-missing-cstdint-include-for-int64_t.patch \
+           "
 
 SRCREV = "775638223bee4fabc420cc8234632557452558e0"
 
author
#2 lore raw

PATCH 3/26 minifi-cpp: add missing <cstdint> include for int64_t on musl

In reply to Khem Raj

StreamCallback.h uses int64_t without including <cstdint>, relying on a transitive include that only exists on glibc.

AI-Generated: Uses Claude Code

---
 ...h-add-missing-cstdint-include-for-in.patch | 35 +++++++++++++++++++
 .../minifi-cpp/minifi-cpp_0.99.2.bb           |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-oe/recipes-extended/minifi-cpp/files/0007-StreamCallback.h-add-missing-cstdint-include-for-in.patch
meta-oe/recipes-extended/minifi-cpp/files/0007-StreamCallback.h-add-missing-cstdint-include-for-in.patch new file +35 -0
new file mode 100644
index 0000000000..f19cea494c
@@ -0,0 +1,35 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:54:51 +0000
+Subject: [PATCH] StreamCallback.h: add missing <cstdint> include for
+ int64_t
+
+StreamCallback.h uses int64_t in ReadWriteResult and in the
+InputStreamCallback/OutputStreamCallback std::function aliases, but
+never includes <cstdint> itself. On glibc/libstdc++ this happens to
+compile because some other transitively-included standard header
+provides int64_t first, but musl's libc++ headers do not provide
+this transitive declaration, so the header fails to parse with
+"unknown type name 'int64_t'" (which then cascades into std::function
+template errors). This is the same class of issue already fixed for
+LibWrapper.h and RepositoryMetricsSource.h by
+0001-Fix-build-with-gcc-16.patch; StreamCallback.h needs the same
+treatment.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ minifi-api/include/minifi-cpp/io/StreamCallback.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/minifi-api/include/minifi-cpp/io/StreamCallback.h b/minifi-api/include/minifi-cpp/io/StreamCallback.h
+index 1111111..2222222 100644
+--- a/minifi-api/include/minifi-cpp/io/StreamCallback.h
++++ b/minifi-api/include/minifi-cpp/io/StreamCallback.h
+@@ -16,6 +16,7 @@
+  */
+ #pragma once
+
++#include <cstdint>
+ #include <functional>
+ #include <memory>
+ #include <optional>
meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.99.2.bb +1 -0
index 88aa8adf69..5854483ba9 100644
@@ -29,6 +29,7 @@ SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git;protocol=https;branch=mai
            file://0001-Add-missing-include-for-malloc-free.patch;patchdir=thirdparty/fmt-src \
            file://0001-generateVersion.sh-set-BUILD_DATE-to-SOURCE_DATE_EPO.patch \
            file://0001-Fix-build-with-gcc-16.patch \
+           file://0007-StreamCallback.h-add-missing-cstdint-include-for-in.patch \
            file://systemd-volatile.conf \
            file://sysvinit-volatile.conf \
           "
author
#3 lore raw

PATCH 4/26 smolkit: include <sys/types.h> for uid_t/pid_t on musl

In reply to Khem Raj

SystemUserLookup.h uses uid_t/pid_t without including <sys/types.h>; glibc's <string> transitively declares them, musl's doesn't.

AI-Generated: Uses Claude Code

---
 ...p.h-include-sys-types.h-for-uid_t-pi.patch | 30 +++++++++++++++++++
 meta-oe/recipes-extended/smolkit/smolkit.bb   |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta-oe/recipes-extended/smolkit/files/0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch
meta-oe/recipes-extended/smolkit/files/0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch new file +30 -0
new file mode 100644
index 0000000000..d2adf9177b
@@ -0,0 +1,30 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:54:51 +0000
+Subject: [PATCH] SystemUserLookup.h: include sys/types.h for uid_t/pid_t
+
+SystemUserLookup.h uses uid_t and pid_t but never includes
+<sys/types.h> itself. On glibc, <string> (or other headers pulled in
+transitively by the C++ runtime) end up exposing these POSIX types,
+but that is not guaranteed. musl's libc++ headers do not provide
+this transitive declaration, so the header fails to parse with
+"unknown type name 'uid_t'"/"'pid_t'". Include <sys/types.h>
+directly so the header is self-contained regardless of libc.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/SystemUserLookup.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/SystemUserLookup.h b/src/SystemUserLookup.h
+index 1111111..2222222 100644
+--- a/src/SystemUserLookup.h
++++ b/src/SystemUserLookup.h
+@@ -1,5 +1,7 @@
+ #pragma once
+
++#include <sys/types.h>
++
+ #include <string>
+
+ struct group;
meta-oe/recipes-extended/smolkit/smolkit.bb +1 -0
index 4ac9ee69f7..6ba338ef05 100644
@@ -22,5 +22,6 @@ PV = "${VERSION}+git"
 
 SRC_URI = "\
     git://github.com/bmwcarit/${BPN}.git;protocol=https;branch=main;tag=v${VERSION} \
+    file://0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch \
 "
 SRCREV = "46bbfd5c922a8d03a534398ee129ded822dfcafe"
author
#4 lore raw

PATCH 5/26 tinycompress: use unsigned int instead of glibc-only uint

In reply to Khem Raj

sofprobeclient uses the bare 'uint' typedef, which is a glibc/BSD extension musl doesn't provide. Use 'unsigned int' instead.

AI-Generated: Uses Claude Code

---
 ...use-unsigned-int-instead-of-the-bare.patch | 40 +++++++++++++++++++
 .../tinycompress/tinycompress_1.2.16.bb       |  4 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta-multimedia/recipes-multimedia/tinycompress/files/0001-sofprobeclient-use-unsigned-int-instead-of-the-bare.patch
meta-multimedia/recipes-multimedia/tinycompress/files/0001-sofprobeclient-use-unsigned-int-instead-of-the-bare.patch new file +40 -0
new file mode 100644
index 0000000000..7a3fb61160
@@ -0,0 +1,40 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:54:51 +0000
+Subject: [PATCH] sofprobeclient: use unsigned int instead of the bare uint
+ typedef
+
+uint is a legacy BSD/glibc typedef from <sys/types.h> that is only
+exposed under glibc's _DEFAULT_SOURCE feature-test macro. musl does
+not expose it by default, so probes_demux.c fails to build with
+"use of undeclared identifier 'uint'". Rather than relying on a
+feature-test macro that differs between libc implementations, use
+the portable "unsigned int" spelling directly.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/utils/sofprobeclient/probes_demux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/utils/sofprobeclient/probes_demux.c b/src/utils/sofprobeclient/probes_demux.c
+index 1111111..2222222 100644
+--- a/src/utils/sofprobeclient/probes_demux.c
++++ b/src/utils/sofprobeclient/probes_demux.c
+@@ -318,7 +318,7 @@
+
+ int parser_parse_data(struct dma_frame_parser *p, size_t d_len)
+ {
+-	uint i = 0;
++	unsigned int i = 0;
+
+ 	p->len = p->start + d_len;
+ 	/* processing all loaded bytes */
+@@ -383,7 +383,7 @@
+ 		}
+ 		/* data copying section */
+ 		if (p->total_data_to_copy > 0) {
+-			uint data_to_copy;
++			unsigned int data_to_copy;
+
+ 			/* check if there is enough bytes loaded */
+ 			/* or copy partially if not */
meta-multimedia/recipes-multimedia/tinycompress/tinycompress_1.2.16.bb +3 -1
index 50ebdd67ee..52c771f993 100644
@@ -6,6 +6,8 @@ LICENSE = "BSD-3-Clause OR LGPL-2.1-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=cf9105c1a2d4405cbe04bbe3367373a0"
 
 SRCREV = "6b064c5b614bde950560a345ca0702e76668bdab"
-SRC_URI = "git://github.com/alsa-project/tinycompress.git;branch=master;protocol=https;tag=v${PV}"
+SRC_URI = "git://github.com/alsa-project/tinycompress.git;branch=master;protocol=https;tag=v${PV} \
+           file://0001-sofprobeclient-use-unsigned-int-instead-of-the-bare.patch \
+           "
 
 inherit autotools pkgconfig
author
#5 lore raw

PATCH 6/26 bit7z: replace glibc LFS64 names with portable POSIX ones for musl

In reply to Khem Raj

bit7z's internal code uses off64_t/stat64/lstat64, which musl doesn't provide since its off_t is already 64-bit. Use the plain POSIX names.

AI-Generated: Uses Claude Code

---
 ...e-glibc-LFS64-names-with-portable-PO.patch | 59 +++++++++++++++++++
 meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb  |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-extended/7zip/bit7z/0003-internal-replace-glibc-LFS64-names-with-portable-PO.patch
meta-oe/recipes-extended/7zip/bit7z/0003-internal-replace-glibc-LFS64-names-with-portable-PO.patch new file +59 -0
new file mode 100644
index 0000000000..eb2e9ae29b
@@ -0,0 +1,59 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:57:13 +0000
+Subject: [PATCH] internal: replace glibc LFS64 names with portable POSIX
+ equivalents
+
+musl does not provide the glibc LFS64 off64_t/stat64/lstat64/lseek64/
+ftruncate64 names at all; off_t/struct stat are already 64-bit on
+musl, so there is no separate 64-suffixed API. This broke the build
+on musl targets:
+
+| src/internal/fsutil.hpp:33:24: error: use of undeclared identifier 'lstat64'; did you mean 'lstat'?
+| src/internal/fsutil.hpp:34:23: error: 'stat64' does not refer to a value
+| src/internal/fsutil.hpp:185:6: error: incomplete result type 'FileMetadata' (aka 'struct stat64') in function definition
+
+Extend the existing BSD/Apple compatibility branches in fsutil.hpp
+(FileMetadata/os_stat/os_lstat) and filehandle.cpp (NO_LSEEK64) to
+also apply when building against a non-glibc libc (detected via
+!defined(__GLIBC__)), so musl uses the same plain POSIX stat/lstat/
+lseek/ftruncate/off_t names that the BSDs already use.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/internal/filehandle.cpp | 5 ++++-
+ src/internal/fsutil.hpp     | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/internal/filehandle.cpp b/src/internal/filehandle.cpp
+index 4cff411..22aeeef 100644
+--- a/src/internal/filehandle.cpp
++++ b/src/internal/filehandle.cpp
+@@ -24,7 +24,10 @@
+ #include <unistd.h>
+
+ #if defined( __APPLE__ ) || defined( BSD ) || \
+-    defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || defined( __DragonFly__ )
++    defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || defined( __DragonFly__ ) || \
++    !defined( __GLIBC__ )
++/* musl (and the BSDs) do not provide the glibc LFS64 lseek64/ftruncate64/off64_t names;
++ * off_t is already 64-bit there, so lseek/ftruncate with off_t suffice. */
+ #define NO_LSEEK64
+ #endif
+ #endif
+diff --git a/src/internal/fsutil.hpp b/src/internal/fsutil.hpp
+index eaf9ae9..2b173c1 100644
+--- a/src/internal/fsutil.hpp
++++ b/src/internal/fsutil.hpp
+@@ -24,7 +24,10 @@
+ #include <sys/stat.h>
+
+ #   if defined( __APPLE__ ) || defined( BSD ) || \
+-        defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || defined( __DragonFly__ )
++        defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || defined( __DragonFly__ ) || \
++        !defined( __GLIBC__ )
++/* musl (and the BSDs) do not provide the glibc LFS64 stat64/lstat64 names;
++ * their off_t/struct stat are already 64-bit, so the plain POSIX names suffice. */
+ using FileMetadata = struct stat;
+ const auto os_lstat = &lstat;
+ const auto os_stat = &stat;
meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb +1 -0
index 5f0b65b3cc..d0693cc5f1 100644
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=48a3fe23ed1353e0995dadfda05ffdb6"
 
 SRC_URI = " \
     git://github.com/rikyoz/bit7z.git;protocol=https;branch=master;tag=v${PV} \
+    file://0003-internal-replace-glibc-LFS64-names-with-portable-PO.patch \
     ${@bb.utils.contains('PTEST_ENABLED', '1', d.getVar('SRC_URI_PTEST'), 'file://0001-cmake-disable-dependency-inclusion.patch', d)} \
 "
 
author
#6 lore raw

PATCH 7/26 libdvdread: fix off64_t definition in dvd_filesystem.h for musl

In reply to Khem Raj

dvd_filesystem.h unconditionally uses the glibc LFS64 off64_t name. musl's off_t is already 64-bit, so typedef it the same way the other non-glibc branches already do. This also fixes libdvdnav, which consumes this staged header.

AI-Generated: Uses Claude Code

---
 ...em.h-fix-off64_t-definition-for-musl.patch | 39 +++++++++++++++++++
 .../libdvdread/libdvdread_7.1.1.bb            |  4 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 meta-multimedia/recipes-multimedia/libdvdread/files/0001-dvd_filesystem.h-fix-off64_t-definition-for-musl.patch
meta-multimedia/recipes-multimedia/libdvdread/files/0001-dvd_filesystem.h-fix-off64_t-definition-for-musl.patch new file +39 -0
new file mode 100644
index 0000000000..e73e93ed38
@@ -0,0 +1,39 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:05:57 +0000
+Subject: [PATCH] dvd_filesystem.h: fix off64_t definition for musl
+
+dvd_filesystem.h defines off64_t itself for _MSC_VER, __GLIBC__, and a
+fixed list of BSD-like libcs (Apple, FreeBSD, OpenBSD, NetBSD,
+DragonFly) whose off_t is already 64-bit. musl falls into none of
+these branches, so off64_t stays undeclared, which breaks any
+consumer of this public installed header (e.g. libdvdnav):
+
+| dvd_filesystem.h:87:5: error: type name requires a specifier or qualifier
+| dvd_filesystem.h:87:39: error: unknown type name 'off64_t'; did you mean 'off_t'?
+
+musl's off_t is also already 64-bit (there is no separate LFS64 API),
+same as the BSDs/Apple, so replace the closed list of libcs with a
+catch-all "else", covering musl (and any other libc in the same
+situation) alongside the ones already listed.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/dvdread/dvd_filesystem.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/dvdread/dvd_filesystem.h b/src/dvdread/dvd_filesystem.h
+index 1111111..2222222 100644
+--- a/src/dvdread/dvd_filesystem.h
++++ b/src/dvdread/dvd_filesystem.h
+@@ -37,8 +37,9 @@
+ #elif defined(__GLIBC__)
+ /* sys/types.h may have been included before _LARGEFILE64_SOURCE was defined. */
+ typedef __off64_t off64_t;
+-#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+-/* off_t is already 64 bit here so off64_t is not provided. */
++#else
++/* musl (and the BSDs, and Apple's libc) do not provide the glibc LFS64
++ * off64_t name; their off_t is already 64 bit, so it can be used as-is. */
+ typedef off_t off64_t;
+ #endif
meta-multimedia/recipes-multimedia/libdvdread/libdvdread_7.1.1.bb +3 -1
index f57515f732..7b644a1265 100644
@@ -3,7 +3,9 @@ SECTION = "libs/multimedia"
 LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=64e753fa7d1ca31632bc383da3b57c27"
 
-SRC_URI = "https://download.videolan.org/pub/videolan/libdvdread/${PV}/libdvdread-${PV}.tar.xz"
+SRC_URI = "https://download.videolan.org/pub/videolan/libdvdread/${PV}/libdvdread-${PV}.tar.xz \
+           file://0001-dvd_filesystem.h-fix-off64_t-definition-for-musl.patch \
+"
 SRC_URI[sha256sum] = "a0d47876548bec806774bbf8dbf20bb19ba139464383156b32eb8e59915b90a9"
 
 inherit meson lib_package binconfig pkgconfig manpages
author
#7 lore raw

PATCH 8/26 ettercap: don't strip a pre-existing _GNU_SOURCE define in ec.h

In reply to Khem Raj

ec.h unconditionally #defines _GNU_SOURCE without checking if it is already defined, which trips -Werror on musl toolchains that predefine it via the driver. Guard the define.

AI-Generated: Uses Claude Code

---
 .../ettercap/ettercap_0.8.4.1.bb              |  1 +
 ...ip-a-pre-existing-_GNU_SOURCE-define.patch | 58 +++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 meta-networking/recipes-support/ettercap/files/0001-ec.h-do-not-strip-a-pre-existing-_GNU_SOURCE-define.patch
meta-networking/recipes-support/ettercap/ettercap_0.8.4.1.bb +1 -0
index e8679bf463..9a2090719b 100644
@@ -22,6 +22,7 @@ DEPENDS += "ethtool \
 RDEPENDS:${PN} += "bash ethtool libgcc"
 
 SRC_URI = "gitsm://github.com/Ettercap/ettercap;branch=master;protocol=https;tag=v${PV} \
+           file://0001-ec.h-do-not-strip-a-pre-existing-_GNU_SOURCE-define.patch \
            "
 
 SRCREV = "0dc8409779f3a09cbfff4434b9a4d7b33480d88d"
meta-networking/recipes-support/ettercap/files/0001-ec.h-do-not-strip-a-pre-existing-_GNU_SOURCE-define.patch new file +58 -0

58 lines not on this page · raw message

author
#8 lore raw

PATCH 9/26 switchtec-user: include switchtec-endian.h for musl htole32/le32toh

In reply to Khem Raj

lib/cap-cli-main.c uses htole32()/le32toh() from <endian.h> without including it directly; pull it in via the project's own endian compat header.

AI-Generated: Uses Claude Code

---
 ...n-include-switchtec-endian.h-for-mus.patch | 44 +++++++++++++++++++
 .../switchtec-user/switchtec-user_4.4.bb      |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta-oe/recipes-support/switchtec-user/switchtec-user/0002-lib-cap-cli-main-include-switchtec-endian.h-for-mus.patch
meta-oe/recipes-support/switchtec-user/switchtec-user/0002-lib-cap-cli-main-include-switchtec-endian.h-for-mus.patch new file +44 -0
new file mode 100644
index 0000000000..c59e76e496
@@ -0,0 +1,44 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:56:40 +0000
+Subject: [PATCH] lib/cap, cli/main: include switchtec/endian.h for musl
+
+lib/cap.c and cli/main.c call htole32()/le32toh()/le64toh() etc.
+without including inc/switchtec/endian.h, the project's own portable
+endian-conversion shim (already used by lib/diag.c, lib/switchtec.c,
+lib/pmon.c, lib/fw.c, lib/fabric.c, cli/mfg.c and cli/diag.c). On
+glibc this went unnoticed because some other transitively-included
+header happens to pull in <endian.h> as a side effect, but musl's
+headers don't have that side effect, so building with musl libc fails
+with "call to undeclared function 'htole32'" and friends. Add the
+missing include to both files so they pick up the same <endian.h>
+declarations (switchtec/endian.h just wraps <endian.h> on Linux,
+which musl provides unconditionally, unlike glibc which historically
+gated it behind feature-test macros).
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/cli/main.c b/cli/main.c
+index 6dc4524..b0bdcc3 100644
+--- a/cli/main.c
++++ b/cli/main.c
+@@ -33,6 +33,7 @@
+ #include <switchtec/errors.h>
+ #include <switchtec/utils.h>
+ #include <switchtec/pci.h>
++#include <switchtec/endian.h>
+ 
+ #include <locale.h>
+ #include <time.h>
+diff --git a/lib/cap.c b/lib/cap.c
+index b10685f..52ee3f5 100644
+--- a/lib/cap.c
++++ b/lib/cap.c
+@@ -32,6 +32,7 @@
+ #include "switchtec/cap.h"
+ #include "switchtec/switchtec.h"
+ #include "switchtec/mrpc.h"
++#include "switchtec/endian.h"
+ #include "switchtec_priv.h"
+ 
+ #include <stddef.h>
meta-oe/recipes-support/switchtec-user/switchtec-user_4.4.bb +1 -0
index 61d431178a..32c75c1bfe 100644
@@ -8,6 +8,7 @@ DEPENDS = "ncurses openssl"
 
 SRC_URI = "git://github.com/Microsemi/switchtec-user.git;protocol=https;branch=master;tag=v${PV} \
            file://0001-lib-diag-do-not-use-a-variable-length-array-in-a-str.patch \
+           file://0002-lib-cap-cli-main-include-switchtec-endian.h-for-mus.patch \
            "
 SRCREV = "d995512f3bf1ceb98eefada813642d5ba5d62cd1"
 
author
#9 lore raw

PATCH 10/26 xfstests: fix musl build (linux/types.h, RWH_WRITE_LIFE_NOT_SET)

In reply to Khem Raj

fs-monitor.c uses __s32/__u32 without <linux/types.h>, and rw_hint.c uses RWH_WRITE_LIFE_NOT_SET which musl's headers don't define. Add the missing include and a guarded fallback define.

AI-Generated: Uses Claude Code

---
 ...nclude-linux-types.h-for-__s32-__u32.patch | 24 +++++++++++++++
 ...lback-define-for-RWH_WRITE_LIFE_NOT_.patch | 29 +++++++++++++++++++
 .../xfstests/xfstests_2026.06.21.bb           |  2 ++
 3 files changed, 55 insertions(+)
 create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch
 create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch
meta-filesystems/recipes-utils/xfstests/xfstests/0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch new file +24 -0
new file mode 100644
index 0000000000..74b1d42f57
@@ -0,0 +1,24 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:03:26 +0000
+Subject: [PATCH] fs-monitor: include linux/types.h for __s32/__u32
+
+The local fallback definition of "struct fanotify_event_info_error"
+(used when the libc's <sys/fanotify.h> predates FAN_FS_ERROR) uses the
+kernel-style __s32/__u32 typedefs. glibc's headers happen to pull
+these in transitively via other system headers, but musl does not, so
+building against musl fails with "unknown type name '__s32'/'__u32'"
+unless <linux/types.h> is included directly.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+--- a/src/fs-monitor.c
++++ b/src/fs-monitor.c
+@@ -12,6 +12,7 @@
+ #include <sys/fanotify.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <linux/types.h>
+
+ #ifndef FAN_FS_ERROR
+ #define FAN_FS_ERROR		0x00008000
meta-filesystems/recipes-utils/xfstests/xfstests/0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch new file +29 -0
new file mode 100644
index 0000000000..a69dd6811b
@@ -0,0 +1,29 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:03:26 +0000
+Subject: [PATCH] rw_hint: add fallback define for RWH_WRITE_LIFE_NOT_SET
+
+The musl <fcntl.h> shipped in this toolchain mistakenly names the
+"not set" write-hint constant RWF_WRITE_LIFE_NOT_SET instead of the
+kernel uapi's RWH_WRITE_LIFE_NOT_SET (the other RWH_WRITE_LIFE_*
+values are spelled correctly), while glibc's <bits/fcntl-linux.h>
+defines RWH_WRITE_LIFE_NOT_SET as expected. Guard a local fallback
+definition so the test builds against either libc, without needing to
+pull in <linux/fcntl.h> and risk clashing with musl's own F_*_RW_HINT
+macro values.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+--- a/src/rw_hint.c
++++ b/src/rw_hint.c
+@@ -7,6 +7,10 @@
+ #include <string.h>
+ #include <fcntl.h>
+
++#ifndef RWH_WRITE_LIFE_NOT_SET
++#define RWH_WRITE_LIFE_NOT_SET	0
++#endif
++
+ int main(int argc, char **argv)
+ {
+ 	uint64_t hint = -1;
meta-filesystems/recipes-utils/xfstests/xfstests_2026.06.21.bb +2 -0
index ad1ceea463..f6f246332e 100644
@@ -13,6 +13,8 @@ SRC_URI = "git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git;branch=master;ta
            file://0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch \
            file://0001-bstat-use-uint32_t-instead-of-__uint32_t-to-fix-buil.patch \
            file://0001-locktest-do-not-tie-struct-delegation-to-the-F_GETDE.patch \
+           file://0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch \
+           file://0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch \
            "
 
 
author
#10 lore raw

PATCH 11/26 evolution-data-server: define _GNU_SOURCE for strcasestr in imapx test

In reply to Khem Raj

The camel-provider-imapx test uses strcasestr(), a GNU extension that needs _GNU_SOURCE defined before <string.h> is included to be declared.

AI-Generated: Uses Claude Code

---
 .../evolution-data-server.bb                  |  1 +
 ...vider-imapx-define-_GNU_SOURCE-for-s.patch | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server/0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch
meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server.bb +1 -0
index 8ed111b334..d1108b6b93 100644
@@ -17,6 +17,7 @@ SRC_URI += "file://0001-cmake-Do-not-export-CC-into-gir-compiler.patch \
            file://0003-contact-Replace-the-Novell-sample-contact-with-somet.patch \
            file://0004-call-native-helpers.patch \
            file://0001-data-CMakeLists.txt-dont-create-automatic-google-log.patch \
+           file://0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch \
            file://iconv-detect.h \
            "
 
meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server/0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch new file +33 -0
new file mode 100644
index 0000000000..133932fb04
@@ -0,0 +1,33 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:56:54 +0000
+Subject: [PATCH] tests: camel: provider-imapx: define _GNU_SOURCE for
+ strcasestr
+
+musl libc only declares strcasestr() in <string.h> when _GNU_SOURCE (or
+_BSD_SOURCE/_DEFAULT_SOURCE) is defined before the header is included,
+whereas glibc exposes this GNU extension unconditionally by default.
+Define _GNU_SOURCE as the first thing in the file, before any
+includes, so the prototype is visible on musl too.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/camel/tests/test-camel-provider-imapx.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/camel/tests/test-camel-provider-imapx.c b/src/camel/tests/test-camel-provider-imapx.c
+index 1111111..2222222 100644
+--- a/src/camel/tests/test-camel-provider-imapx.c
++++ b/src/camel/tests/test-camel-provider-imapx.c
+@@ -3,6 +3,11 @@
+  * SPDX-License-Identifier: LGPL-2.0-or-later
+  */
+
++/* Needed for strcasestr(), which musl only declares in <string.h>
++ * when a GNU/BSD feature-test macro is defined; glibc exposes it
++ * unconditionally by default. */
++#define _GNU_SOURCE
++
+ #include "evolution-data-server-config.h"
+
+ #include <string.h>
author
#11 lore raw

PATCH 12/26 bpftrace: define _GNU_SOURCE for pthread_setname_np in testprogs

In reply to Khem Raj

A test program uses pthread_setname_np(), a GNU extension that needs _GNU_SOURCE defined before <pthread.h> is included to be declared.

AI-Generated: Uses Claude Code

---
 ...-define-_GNU_SOURCE-for-pthread_setn.patch | 28 +++++++++++++++++++
 .../bpftrace/bpftrace_0.26.1.bb               |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0007-tests-testprogs-define-_GNU_SOURCE-for-pthread_setn.patch
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0007-tests-testprogs-define-_GNU_SOURCE-for-pthread_setn.patch new file +28 -0
new file mode 100644
index 0000000000..d9d297055e
@@ -0,0 +1,28 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:56:02 +0000
+Subject: [PATCH] tests/testprogs: define _GNU_SOURCE for pthread_setname_np
+
+glibc exposes GNU/BSD extensions such as pthread_setname_np() by default
+in its headers unless the build is put into a strict ISO mode, whereas
+musl only exposes these extensions when _GNU_SOURCE is explicitly defined
+before <pthread.h> is included. Without it, musl's <pthread.h> does not
+declare pthread_setname_np(), causing an implicit-declaration error under
+clang's -Werror=implicit-function-declaration (mandatory in C99 and
+later). Define _GNU_SOURCE before the first include so the declaration is
+visible on musl too.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tests/testprogs/multi_threads.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/testprogs/multi_threads.c b/tests/testprogs/multi_threads.c
+index 1111111..2222222 100644
+--- a/tests/testprogs/multi_threads.c
++++ b/tests/testprogs/multi_threads.c
+@@ -1,3 +1,4 @@
++#define _GNU_SOURCE
+ #include <pthread.h>
+ #include <stdlib.h>
+ #include <stdio.h>
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.26.1.bb +1 -0
index a2f6a93f66..e217ac150d 100644
@@ -21,6 +21,7 @@ SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.26.x;protocol=http
            file://0005-CMakeLists-Add-support-for-LLVM-23.patch \
            file://0001-tests-pass-C-linker-flags-and-sysroot-to-raw-compile.patch \
            file://0006-tests-do-not-embed-build-paths-in-split-DWARF-test-pr.patch \
+           file://0007-tests-testprogs-define-_GNU_SOURCE-for-pthread_setn.patch \
 "
 SRCREV = "1bac8a8daad6e0aa579980e877d0c9d5fc296593"
 
author
#12 lore raw

PATCH 13/26 atop: use wide ncurses pkg-config cflags so waddwstr is declared

In reply to Khem Raj

atop calls the wide-character ncurses function waddwstr(), which needs NCURSES_WIDECHAR defined; get that (and the right include path) from the ncursesw pkg-config module's own Cflags instead of hardcoding plain ncurses flags.

AI-Generated: Uses Claude Code

---
 .../atop/atop/ncursesw-pkgconfig-cflags.patch | 29 +++++++++++++++++++
 meta-oe/recipes-support/atop/atop_2.13.0.bb   |  1 +
 2 files changed, 30 insertions(+)
 create mode 100644 meta-oe/recipes-support/atop/atop/ncursesw-pkgconfig-cflags.patch
meta-oe/recipes-support/atop/atop/ncursesw-pkgconfig-cflags.patch new file +29 -0
new file mode 100644
index 0000000000..60441f4ab4
@@ -0,0 +1,29 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:56:24 +0000
+Subject: [PATCH] Makefile: pull in ncursesw cflags via pkg-config
+
+atop links against libncursesw and calls wide-character curses
+functions such as waddwstr(), which ncurses only declares in
+curses.h when NCURSES_WIDECHAR is defined (normally via the
+`-DNCURSES_WIDECHAR` cflag reported by `pkg-config --cflags
+ncursesw`). The Makefile only queried pkg-config for glib-2.0 cflags
+and never queried it for ncursesw, so on distros shipping a unified
+curses.h (as this OE ncurses recipe does) waddwstr() is left
+undeclared and the build fails under -Werror=implicit-function-declaration.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/Makefile b/Makefile
+index 3a73bd2..7d1a3c4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,7 +22,7 @@
+
+ PKG_CONFIG ?= pkg-config
+
+-override CFLAGS  := -O2 -I. -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0) -Wmissing-prototypes -Wmissing-declarations -Wformat-security $(CFLAGS) # -DNOPERFEVENT   # -DHTTPSTATS
++override CFLAGS  := -O2 -I. -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0) $(shell $(PKG_CONFIG) --cflags ncursesw) -Wmissing-prototypes -Wmissing-declarations -Wformat-security $(CFLAGS) # -DNOPERFEVENT   # -DHTTPSTATS
+
+ CC_CHECK := $(shell echo | $(CC) -dM -E - | grep -q __clang__ && echo clang || echo gcc)
+ ifeq ($(CC_CHECK),gcc)
meta-oe/recipes-support/atop/atop_2.13.0.bb +1 -0
index 625a7b0937..28292f244a 100644
@@ -21,6 +21,7 @@ SRC_URI = "http://www.atoptool.nl/download/${BP}.tar.gz \
            ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://volatiles.atop.conf', 'file://volatiles.99_atop', d)} \
            file://fix-permissions.patch \
            file://sysvinit-implement-status.patch \
+           file://ncursesw-pkgconfig-cflags.patch \
            "
 SRC_URI[sha256sum] = "ea182f84c9f52ca922e5af4f17dff97ff424400a4f2f92393317a6af66e6a874"
 
author
#13 lore raw

PATCH 14/26 xdp-tools: avoid struct ethhdr redefinition on musl

In reply to Khem Raj

musl's <netinet/if_ether.h> and the kernel's raw <linux/if_ether.h> both define struct ethhdr, and only avoid colliding if <netinet/if_ether.h> (or something that pulls it in) is processed first. lib/util/params.{c,h} and xdpsock.c, xdp-filter.c and xdp-dump/xdpdump.c all got this backwards in various ways; fix the include order/choice in each.

AI-Generated: Uses Claude Code

---
 ...d-struct-ethhdr-redefinition-on-musl.patch | 81 +++++++++++++++++++
 ...dump-avoid-struct-ethhdr-redefinitio.patch | 57 +++++++++++++
 .../xdp-tools/xdp-tools_1.6.3.bb              |  2 +
 3 files changed, 140 insertions(+)
 create mode 100644 meta-oe/recipes-support/xdp-tools/files/0003-lib-util-avoid-struct-ethhdr-redefinition-on-musl.patch
 create mode 100644 meta-oe/recipes-support/xdp-tools/files/0004-xdp-filter-xdp-dump-avoid-struct-ethhdr-redefinitio.patch
meta-oe/recipes-support/xdp-tools/files/0003-lib-util-avoid-struct-ethhdr-redefinition-on-musl.patch new file +81 -0
new file mode 100644
index 0000000000..607c7c7038
@@ -0,0 +1,81 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:14:39 +0000
+Subject: [PATCH] lib/util: avoid struct ethhdr redefinition on musl
+
+lib/util/params.h and lib/util/params.c only need ETH_ALEN from
+<linux/if_ether.h>, but including that raw kernel uapi header can
+collide with musl's own <netinet/if_ether.h>: musl only skips its own
+struct ethhdr (via __UAPI_DEF_ETHHDR) once its own header has already
+been processed, so pulling in <linux/if_ether.h> first, or from a
+translation unit that later also includes <net/ethernet.h>, defines
+struct ethhdr twice and fails to build. Switch both files to use
+<netinet/if_ether.h> directly instead of the uapi header.
+
+lib/util/xdpsock.c already includes <netinet/ether.h> (which pulls in
+musl's <netinet/if_ether.h>) after also including <linux/if_ether.h>
+earlier in the file, i.e. in the wrong order for musl's
+__UAPI_DEF_ETHHDR guard to take effect. Move the <linux/if_ether.h>
+include to after <netinet/ether.h> so the guard suppresses the uapi
+header's struct ethhdr as intended.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/lib/util/params.c b/lib/util/params.c
+index 5a5ee11..f4b143c 100644
+--- a/lib/util/params.c
++++ b/lib/util/params.c
+@@ -10,7 +10,9 @@
+ #include <errno.h>
+
+ #include <net/if.h>
+-#include <linux/if_ether.h>
++/* ETH_ALEN only; see params.h for why this uses the libc header instead of
++ * the raw <linux/if_ether.h> uapi one. */
++#include <netinet/if_ether.h>
+ #include <linux/if_link.h> /* XDP_FLAGS_* depend on kernel-headers installed */
+ #include <linux/if_xdp.h>
+ #include <arpa/inet.h>
+diff --git a/lib/util/params.h b/lib/util/params.h
+index ab0ee4a..b50c259 100644
+--- a/lib/util/params.h
++++ b/lib/util/params.h
+@@ -8,7 +8,12 @@
+ #include <stdlib.h>
+ #include <linux/in.h>
+ #include <linux/in6.h>
+-#include <linux/if_ether.h>
++/* Only ETH_ALEN is needed here; use the libc's own header (rather than the
++ * raw kernel uapi one) so we don't end up defining struct ethhdr twice when
++ * a translation unit also includes <net/ethernet.h>/<netinet/ether.h> (musl
++ * only suppresses <linux/if_ether.h>'s struct ethhdr via __UAPI_DEF_ETHHDR
++ * when its own netinet/if_ether.h was included first). */
++#include <netinet/if_ether.h>
+ #include <bpf/libbpf.h>
+
+ enum option_type {
+diff --git a/lib/util/xdpsock.c b/lib/util/xdpsock.c
+index a893728..46379dc 100644
+--- a/lib/util/xdpsock.c
++++ b/lib/util/xdpsock.c
+@@ -9,7 +9,6 @@
+ #include <linux/err.h>
+ #include <linux/if_link.h>
+ #include <linux/if_xdp.h>
+-#include <linux/if_ether.h>
+ #include <linux/ip.h>
+ #include <linux/limits.h>
+ #include <linux/udp.h>
+@@ -17,6 +16,12 @@
+ #include <arpa/inet.h>
+ #include <net/ethernet.h>
+ #include <netinet/ether.h>
++/* <linux/if_ether.h> must come after <netinet/ether.h> above: musl's
++ * <netinet/if_ether.h> (pulled in by netinet/ether.h) defines its own
++ * struct ethhdr and then sets __UAPI_DEF_ETHHDR=0, which this header
++ * checks before defining struct ethhdr itself. Included the other way
++ * around, both structs get defined and the second one is a hard error. */
++#include <linux/if_ether.h>
+ #include <net/if.h>
+ #include <poll.h>
+ #include <pthread.h>
meta-oe/recipes-support/xdp-tools/files/0004-xdp-filter-xdp-dump-avoid-struct-ethhdr-redefinitio.patch new file +57 -0

57 lines not on this page · raw message

meta-oe/recipes-support/xdp-tools/xdp-tools_1.6.3.bb +2 -0
index b0571c2754..bcaa8c91c4 100644
@@ -16,6 +16,8 @@ SRC_URI = " \
     git://github.com/xdp-project/xdp-tools.git;tag=v${PV};nobranch=1;protocol=https \
     file://0001-configure-correctly-handle-CC-when-validating-requir.patch \
     file://0002-lib-libxdp-Makefile-use-cp-fRd-to-preserve-symlinks-.patch \
+    file://0003-lib-util-avoid-struct-ethhdr-redefinition-on-musl.patch \
+    file://0004-xdp-filter-xdp-dump-avoid-struct-ethhdr-redefinitio.patch \
 "
 SRCREV = "8fbad9f0af621a22aa87ff2520b3735915b1f0fd"
 
author
#14 lore raw

PATCH 15/26 tcpreplay: fix struct ethhdr redefinition on musl

In reply to Khem Raj

Same struct ethhdr / __UAPI_DEF_ETHHDR ordering issue as xdp-tools:
common.h/txring.c pull in musl's <netinet/if_ether.h> after the raw <linux/if_ether.h> uapi header has already defined struct ethhdr.

AI-Generated: Uses Claude Code

---
 ...ix-struct-ethhdr-redefinition-on-mus.patch | 43 +++++++++++++++++++
 .../tcpreplay/tcpreplay_4.6.1.bb              |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta-networking/recipes-support/tcpreplay/tcpreplay/0002-common-txring-fix-struct-ethhdr-redefinition-on-mus.patch
meta-networking/recipes-support/tcpreplay/tcpreplay/0002-common-txring-fix-struct-ethhdr-redefinition-on-mus.patch new file +43 -0
new file mode 100644
index 0000000000..827b083712
@@ -0,0 +1,43 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:14:39 +0000
+Subject: [PATCH] common/txring: fix struct ethhdr redefinition on musl
+
+This #if was gated on "__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1", which is
+false (and always has been) for any non-glibc libc, so musl always took
+the #else branch and included the raw kernel <linux/if_ether.h> uapi
+header. sendpacket.h already brings in musl's own <netinet/if_ether.h>
+earlier in the translation unit; musl's header defines struct ethhdr
+itself and only then defines __UAPI_DEF_ETHHDR as 0, so the *following*
+<linux/if_ether.h> checks that guard and skips its own definition. With
+the #else branch taken, <linux/if_ether.h> is included via this file
+without musl's guard ever being set, so struct ethhdr is defined twice
+and the build fails with a hard redefinition error.
+
+Widen the condition so any libc other than a pre-2.1 glibc uses the
+portable <net/ethernet.h> path (which both glibc and musl have always
+provided) instead of falling through to the raw uapi header.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+--- a/src/common/txring.h
++++ b/src/common/txring.h
+@@ -38,7 +38,17 @@
+
+ #ifdef HAVE_TX_RING
+
+-#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
++/* This block used to be conditioned on plain "__GLIBC__ >= 2 &&
++ * __GLIBC_MINOR__ >= 1" i.e. it always took the #else branch on non-glibc
++ * libcs such as musl. That branch's <linux/if_ether.h> then races with
++ * sendpacket.h's earlier <netinet/if_ether.h>: whichever of the two struct
++ * ethhdr definitions is seen first "wins" and the second is a hard error
++ * (musl's <netinet/if_ether.h> defines struct ethhdr unconditionally and
++ * only afterwards sets __UAPI_DEF_ETHHDR=0, so <linux/if_ether.h> must be
++ * included after it, not before). <net/ethernet.h> is the safe, universal
++ * choice here (glibc has always had it too) and avoids the raw uapi header
++ * entirely. */
++#if !defined(__GLIBC__) || (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)
+ #include <net/ethernet.h> /* the L2 protocols */
+ #include <linux/if_packet.h>
+ #else
meta-networking/recipes-support/tcpreplay/tcpreplay_4.6.1.bb +1 -0
index 8259c4ef1f..5234da282a 100644
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=10f0474a2f0e5dccfca20f69d6598ad8"
 
 SRC_URI = "https://github.com/appneta/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
     file://0001-libopts.m4-set-POSIX_SHELL-to-bin-sh.patch \
+    file://0002-common-txring-fix-struct-ethhdr-redefinition-on-mus.patch \
 "
 
 SRC_URI[sha256sum] = "cc3642816073fb1d96b3af36df4fb66c11f523da427f95b7b0c4c99deaa53afb"
author
#15 lore raw

PATCH 16/26 leancrypto: drop redundant <linux/prctl.h> include

In reply to Khem Raj

secure_execution_linux.c includes both <sys/prctl.h> and <linux/prctl.h>; musl's <sys/prctl.h> already declares everything needed, and including the raw uapi header afterwards redefines struct prctl_mm_map.

AI-Generated: Uses Claude Code

---
 ..._linux-drop-redundant-linux-prctl.h-.patch | 35 +++++++++++++++++++
 .../leancrypto/leancrypto_1.9.0.bb            |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-oe/recipes-crypto/leancrypto/files/0001-secure_execution_linux-drop-redundant-linux-prctl.h-.patch
meta-oe/recipes-crypto/leancrypto/files/0001-secure_execution_linux-drop-redundant-linux-prctl.h-.patch new file +35 -0
new file mode 100644
index 0000000000..dd6db04c2d
@@ -0,0 +1,35 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:14:39 +0000
+Subject: [PATCH] secure_execution_linux: drop redundant linux/prctl.h include
+
+<sys/prctl.h> alone already provides everything this file needs
+(PR_SET_SPECULATION_CTRL, the PR_SPEC_* constants, and struct
+prctl_mm_map on libcs that define it). Do not also include
+<linux/prctl.h>: musl's <sys/prctl.h> defines struct prctl_mm_map
+unconditionally, and <linux/prctl.h> defines the identical struct with
+no compatibility guard against it, so including both is a hard
+"redefinition of 'prctl_mm_map'" error.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/internal/src/secure_execution_linux.c b/internal/src/secure_execution_linux.c
+index 7264edf..df57a88 100644
+--- a/internal/src/secure_execution_linux.c
++++ b/internal/src/secure_execution_linux.c
+@@ -17,7 +17,14 @@
+  * DAMAGE.
+  */
+
+-#include <linux/prctl.h>
++/*
++ * <sys/prctl.h> alone already provides everything this file needs
++ * (PR_SET_SPECULATION_CTRL, the PR_SPEC_* constants, and on some libcs
++ * struct prctl_mm_map). Do not also include <linux/prctl.h>: musl's
++ * <sys/prctl.h> defines struct prctl_mm_map unconditionally, and
++ * <linux/prctl.h> defines the identical struct with no compatibility
++ * guard against it, so including both is a hard "redefinition" error.
++ */
+ #include <sys/prctl.h>
+
+ #include "ext_headers_internal.h"
meta-oe/recipes-crypto/leancrypto/leancrypto_1.9.0.bb +1 -0
index 566f44fb76..5cd9f02254 100644
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = " \
 SECTION = "libs"
 SRC_URI = "git://github.com/smuellerDD/leancrypto.git;branch=master;protocol=https;tag=v${PV} \
            file://leancrypto-tests.sh \
+           file://0001-secure_execution_linux-drop-redundant-linux-prctl.h-.patch \
            "
 SRCREV = "0110b781707c7bdde88482933811387b744d21eb"
 
author
#16 lore raw

PATCH 17/26 libmodbus: pull in TCGETS2/TCSETS2 from <asm/ioctls.h> for musl

In reply to Khem Raj

modbus-rtu.c uses the Linux-specific TCGETS2/TCSETS2 ioctls, which glibc's <asm/termbits.h>/<asm/ioctls.h> chain declares transitively via <termios.h>, but musl's don't.

AI-Generated: Uses Claude Code

---
 ...in-TCGETS2-TCSETS2-from-asm-ioctls.h.patch | 35 +++++++++++++++++++
 .../libmodbus/libmodbus_3.2.0.bb              |  4 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/libmodbus/files/0001-modbus-rtu-pull-in-TCGETS2-TCSETS2-from-asm-ioctls.h.patch
meta-oe/recipes-extended/libmodbus/files/0001-modbus-rtu-pull-in-TCGETS2-TCSETS2-from-asm-ioctls.h.patch new file +35 -0
new file mode 100644
index 0000000000..e584f7609c
@@ -0,0 +1,35 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:14:39 +0000
+Subject: [PATCH] modbus-rtu: pull in TCGETS2/TCSETS2 from asm/ioctls.h on musl
+
+When HAVE_STRUCT_TERMIOS2 is set, this file issues the TCGETS2/TCSETS2
+ioctl requests together with struct termios2. On musl, <sys/ioctl.h>
+only declares the plain (non-termios2) TCGETS/TCSETS request codes;
+TCGETS2/TCSETS2 are only available from the kernel uapi ioctls header,
+so the build fails with "use of undeclared identifier 'TCGETS2'".
+
+Include <asm/ioctls.h> in this case. It is safe to add unconditionally
+here: it redefines TCGETS/TCSETS with the same values musl's
+<sys/ioctl.h> already uses, and glibc ships (and already indirectly
+includes) the very same header, so this is a no-op there.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/src/modbus-rtu.c b/src/modbus-rtu.c
+index 87e0887..1e98e74 100644
+--- a/src/modbus-rtu.c
++++ b/src/modbus-rtu.c
+@@ -14,6 +14,12 @@
+ #endif
+ #if defined(HAVE_STRUCT_TERMIOS2)
+ #include <sys/ioctl.h>
++/* On musl, <sys/ioctl.h> only provides the plain (non-termios2) TCGETS/
++ * TCSETS request codes; TCGETS2/TCSETS2 (used below with struct termios2)
++ * come from the kernel uapi ioctls header. <asm/ioctls.h> is safe to add
++ * unconditionally here: it redefines TCGETS/TCSETS with the same values
++ * musl already uses, and glibc ships the same header too. */
++#include <asm/ioctls.h>
+ #endif
+ #include "modbus-private.h"
+ #include <assert.h>
meta-oe/recipes-extended/libmodbus/libmodbus_3.2.0.bb +3 -1
index 1eddfb8bd1..748a87dc14 100644
@@ -6,7 +6,9 @@ SECTION = "libs"
 LICENSE = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c"
 
-SRC_URI = "git://github.com/stephane/libmodbus;branch=master;protocol=https;tag=v${PV}"
+SRC_URI = "git://github.com/stephane/libmodbus;branch=master;protocol=https;tag=v${PV} \
+           file://0001-modbus-rtu-pull-in-TCGETS2-TCSETS2-from-asm-ioctls.h.patch \
+           "
 SRCREV = "a9b025d12289855490b10d77461c99e001abfc0f"
 
 
author
#17 lore raw

PATCH 18/26 spdm-emu: provide AF_MCTP fallback for musl

In reply to Khem Raj

spdm_emu_mctp_kernel.c uses AF_MCTP, a very recent Linux socket family constant that musl's <sys/socket.h> doesn't define yet. Add a guarded fallback definition.

AI-Generated: Uses Claude Code

---
 ...rnel-provide-AF_MCTP-fallback-for-mu.patch | 45 +++++++++++++++++++
 .../recipes-security/spdm-emu/spdm-emu_git.bb |  4 +-
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-security/spdm-emu/files/0001-spdm_emu_mctp_kernel-provide-AF_MCTP-fallback-for-mu.patch
meta-oe/recipes-security/spdm-emu/files/0001-spdm_emu_mctp_kernel-provide-AF_MCTP-fallback-for-mu.patch new file +45 -0
new file mode 100644
index 0000000000..80aa78bc08
@@ -0,0 +1,45 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:14:39 +0000
+Subject: [PATCH] spdm_emu_mctp_kernel: provide AF_MCTP fallback for musl
+
+AF_MCTP (Linux commit 583be982d934, merged in v5.15) is a newer socket
+address family. <linux/mctp.h>, which this header's implementation
+files include, assumes AF_MCTP is already declared by the libc's own
+socket headers and does not define it itself. This musl version's
+<sys/socket.h> has not picked up AF_MCTP yet (its AF_* list stops at
+AF_XDP), so building the AF_MCTP-based kernel MCTP transport fails
+with "use of undeclared identifier 'AF_MCTP'".
+
+Provide the numeric fallback (45, matching the kernel's
+include/linux/socket.h) so kernel-mode MCTP socket support still
+builds against this libc. Drop this once the staged libc defines
+AF_MCTP itself.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/spdm_emu/spdm_emu_common/spdm_emu_mctp_kernel.h b/spdm_emu/spdm_emu_common/spdm_emu_mctp_kernel.h
+index 4c0eb2b..5feb99f 100644
+--- a/spdm_emu/spdm_emu_common/spdm_emu_mctp_kernel.h
++++ b/spdm_emu/spdm_emu_common/spdm_emu_mctp_kernel.h
+@@ -7,6 +7,20 @@
+ #ifndef __SPDM_EMU_MCTP_KERNEL_H__
+ #define __SPDM_EMU_MCTP_KERNEL_H__
+
++#include <sys/socket.h>
++
++/*
++ * AF_MCTP (Linux commit 583be982d934, v5.15) is a newer socket address
++ * family. <linux/mctp.h> assumes it is already declared by the libc's own
++ * socket headers and does not define it itself; this musl version's
++ * <sys/socket.h> has not picked it up yet (its AF_* list stops at AF_XDP).
++ * Provide the numeric fallback so kernel-mode MCTP socket support still
++ * builds; drop this once the staged libc defines AF_MCTP.
++ */
++#ifndef AF_MCTP
++#define AF_MCTP 45
++#endif
++
+ /**
+  * Register the Linux kernel AF_MCTP IO ops and reset the peer address state.
+  *
meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb +3 -1
index 2a9735fc7c..33c02dae72 100644
@@ -6,7 +6,9 @@ HOMEPAGE = "https://github.com/DMTF/spdm-emu"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ed4cfe4688e1ac2cc2e6748766571949"
 
-SRC_URI = "gitsm://github.com/DMTF/spdm-emu;protocol=https;branch=main"
+SRC_URI = "gitsm://github.com/DMTF/spdm-emu;protocol=https;branch=main \
+           file://0001-spdm_emu_mctp_kernel-provide-AF_MCTP-fallback-for-mu.patch \
+           "
 
 SRCREV = "ea77f25410cc01098320c0b44b3e150192ec4d5e"
 # Upstream release tags are "X.Y.Z" (newest 3.8.0).
author
#18 lore raw

PATCH 19/26 netcat-openbsd: define IPTOS_DSCP_VA for musl

In reply to Khem Raj

netcat.c uses IPTOS_DSCP_VA, which glibc's <netinet/ip.h> defines but musl's doesn't. Add a guarded fallback definition.

AI-Generated: Uses Claude Code

---
 ...netcat-define-IPTOS_DSCP_VA-for-musl.patch | 34 +++++++++++++++++++
 .../netcat/netcat-openbsd_1.238.bb            |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-networking/recipes-support/netcat/netcat-openbsd/0002-netcat-define-IPTOS_DSCP_VA-for-musl.patch
meta-networking/recipes-support/netcat/netcat-openbsd/0002-netcat-define-IPTOS_DSCP_VA-for-musl.patch new file +34 -0
new file mode 100644
index 0000000000..2b642b26b6
@@ -0,0 +1,34 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:14:39 +0000
+Subject: [PATCH] netcat: define IPTOS_DSCP_VA for musl
+
+netcat.c uses IPTOS_DSCP_VA (the RFC 5865 Voice-Admit DSCP codepoint)
+as one of the recognized --tos names. glibc's <netinet/ip.h> defines
+IPTOS_DSCP_VA as 0xb0, but musl's <netinet/ip.h> does not define it at
+all, so the build fails with "use of undeclared identifier
+'IPTOS_DSCP_VA'".
+
+Add the same fallback definition already used here for the other
+IPTOS_DSCP_* codepoints missing on musl (see the neighboring
+IPTOS_DSCP_EF block). 0xb0 is DSCP value 44 (decimal) shifted into the
+TOS byte's DSCP field, i.e. (44 << 2), matching glibc's value.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+--- a/netcat.c
++++ b/netcat.c
+@@ -89,6 +89,13 @@
+ # define	IPTOS_DSCP_EF		0xb8
+ #endif /* IPTOS_DSCP_EF */
+
++/* Voice-Admit DSCP codepoint (RFC 5865): decimal 44 shifted into the TOS
++ * byte's DSCP field, i.e. (44 << 2). glibc's netinet/ip.h defines this as
++ * 0xb0; musl's does not carry it at all yet. */
++#ifndef IPTOS_DSCP_VA
++# define	IPTOS_DSCP_VA		0xb0
++#endif /* IPTOS_DSCP_VA */
++
+
+ #include <ctype.h>
+ #include <err.h>
meta-networking/recipes-support/netcat/netcat-openbsd_1.238.bb +1 -0
index 01eafa06d0..e7272dc0a9 100644
@@ -10,6 +10,7 @@ do_patch[depends] = "quilt-native:do_populate_sysroot"
 SRC_URI = "http://snapshot.debian.org/archive/debian/20260519T203124Z/pool/main/n/netcat-openbsd/netcat-openbsd_${PV}.orig.tar.gz;name=netcat \
            http://snapshot.debian.org/archive/debian/20260519T203124Z/pool/main/n/netcat-openbsd/netcat-openbsd_${PV}-1.debian.tar.xz;name=netcat-patch;subdir=${BP} \
            file://0001-bundle-own-base64-encode-decode-functions.patch \
+           file://0002-netcat-define-IPTOS_DSCP_VA-for-musl.patch \
            "
 
 SRC_URI[netcat.sha256sum] = "9f72a37d85dec1366309fdb0172be4e67e09ec26e89f13156315149e17c02479"
author
#19 lore raw

PATCH 20/26 bmap-writer: cast BLKGETSIZE64 ioctl request to int for musl

In reply to Khem Raj

musl's ioctl() takes 'int request' where glibc's takes 'unsigned long', so passing BLKGETSIZE64 directly trips -Wsign-conversion under -Werror. Cast it explicitly.

AI-Generated: Uses Claude Code

---
 .../bmap-writer/bmap-writer_1.0.5.bb          |  4 +-
 ...-library-s-ioctl-request-type-for-BL.patch | 50 +++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/bmap-writer/files/0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch
meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.5.bb +3 -1
index 160d1b7112..71ea721eed 100644
@@ -8,7 +8,9 @@ SECTION = "console/utils"
 LICENSE = "GPL-3.0-only"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=e49f4652534af377a713df3d9dec60cb"
 
-SRC_URI = "git://github.com/embetrix/${BPN};branch=master;protocol=https;tag=${PV}"
+SRC_URI = "git://github.com/embetrix/${BPN};branch=master;protocol=https;tag=${PV} \
+           file://0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch \
+           "
 SRCREV = "c7b1bec0f40217d17e315226552e461a4a816abc"
 
 DEPENDS = "libtinyxml2 libarchive"
meta-oe/recipes-support/bmap-writer/files/0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch new file +50 -0

50 lines not on this page · raw message

author
#20 lore raw

PATCH 21/26 ot-br-posix: reference sCrashCallback on non-glibc

In reply to Khem Raj

backtrace.cpp sets sCrashCallback but only reads it back inside a glibc-only execinfo backtrace path, so on musl (no backtrace()) clang flags it as -Wunused-but-set-variable under -Werror. Reference it in the non-glibc branch too.

AI-Generated: Uses Claude Code

---
 ...-Reference-sCrashCallback-on-non-gli.patch | 34 +++++++++++++++++++
 .../openthread/ot-br-posix_git.bb             |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch
meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch new file +34 -0
new file mode 100644
index 0000000000..88c3b67314
@@ -0,0 +1,34 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 01:57:51 +0000
+Subject: [PATCH] posix/backtrace: Reference sCrashCallback on non-glibc,
+ non-Android builds
+
+sCrashCallback is set unconditionally by otSysRegisterCrashCallback()
+whenever OPENTHREAD_POSIX_CONFIG_BACKTRACE_ENABLE is set, but it is
+only read from signalCritical(), which is compiled solely under the
+`OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE || defined(__GLIBC__)` branch.
+On musl (neither Android nor glibc) that branch is replaced by an
+empty platformBacktraceInit() stub, so the variable is set but never
+used, which clang's -Wunused-but-set-global (promoted to -Werror)
+turns into a hard build failure. Use the existing OT_UNUSED_VARIABLE()
+idiom already used elsewhere in this file (e.g. in signalCritical())
+to acknowledge the variable on this code path too.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/posix/platform/backtrace.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/posix/platform/backtrace.cpp b/src/posix/platform/backtrace.cpp
+index 1111111..2222222 100644
+--- a/src/posix/platform/backtrace.cpp
++++ b/src/posix/platform/backtrace.cpp
+@@ -185,6 +185,6 @@ void platformBacktraceInit(void)
+     }
+ }
+ #else  // OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE || defined(__GLIBC__)
+-void platformBacktraceInit(void) {}
++void platformBacktraceInit(void) { OT_UNUSED_VARIABLE(sCrashCallback); }
+ #endif // OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE || defined(__GLIBC__)
+ #endif // OPENTHREAD_POSIX_CONFIG_BACKTRACE_ENABLE
meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb +1 -0
index 8c49a30327..59e1dae2a3 100644
@@ -17,6 +17,7 @@ SRC_URI = "gitsm://github.com/openthread/ot-br-posix.git;protocol=https;branch=m
            file://0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch \
            file://default-cxx-std.patch \
            file://0001-x509_crt-Zero-initialize-mbedtls_x509_time-at-declar.patch;patchdir=third_party/openthread/repo \
+           file://0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch;patchdir=third_party/openthread/repo \
            "
 
 SYSTEMD_SERVICE:${PN} = "otbr-agent.service"
author
#21 lore raw

PATCH 22/26 perfetto: avoid getprogname() macro clobbering its own fallback

In reply to Khem Raj

The bundled liblog/libbase compat shim defines a getprogname() fallback macro and then immediately redefines program_invocation_name using it in a way that collides with musl's own declaration. Fix the ordering/guard so the two definitions don't conflict.

AI-Generated: Uses Claude Code

---
 meta-oe/recipes-devtools/perfetto/perfetto.bb |  1 +
 ...me-macro-clobbering-its-own-fallback.patch | 58 +++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/perfetto/perfetto/0002-Avoid-getprogname-macro-clobbering-its-own-fallback.patch
meta-oe/recipes-devtools/perfetto/perfetto.bb +1 -0
index 978a8611cc..f21b983a2b 100644
@@ -27,6 +27,7 @@ SRC_URI:append = " \
            git://chromium.googlesource.com/external/github.com/google/re2.git;nobranch=1;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/buildtools/re2;name=re2 \
            \
            file://0001-Remove-check_build_deps-build-steps.patch \
+           file://0002-Avoid-getprogname-macro-clobbering-its-own-fallback.patch \
            "
 
 SRCREV_bionic = "a0d0355105cb9d4a4b5384897448676133d7b8e2"
meta-oe/recipes-devtools/perfetto/perfetto/0002-Avoid-getprogname-macro-clobbering-its-own-fallback.patch new file +58 -0

58 lines not on this page · raw message

author
#22 lore raw

PATCH 23/26 netdata: disable systemd units plugin when systemd is not enabled

In reply to Khem Raj

netdata's cmake build unconditionally requires systemd for the 'Systemd units' plugin unless explicitly disabled. Tie ENABLE_PLUGIN_SYSTEMD_UNITS to the same DISTRO_FEATURES systemd check already used for the journal option, so sysvinit builds configure cleanly.

AI-Generated: Uses Claude Code

---
 meta-webserver/recipes-webadmin/netdata/netdata_2.10.4.bb | 1 +
 1 file changed, 1 insertion(+)
meta-webserver/recipes-webadmin/netdata/netdata_2.10.4.bb +1 -0
index 709538b1d4..ed4c54fbe4 100644
@@ -102,6 +102,7 @@ EXTRA_OECMAKE += "-DENABLE_PLUGIN_EBPF=OFF \
                   -DENABLE_LIBBACKTRACE=OFF \
                   -DProtobuf_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
                   -DBUILD_FOR_PACKAGING=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \
+                  -DENABLE_PLUGIN_SYSTEMD_UNITS=${@bb.utils.contains('DISTRO_FEATURES','systemd','ON','OFF',d)} \
                   -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=OFF -DCMAKE_INSTALL_PREFIX='${base_prefix}'"
 
 do_compile:append() {
author
#23 lore raw

PATCH 24/26 android-tools: fix musl build (off64_t, LFS64 fns, b64_pton, ANDROID_HOST_MUSL)

In reply to Khem Raj

Several independent musl gaps surfaced one after another as each was fixed and the build progressed further:
- android-base/off64_t.h only worked around __APPLE__ lacking off64_t; extend the same typedef fallback to musl.
- sysdeps.h's adb_pread/adb_pwrite/adb_lseek only fell back to the plain (non-LFS64) functions on __APPLE__; musl needs the same fallback for pread64/pwrite64/lseek64.
- daemon/auth.cpp calls b64_pton() from <resolv.h>, which the Linux host build gets via -lresolv and bionic provides natively, but musl has neither; vendor the standard BSD implementation for it.
- android-base/endian.h and threads.h already gate a musl-aware branch behind ANDROID_HOST_MUSL, matching upstream's own expectation, but nothing defined that macro for this recipe's build; define it via CFLAGS/CXXFLAGS for the musl toolchain.

AI-Generated: Uses Claude Code

---
 ...end-non-glibc-compat-typedef-to-musl.patch |  42 ++++++
 ...vide-pread64-pwrite64-lseek64-fallba.patch |  58 ++++++++
 ...dor-a-portable-b64_pton-for-non-glib.patch | 131 ++++++++++++++++++
 .../android-tools/android-tools_35.0.2.bb     |  11 ++
 4 files changed, 242 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/0012-libbase-off64_t-extend-non-glibc-compat-typedef-to-musl.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/0013-adb-sysdeps-provide-pread64-pwrite64-lseek64-fallba.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/0014-daemon-auth-vendor-a-portable-b64_pton-for-non-glib.patch
meta-oe/recipes-devtools/android-tools/android-tools/0012-libbase-off64_t-extend-non-glibc-compat-typedef-to-musl.patch new file +42 -0
new file mode 100644
index 0000000000..59feb3c1ed
@@ -0,0 +1,42 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:01:07 +0000
+Subject: [PATCH] libbase: extend the off64_t compat typedef to musl
+
+android-base/off64_t.h already works around Apple's libc not
+providing the glibc LFS64 off64_t name by typedef'ing it to off_t.
+musl has the exact same situation -- it never defines the LFS64
+names because its off_t is already 64-bit -- but the guard only
+checked for __APPLE__, so building against musl failed:
+
+| system/libbase/mapped_file.cpp:47:67: error: unknown type name 'off64_t'; did you mean 'off_t'?
+| system/libbase/include/android-base/file.h:105:71: error: unknown type name 'off64_t'; did you mean 'off_t'?
+| system/libbase/include/android-base/mapped_file.h:50:61: error: unknown type name 'off64_t'; did you mean 'off_t'?
+
+Both file.h and mapped_file.h (and every .cpp that includes them)
+already pull in android-base/off64_t.h, so extending its guard to
+any non-glibc, non-bionic, non-Windows libc (i.e. musl) fixes all of
+these call sites in a single place.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ system/libbase/include/android-base/off64_t.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/system/libbase/include/android-base/off64_t.h b/system/libbase/include/android-base/off64_t.h
+index a4b7715..857ff29 100644
+--- a/system/libbase/include/android-base/off64_t.h
++++ b/system/libbase/include/android-base/off64_t.h
+@@ -16,7 +16,10 @@
+
+ #pragma once
+
+-#if defined(__APPLE__)
+-/** Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */
++#if defined(__APPLE__) || \
++    (!defined(__GLIBC__) && !defined(__BIONIC__) && !defined(_WIN32))
++/** Mac OS has always had a 64-bit off_t, so it doesn't have off64_t.
++ *  musl doesn't provide the glibc LFS64 off64_t name either, but its off_t
++ *  is already 64-bit, so the same typedef works there too. */
+ typedef off_t off64_t;
+ #endif
meta-oe/recipes-devtools/android-tools/android-tools/0013-adb-sysdeps-provide-pread64-pwrite64-lseek64-fallba.patch new file +58 -0

58 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/0014-daemon-auth-vendor-a-portable-b64_pton-for-non-glib.patch new file +131 -0

131 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools_35.0.2.bb +11 -0
index 623dfa7717..300a92df00 100644
@@ -57,6 +57,9 @@ SRC_URI = "https://deb.debian.org/debian/pool/main/a/android-platform-tools/andr
            file://0009-libbase-include-stdint.h-in-hex.cpp.patch \
            file://0010-adbd-make-systemd-sd_notify-conditional-on-HAVE_SYSTEMD.patch \
            file://0011-adb-drop-non-portable-is_standard_layout-assertion.patch \
+           file://0012-libbase-off64_t-extend-non-glibc-compat-typedef-to-musl.patch \
+           file://0013-adb-sysdeps-provide-pread64-pwrite64-lseek64-fallba.patch \
+           file://0014-daemon-auth-vendor-a-portable-b64_pton-for-non-glib.patch \
            "
 
 SRC_URI[orig.md5sum] = "352376965cdef7bd7505d8fefdd43d50"
@@ -81,12 +84,20 @@ SYSTEMD_PACKAGES = "${PN}-adbd"
 SYSTEMD_SERVICE:${PN}-adbd = "android-tools-adbd.service"
 
 CFLAGS:append = " -fPIC -std=gnu2x"
+# android-base/endian.h and threads.h already have an
+# ANDROID_HOST_MUSL-gated branch for building against musl (alongside their
+# __GLIBC__ one); upstream expects the build system to define this macro,
+# which the debian/ Makefile-based packaging used here doesn't do on its
+# own.  Without it those headers fall through to their Windows-only branch
+# and fail with "'winsock2.h' file not found".
+CFLAGS:append:libc-musl = " -DANDROID_HOST_MUSL"
 # The bundled fmtlib 10.2.0 validates FMT_STRING() inside a consteval
 # basic_format_string constructor whose parse path evaluates "it - begin()",
 # which current C++ frontends reject as a non-constant subexpression. Define
 # FMT_CONSTEVAL to empty so format-string checking falls back to fmt's runtime
 # path instead of the broken compile-time one.
 CXXFLAGS:append = " -fPIC -std=gnu++20 -D_Nonnull= -D_Nullable= -I${STAGING_INCDIR}/boringssl -DFMT_CONSTEVAL="
+CXXFLAGS:append:libc-musl = " -DANDROID_HOST_MUSL"
 LDFLAGS:append = " -fPIC -L${STAGING_LIBDIR}/android"
 
 
author
#24 lore raw

PATCH 25/26 sockperf: fix musl build (libexecinfo dependency, missing includes)

In reply to Khem Raj

configure.ac's AC_SEARCH_LIBS([backtrace], [execinfo], ...) fails with 'libexecinfo not found' on musl, which lacks glibc's backtrace()/backtrace_symbols(); depend on the libexecinfo compat library there.
Once configure succeeds, ticks.h's timeval2nsec() needs struct timeval, which was only pulled in via <sys/time.h> under __FreeBSD__, and vma-xlio-redirect.cpp calls sscanf()/sprintf() without including <cstdio>; fix both for musl too.

AI-Generated: Uses Claude Code

---
 ...-includes-for-musl-struct-timeval-ss.patch | 54 +++++++++++++++++++
 .../sockperf/sockperf_git.bb                  | 11 +++-
 2 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-benchmark/sockperf/files/0001-src-fix-missing-includes-for-musl-struct-timeval-ss.patch
meta-oe/recipes-benchmark/sockperf/files/0001-src-fix-missing-includes-for-musl-struct-timeval-ss.patch new file +54 -0
new file mode 100644
index 0000000000..3a59a8dbbe
@@ -0,0 +1,54 @@
+From: Khem Raj <[email protected]>
+Date: Tue, 29 Sep 2026 02:40:00 +0000
+Subject: [PATCH] src: fix missing includes for musl (struct timeval,
+ sscanf/sprintf)
+
+ticks.h's timeval2nsec() uses struct timeval, but the header only
+pulled in <sys/time.h> under __FreeBSD__ -- glibc's <time.h> happens
+to declare struct timeval as a side effect of other headers already
+included elsewhere in the build, but musl's does not, so building
+against musl fails:
+
+| ticks.h:115:30: error: member access into incomplete type 'const struct timeval'
+
+Always include <sys/time.h> instead of gating it on __FreeBSD__.
+
+vma-xlio-redirect.cpp uses sscanf()/sprintf() but never includes
+<cstdio>, relying on it being pulled in transitively. That doesn't
+happen on musl either:
+
+| vma-xlio-redirect.cpp:92:14: error: use of undeclared identifier 'sscanf'
+| vma-xlio-redirect.cpp:99:5: error: use of undeclared identifier 'sprintf'
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/src/ticks.h b/src/ticks.h
+index 679f3d9..6e38095 100644
+--- a/src/ticks.h
++++ b/src/ticks.h
+@@ -99,9 +99,10 @@ with simple integral values. The following describes these calculations:
+ #include <stdint.h> // for int64_t
+ #include <stdlib.h> // for qsort
+
+-#ifdef __FreeBSD__
++/* struct timeval is used below (timeval2nsec()); <time.h> alone doesn't
++ * guarantee it, so always pull in <sys/time.h> rather than just on
++ * __FreeBSD__. */
+ #include <sys/time.h>
+-#endif
+
+ #include "ticks_os.h"
+
+diff --git a/src/vma-xlio-redirect.cpp b/src/vma-xlio-redirect.cpp
+index 5554d4a..a54a6c1 100644
+--- a/src/vma-xlio-redirect.cpp
++++ b/src/vma-xlio-redirect.cpp
+@@ -28,6 +28,7 @@
+  */
+
+ #include "vma-xlio-redirect.h"
++#include <cstdio> /* sscanf(), sprintf() */
+ #include <dlfcn.h>
+
+ socket_fptr_t fn_socket = NULL;
meta-oe/recipes-benchmark/sockperf/sockperf_git.bb +9 -2
index ab0e35667e..fe285465e6 100644
@@ -5,9 +5,16 @@ SECTION = "console/network"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://copying;md5=b4563b57c98bc23c8cecbc0b6d9546e9"
 
-SRC_URI = "git://github.com/Mellanox/sockperf;branch=sockperf_v2;protocol=https"
+SRC_URI = "git://github.com/Mellanox/sockperf;branch=sockperf_v2;protocol=https \
+           file://0001-src-fix-missing-includes-for-musl-struct-timeval-ss.patch \
+           "
 SRCREV = "3c65ad99cd385e18f8a2a655c19826e81a4d17e8"
 
 UPSTREAM_CHECK_COMMITS = "1"
 
-inherit autotools
\ No newline at end of file
+# musl lacks glibc's backtrace()/backtrace_symbols(); configure.ac uses
+# AC_SEARCH_LIBS([backtrace], [execinfo], ...) which errors out with
+# "libexecinfo not found" unless the compat library is available.
+DEPENDS:append:libc-musl = " libexecinfo"
+
+inherit autotools
author
#25 lore raw

PATCH 26/26 rtc-testbench: Fix build with musl

In reply to Khem Raj

Cast socket addresses to struct sockaddr * for bind() and sendto(), since musl has no transparent union for them like glibc, and pin threads with pthread_setaffinity_np() after creation where pthread_attr_setaffinity_np() is not available.

AI-Generated: Uses Claude Code

---
 .../files/0002-Fix-build-with-musl.patch      | 121 ++++++++++++++++++
 .../rtc-testbench/rtc-testbench_5.5.bb        |   1 +
 2 files changed, 122 insertions(+)
 create mode 100644 meta-oe/recipes-test/rtc-testbench/files/0002-Fix-build-with-musl.patch
meta-oe/recipes-test/rtc-testbench/files/0002-Fix-build-with-musl.patch new file +121 -0
new file mode 100644
index 0000000000..9fa1138952
@@ -0,0 +1,121 @@
+From: Khem Raj <[email protected]>
+Subject: [PATCH] Fix build with musl
+
+- bind() and sendto() take a struct sockaddr pointer. glibc accepts other
+  sockaddr types in C via a transparent union, musl does not:
+
+    net.c:417:25: error: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Wincompatible-pointer-types]
+
+  Cast to struct sockaddr * instead.
+
+- pthread_attr_setaffinity_np() is a glibc extension musl does not have:
+
+    thread.c:67:8: error: call to undeclared function 'pthread_attr_setaffinity_np'
+
+  Without it, pin the thread with pthread_setaffinity_np() right after
+  creating it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+diff --git a/src/log_json.c b/src/log_json.c
+index 5ac7e87..e13b1fe 100644
+--- a/src/log_json.c
++++ b/src/log_json.c
+@@ -44,11 +44,11 @@ static void log_json_add_traffic_class(struct log_json_thread_context *ctx,
+ 	switch (ctx->dest.ss_family) {
+ 	case AF_INET:
+ 		ret = sendto(ctx->socket, stat_message, strlen(stat_message), 0,
+-			     (struct sockaddr_in *)&ctx->dest, sizeof(struct sockaddr_in));
++			     (struct sockaddr *)&ctx->dest, sizeof(struct sockaddr_in));
+ 		break;
+ 	case AF_INET6:
+ 		ret = sendto(ctx->socket, stat_message, strlen(stat_message), 0,
+-			     (struct sockaddr_in6 *)&ctx->dest, sizeof(struct sockaddr_in6));
++			     (struct sockaddr *)&ctx->dest, sizeof(struct sockaddr_in6));
+ 		break;
+ 	default:
+ 		ret = -EINVAL;
+diff --git a/src/net.c b/src/net.c
+index 408920b..14d1e29 100644
+--- a/src/net.c
++++ b/src/net.c
+@@ -414,10 +414,10 @@ int create_udp_socket(const char *udp_destination, const char *udp_source, const
+ 
+ 	switch (source.ss_family) {
+ 	case AF_INET:
+-		ret = bind(socket_fd, (struct sockaddr_in *)&source, sizeof(struct sockaddr_in));
++		ret = bind(socket_fd, (struct sockaddr *)&source, sizeof(struct sockaddr_in));
+ 		break;
+ 	case AF_INET6:
+-		ret = bind(socket_fd, (struct sockaddr_in6 *)&source, sizeof(struct sockaddr_in6));
++		ret = bind(socket_fd, (struct sockaddr *)&source, sizeof(struct sockaddr_in6));
+ 		break;
+ 	default:
+ 		ret = -EINVAL;
+diff --git a/src/thread.c b/src/thread.c
+index a679164..635dda7 100644
+--- a/src/thread.c
++++ b/src/thread.c
+@@ -64,11 +64,13 @@ int create_rt_thread(pthread_t *task_id, int thread_priority, int cpu_core,
+ 
+ 	CPU_ZERO(&cpus);
+ 	CPU_SET(cpu_core, &cpus);
++#ifdef __GLIBC__
+ 	ret = pthread_attr_setaffinity_np(&attr, sizeof(cpus), &cpus);
+ 	if (ret) {
+ 		pthread_error(ret, "pthread_attr_setaffinity_np() failed");
+ 		goto err;
+ 	}
++#endif
+ 
+ 	ret = pthread_create(task_id, &attr, thread_routine, data);
+ 	if (ret) {
+@@ -76,6 +78,15 @@ int create_rt_thread(pthread_t *task_id, int thread_priority, int cpu_core,
+ 		goto err;
+ 	}
+ 
++#ifndef __GLIBC__
++	/* No pthread_attr_setaffinity_np() e.g. on musl, pin the new thread instead. */
++	ret = pthread_setaffinity_np(*task_id, sizeof(cpus), &cpus);
++	if (ret) {
++		pthread_error(ret, "pthread_setaffinity_np() failed");
++		goto err;
++	}
++#endif
++
+ 	ret = pthread_setname_np(*task_id, thread_name);
+ 	if (ret) {
+ 		pthread_error(ret, "pthread_setname_np() failed");
+diff --git a/src/udp_thread.c b/src/udp_thread.c
+index bcdd000..ffbeba9 100644
+--- a/src/udp_thread.c
++++ b/src/udp_thread.c
+@@ -68,11 +68,11 @@ static void udp_send_frame(struct thread_context *thread_context, const unsigned
+ 	switch (destination->ss_family) {
+ 	case AF_INET:
+ 		ret = sendto(socket_fd, frame_data, frame_length, 0,
+-			     (struct sockaddr_in *)destination, sizeof(struct sockaddr_in));
++			     (struct sockaddr *)destination, sizeof(struct sockaddr_in));
+ 		break;
+ 	case AF_INET6:
+ 		ret = sendto(socket_fd, frame_data, frame_length, 0,
+-			     (struct sockaddr_in6 *)destination, sizeof(struct sockaddr_in6));
++			     (struct sockaddr *)destination, sizeof(struct sockaddr_in6));
+ 		break;
+ 	default:
+ 		ret = -EINVAL;
+@@ -107,11 +107,11 @@ static void udp_gen_and_send_frame(struct thread_context *thread_context, unsign
+ 	switch (destination->ss_family) {
+ 	case AF_INET:
+ 		ret = sendto(socket_fd, frame_data, frame_length, 0,
+-			     (struct sockaddr_in *)destination, sizeof(struct sockaddr_in));
++			     (struct sockaddr *)destination, sizeof(struct sockaddr_in));
+ 		break;
+ 	case AF_INET6:
+ 		ret = sendto(socket_fd, frame_data, frame_length, 0,
+-			     (struct sockaddr_in6 *)destination, sizeof(struct sockaddr_in6));
++			     (struct sockaddr *)destination, sizeof(struct sockaddr_in6));
+ 		break;
+ 	default:
+ 		ret = -EINVAL;
meta-oe/recipes-test/rtc-testbench/rtc-testbench_5.5.bb +1 -0
index 6aa2a76a09..92b5cac1a6 100644
@@ -15,6 +15,7 @@ LIC_FILES_CHKSUM = " \
 SRC_URI = " \
     git://github.com/Linutronix/RTC-Testbench.git;tag=v${PV};nobranch=1;protocol=https \
     file://0001-CMakeLists.txt-make-BPF-clang-and-include-paths-conf.patch \
+    file://0002-Fix-build-with-musl.patch \
 "
 SRCREV = "b7541b4b93b4d9fe6f395bc53d3cb50401d406a4"