From d33139c40aa5b93a07fd44b8dafcee735ca4f3e8 Mon Sep 17 00:00:00 2001 From: Tomasz Gajewski Date: Fri, 6 Jan 2023 10:40:26 +0100 Subject: [PATCH] enable ccache for reference Linux kernel Genode build system allows to easily enable 'ccache' for builds. This change allows to enable using 'ccache' also for build of reference Linux kernel used during porting device drivers. To enable 'ccache' it is enough to pass value of 'CC' variable when executing Linux build but this build by default depends on time when it is built which causes 'ccache' misses. To solve this issue additional flags are passed to make build independent from time, current user and host on which build is performed. Issue #4718 --- repos/dde_linux/src/virt_linux/arm_64/target.mk | 4 +++- repos/dde_linux/src/virt_linux/x86_32/target.mk | 4 +++- repos/dde_linux/src/virt_linux/x86_64/target.mk | 4 +++- repos/pc/src/pc_linux/x86_32/target.mk | 4 +++- repos/pc/src/pc_linux/x86_64/target.mk | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/repos/dde_linux/src/virt_linux/arm_64/target.mk b/repos/dde_linux/src/virt_linux/arm_64/target.mk index d1d39ad95c..0fdfa9199a 100644 --- a/repos/dde_linux/src/virt_linux/arm_64/target.mk +++ b/repos/dde_linux/src/virt_linux/arm_64/target.mk @@ -6,7 +6,9 @@ CUSTOM_TARGET_DEPS := kernel_build.phony LX_DIR := $(call select_from_ports,linux)/src/linux PWD := $(shell pwd) -LX_MK_ARGS = ARCH=arm64 CROSS_COMPILE=$(CROSS_DEV_PREFIX) +# options for Linux kernel build to not depend on current time, user and host +LX_MK_REPRODUCIBLE = KBUILD_BUILD_TIMESTAMP=no_timestamp KBUILD_BUILD_USER=genode KBUILD_BUILD_HOST=genode +LX_MK_ARGS = ARCH=arm64 CROSS_COMPILE=$(CROSS_DEV_PREFIX) CC=$(CC) $(LX_MK_REPRODUCIBLE) # # Linux kernel configuration diff --git a/repos/dde_linux/src/virt_linux/x86_32/target.mk b/repos/dde_linux/src/virt_linux/x86_32/target.mk index 9428ccc52f..7c0436870e 100644 --- a/repos/dde_linux/src/virt_linux/x86_32/target.mk +++ b/repos/dde_linux/src/virt_linux/x86_32/target.mk @@ -6,7 +6,9 @@ CUSTOM_TARGET_DEPS := kernel_build.phony LX_DIR := $(call select_from_ports,linux)/src/linux PWD := $(shell pwd) -LX_MK_ARGS = ARCH=x86 CROSS_COMPILE=$(CROSS_DEV_PREFIX) +# options for Linux kernel build to not depend on current time, user and host +LX_MK_REPRODUCIBLE = KBUILD_BUILD_TIMESTAMP=no_timestamp KBUILD_BUILD_USER=genode KBUILD_BUILD_HOST=genode +LX_MK_ARGS = ARCH=x86 CROSS_COMPILE=$(CROSS_DEV_PREFIX) CC=$(CC) $(LX_MK_REPRODUCIBLE) # # Linux kernel configuration diff --git a/repos/dde_linux/src/virt_linux/x86_64/target.mk b/repos/dde_linux/src/virt_linux/x86_64/target.mk index 8387212603..c07acd5681 100644 --- a/repos/dde_linux/src/virt_linux/x86_64/target.mk +++ b/repos/dde_linux/src/virt_linux/x86_64/target.mk @@ -6,7 +6,9 @@ CUSTOM_TARGET_DEPS := kernel_build.phony LX_DIR := $(call select_from_ports,linux)/src/linux PWD := $(shell pwd) -LX_MK_ARGS = ARCH=x86_64 CROSS_COMPILE=$(CROSS_DEV_PREFIX) +# options for Linux kernel build to not depend on current time, user and host +LX_MK_REPRODUCIBLE = KBUILD_BUILD_TIMESTAMP=no_timestamp KBUILD_BUILD_USER=genode KBUILD_BUILD_HOST=genode +LX_MK_ARGS = ARCH=x86_64 CROSS_COMPILE=$(CROSS_DEV_PREFIX) CC=$(CC) $(LX_MK_REPRODUCIBLE) # # Linux kernel configuration diff --git a/repos/pc/src/pc_linux/x86_32/target.mk b/repos/pc/src/pc_linux/x86_32/target.mk index df1df63e1e..f26c773999 100644 --- a/repos/pc/src/pc_linux/x86_32/target.mk +++ b/repos/pc/src/pc_linux/x86_32/target.mk @@ -6,7 +6,9 @@ CUSTOM_TARGET_DEPS := kernel_build.phony LX_DIR := $(call select_from_ports,linux)/src/linux PWD := $(shell pwd) -LX_MK_ARGS = ARCH=x86 CROSS_COMPILE=$(CROSS_DEV_PREFIX) +# options for Linux kernel build to not depend on current time, user and host +LX_MK_REPRODUCIBLE = KBUILD_BUILD_TIMESTAMP=no_timestamp KBUILD_BUILD_USER=genode KBUILD_BUILD_HOST=genode +LX_MK_ARGS = ARCH=x86 CROSS_COMPILE=$(CROSS_DEV_PREFIX) CC=$(CC) $(LX_MK_REPRODUCIBLE) # # Linux kernel configuration diff --git a/repos/pc/src/pc_linux/x86_64/target.mk b/repos/pc/src/pc_linux/x86_64/target.mk index 399c430628..7e863fd559 100644 --- a/repos/pc/src/pc_linux/x86_64/target.mk +++ b/repos/pc/src/pc_linux/x86_64/target.mk @@ -6,7 +6,9 @@ CUSTOM_TARGET_DEPS := kernel_build.phony LX_DIR := $(call select_from_ports,linux)/src/linux PWD := $(shell pwd) -LX_MK_ARGS = ARCH=x86_64 CROSS_COMPILE=$(CROSS_DEV_PREFIX) +# options for Linux kernel build to not depend on current time, user and host +LX_MK_REPRODUCIBLE = KBUILD_BUILD_TIMESTAMP=no_timestamp KBUILD_BUILD_USER=genode KBUILD_BUILD_HOST=genode +LX_MK_ARGS = ARCH=x86_64 CROSS_COMPILE=$(CROSS_DEV_PREFIX) CC=$(CC) $(LX_MK_REPRODUCIBLE) # # Linux kernel configuration