From 06c826e3354e2553c2360e144c8a671aaee51ad8 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Fri, 17 Jul 2026 21:19:46 +0200 Subject: [PATCH] kernel: use iremap for assembly Currently assembly code of the Kernel may contain the build path, resulting in unreproducible firmware images (and Kernels). Fix this by adding a iremap KAFLAG. Before: strings "/path/to/vmlinux" | grep linux-6.18.38 /path/to/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.18.38 /path/to/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.18.38 After strings "/path/to/vmlinux" | grep linux-6.18.38 target-x86_64_musl/linux-x86_64/linux-6.18.38 target-x86_64_musl/linux-x86_64/linux-6.18.38 Link: https://github.com/openwrt/openwrt/pull/24271 Signed-off-by: Paul Spooren --- include/kernel.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/kernel.mk b/include/kernel.mk index 146346a4753..d19417bc152 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -102,6 +102,7 @@ KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS) KERNEL_MAKE_FLAGS = \ KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR))) $(filter-out -fno-plt,$(call qstrip,$(CONFIG_EXTRA_OPTIMIZATION))) $(call qstrip,$(CONFIG_KERNEL_CFLAGS))" \ + KAFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \ HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ CROSS_COMPILE="$(KERNEL_CROSS)" \ ARCH="$(LINUX_KARCH)" \ -- 2.47.3