kernel.mk: add KCFLAGS to make kmods reproducible
authorPaul Spooren <mail@aparcar.org>
Tue, 8 Oct 2019 23:11:27 +0000 (13:11 -1000)
committerPetr Štetiar <ynezz@true.cz>
Wed, 9 Oct 2019 07:13:44 +0000 (09:13 +0200)
Some kmods (gpio-hotplug, wireguard) store the build path in the
compiled files and therefore make it harder to rebuild the official
binaries. As the same "iremap" function is used as for other binaries,
the change is compatible with gcc7 and 8.

Tested with both gcc7 and gcc8 resulting in build path independent
reproducible builds.

Signed-off-by: Paul Spooren <mail@aparcar.org>
include/kernel.mk

index 73645330fe049f5c29ab8909edf2d34fe3d8ea40..439e910ebf0c173a97ca35ea9d6fef91fb350714 100644 (file)
@@ -104,6 +104,7 @@ endif
 KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
 
 KERNEL_MAKE_FLAGS = \
+       KCFLAGS="$(call iremap,$(BUILD_DIR),$(notdir $(BUILD_DIR)))" \
        HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
        CROSS_COMPILE="$(KERNEL_CROSS)" \
        ARCH="$(LINUX_KARCH)" \