diff --git a/meta-oe/recipes-security/spdm-emu/files/0001-spdm_emu_mctp_kernel-provide-AF_MCTP-fallback-for-mu.patch b/meta-oe/recipes-security/spdm-emu/files/0001-spdm_emu_mctp_kernel-provide-AF_MCTP-fallback-for-mu.patch new file mode 100644 index 0000000000..80aa78bc08 --- /dev/null +++ b/meta-oe/recipes-security/spdm-emu/files/0001-spdm_emu_mctp_kernel-provide-AF_MCTP-fallback-for-mu.patch @@ -0,0 +1,45 @@ +From: Khem Raj +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. , 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 + 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 +--- +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 ++ ++/* ++ * AF_MCTP (Linux commit 583be982d934, v5.15) is a newer socket address ++ * family. assumes it is already declared by the libc's own ++ * socket headers and does not define it itself; this musl version's ++ * 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. + * diff --git a/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb b/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb index 2a9735fc7c..33c02dae72 100644 --- a/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb +++ b/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb @@ -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).