From 18e709424a67e6daf191e683cd2a14dd032b4196 Mon Sep 17 00:00:00 2001 From: Mae PUGIN <48982737+mornepousse@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:59:45 +0200 Subject: [PATCH] Give conftest probes a module name Probes are compiled with $(KBUILD_CFLAGS) -DMODULE, but KBUILD_MODNAME is a per-object define kbuild adds outside KBUILD_CFLAGS, so probes never see it. On kernels with CONFIG_MEM_ALLOC_PROFILING=y every allocator expands through alloc_hooks -> DEFINE_ALLOC_TAG -> CT_MODULE_NAME, which codetag.h defines as KBUILD_MODNAME under #ifdef MODULE. Any probe touching an allocator then fails to compile regardless of whether the API exists: include/linux/codetag.h:64:24: error: 'KBUILD_MODNAME' undeclared EVDI_HAVE_KZALLOC_OBJ is left unset on kernels that do provide kzalloc_obj, the fallback in evdi_debug.h shadows the kernel macro, and the build fails: include/linux/acpi.h:69:50: error: macro 'kzalloc_obj' requires 2 arguments, but only 1 given Reproduced and fixed on Linux 7.1.8 and 7.2.0 with allocation profiling on; kernels built without it are unaffected, since DEFINE_ALLOC_TAG is empty there. Assisted-by: Claude Code (Claude Opus 5) Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Y8tKd3MUQYNFFo89sXDm3P --- module/conftest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/module/conftest.sh b/module/conftest.sh index 6d4ec02..eab25b1 100755 --- a/module/conftest.sh +++ b/module/conftest.sh @@ -32,6 +32,7 @@ requote() { done } CFLAGS=$(requote "$@") +CFLAGS="$CFLAGS '-DKBUILD_MODNAME=\"conftest\"' '-DKBUILD_BASENAME=\"conftest\"'" WORKDIR="$(mktemp -d)" trap 'rm -rf "$WORKDIR"' EXIT