Skip to contentSkip to conversation

kernel: Fix QA buildpaths warning for kernel modules

PATCH In review [email protected] 2 participants 3 messages Feb 5, 2018 – Feb 8, 2018

lore
Share & tools
lore
#0 lore raw

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
index cf0edb6..e0fe22b 100644
@@ -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
author
#1 lore raw

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_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
index cf0edb6..e0fe22b 100644
@@ -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"
#2 lore raw
Quoted 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,
Zhe

Quoted 22 lines · On 2018年02月05日 14:54, [email protected] wrote:

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 +0 -0
index cf0edb6..e0fe22b 100644
@@ -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 -0
  KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
  KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
  TOOLCHAIN = "gcc"