kernel: Fix QA buildpaths warning for kernel modules
PATCH 1/1 kernel: Fix QA buildpaths warning for kernel modules
From: He Zhe <[email protected]>
CFLAGS is unset during kernel_do_compile and thus the default build path substitutions in DEBUG_PREFIX_MAP are missing.
To enhance reproducible build for kernel modules, such as lttng-modules and cryptodev-module, this patch appends them, plus substitution of STAGING_KERNEL_DIR, to KERNEL_CC.
--- meta/classes/kernel-arch.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-arch.bbclass +1 -1
@@ -57,7 +57,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" TARGET_AR_KERNEL_ARCH ?= "" HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}" -KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd" +KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}" KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" TOOLCHAIN = "gcc"
Signature · 1 line
2.8.1
Hi Bruce,
I should have cc this to you.
Thanks,
Zhe
Quoted 27 lines · On 2018年02月05日 14:54, [email protected] wrote:
From: He Zhe <[email protected]>
CFLAGS is unset during
kernel_do_compileand thus the default build path substitutions inDEBUG_PREFIX_MAPare missing.To enhance reproducible build for kernel modules, such as lttng-modules and cryptodev-module, this patch appends them, plus substitution of
STAGING_KERNEL_DIR, toKERNEL_CC.Signed-off-by He Zhe <[email protected]>--- meta/classes/kernel-arch.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes/kernel-arch.bbclass +1
-1@@ -57,7 +57,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" TARGET_AR_KERNEL_ARCH ?= "" HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}" -KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd" +KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}" KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" TOOLCHAIN = "gcc"
Bruce Ashfield
Acked-byQuoted 4 lines · He Zhe
Hi Bruce,
I should have cc this to you.
Thanks, I had missed the original patch. See below for comments.
Quoted 26 lines
Thanks,
ZheQuoted 22 lines · On 2018年02月05日 14:54, [email protected] wrote:
From: He Zhe <[email protected]>
CFLAGS is unset during
kernel_do_compileand thus the default build path substitutions inDEBUG_PREFIX_MAPare missing.To enhance reproducible build for kernel modules, such as lttng-modules and cryptodev-module, this patch appends them, plus substitution of
STAGING_KERNEL_DIR, toKERNEL_CC.Signed-off-by He Zhe <[email protected]>--- meta/classes/kernel-arch.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes/kernel-arch.bbclass +0
-0@@ -57,7 +57,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" TARGET_AR_KERNEL_ARCH ?= "" HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
Quoted 2 lines
meta/classes/kernel-arch.bbclass HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" · line 60
Quoted 2 lines
meta/classes/kernel-arch.bbclass +1
-1-KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd" +KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}"
Generally speaking we do not want to leak build system flags/options into the kernel build, but in this case the flags are related to the symbols/compiler versus flags influencing the code in the executables .. and they are similar to the other flags we do pass into the build.
So no concerns from me.
Quoted 4 lines
Quoted 3 lines
meta/classes/kernel-arch.bbclass +0
-0KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" TOOLCHAIN = "gcc"