summaryrefslogtreecommitdiff
path: root/import-layers
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-06-28 22:34:29 +0300
committerWilliam A. Kennington III <wak@google.com>2018-06-29 08:01:00 +0300
commit47649fa5fcb313159e29633bda1185c16c0e687d (patch)
treef30f78310c455c29f0ddf7bd861fcfd798508f3f /import-layers
parente286c4a0ac4a9d6221d228abdfef71bf9e9f36a7 (diff)
downloadopenbmc-47649fa5fcb313159e29633bda1185c16c0e687d.tar.xz
kernel: specify dependencies for compilation for config tasks
With recent kernels (i.e. 4.17+) the configuration phase of the kernel will check for capabilities/options of the compiler for CVE and other mitigation support. For a general kernel, we want to ensure that CC is fully defined when the config targets are invoked (so the proper compiler will be checked). For linux-yocto, we also need to specify the compiler/tools dependencies for the configme task since it executes before configure and hence the main kernel build DEPENDS will not always be in the sysroot before it executes. Without those dependencies the kernel will be incorrectly configured (i.e. bison is missing) or the configuration will fail the mitigation tests. [YOCTO #12757] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: William A. Kennington III <wak@google.com> Change-Id: Ife5a5fb09523a7dfe359db49254a7600b4420a4c Upstream: openembedded/openembedded-core@ff1bdd75d50f0ebac3d599e461685ace29559a82
Diffstat (limited to 'import-layers')
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass5
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel.bbclass2
2 files changed, 5 insertions, 2 deletions
diff --git a/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass b/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
index 4ac3a39e4..82d80741a 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
@@ -275,6 +275,9 @@ addtask kernel_metadata after do_validate_branches do_unpack before do_patch
do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot"
do_validate_branches[depends] = "kern-tools-native:do_populate_sysroot"
+do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot"
+do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot"
+do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot"
do_kernel_configme[dirs] += "${S} ${B}"
do_kernel_configme() {
set +e
@@ -304,7 +307,7 @@ do_kernel_configme() {
bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)"
fi
- CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1
+ CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1
if [ $? -ne 0 ]; then
bbfatal_log "Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
fi
diff --git a/import-layers/yocto-poky/meta/classes/kernel.bbclass b/import-layers/yocto-poky/meta/classes/kernel.bbclass
index 78d6c30b0..727851401 100644
--- a/import-layers/yocto-poky/meta/classes/kernel.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel.bbclass
@@ -489,7 +489,7 @@ sysroot_stage_all () {
:
}
-KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig"
+KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} oldnoconfig"
python check_oldest_kernel() {
oldest_kernel = d.getVar('OLDEST_KERNEL')