summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-01-19 14:40:03 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 12:58:56 +0000
commita3ca06c3b45c791dd38dbf154ad0fc62b4063475 (patch)
treec9f9ac7f1b93869418e901794d1179f300f3d140
parente344f3e7d5c74735e58c85ec90521395a4cf9b01 (diff)
downloadpoky-a3ca06c3b45c791dd38dbf154ad0fc62b4063475.tar.gz
kernel.bbclass, module-base.bbclass: Use CC to form KERNEL_CC
kernel compiler is not special and we currently have it so we want to pass -march and -mtune options as CFLAGS to kernel build so that compiler picks the right subarch flags when compiling assembly files in particular. Otherwise defaults are chosen which may not be right in many case e.g. when compiling kernel for collie machine we should use arch=armv4 but it uses toolchain/as defaults which is armv5te in some case e.g. thumb1 we know that kernel can not be compiled in thumb1 mode so we can provide that information e.g. -marm option through KERNEL_HOST_CC_ARCH variable as we do now (From OE-Core rev: c49f967384ccbfe131bbb33ee518014f3fc4b38f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-arch.bbclass13
-rw-r--r--meta/classes/kernel.bbclass16
-rw-r--r--meta/classes/module-base.bbclass16
3 files changed, 14 insertions, 31 deletions
diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass
index b3b78b6278..a51e82b6c4 100644
--- a/meta/classes/kernel-arch.bbclass
+++ b/meta/classes/kernel-arch.bbclass
@@ -43,3 +43,16 @@ def map_uboot_arch(a, d):
43 43
44export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', True), d)}" 44export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', True), d)}"
45 45
46# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
47# specific options necessary for building the kernel and modules.
48TARGET_CC_KERNEL_ARCH ?= ""
49HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
50TARGET_LD_KERNEL_ARCH ?= ""
51HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
52TARGET_AR_KERNEL_ARCH ?= ""
53HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
54
55KERNEL_CC = "${CC} ${HOST_CC_KERNEL_ARCH}"
56KERNEL_LD = "${LD} ${HOST_LD_KERNEL_ARCH}"
57KERNEL_AR = "${AR} ${HOST_AR_KERNEL_ARCH}"
58
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index d459569677..e2a582b9e9 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -1,7 +1,7 @@
1inherit linux-kernel-base module_strip 1inherit linux-kernel-base module_strip
2 2
3PROVIDES += "virtual/kernel" 3PROVIDES += "virtual/kernel"
4DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX}" 4DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native"
5 5
6# we include gcc above, we dont need virtual/libc 6# we include gcc above, we dont need virtual/libc
7INHIBIT_DEFAULT_DEPS = "1" 7INHIBIT_DEFAULT_DEPS = "1"
@@ -37,20 +37,6 @@ KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.
37 37
38KERNEL_RELEASE ?= "${KERNEL_VERSION}" 38KERNEL_RELEASE ?= "${KERNEL_VERSION}"
39 39
40KERNEL_CCSUFFIX ?= ""
41KERNEL_LDSUFFIX ?= ""
42
43# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
44# specific options necessary for building the kernel and modules.
45#FIXME: should be this: TARGET_CC_KERNEL_ARCH ?= "${TARGET_CC_ARCH}"
46TARGET_CC_KERNEL_ARCH ?= ""
47HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
48TARGET_LD_KERNEL_ARCH ?= ""
49HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
50
51KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
52KERNEL_LD = "${HOST_PREFIX}ld${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
53
54# Where built kernel lies in the kernel tree 40# Where built kernel lies in the kernel tree
55KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}" 41KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
56KERNEL_IMAGEDEST = "boot" 42KERNEL_IMAGEDEST = "boot"
diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass
index 210c47ccd9..cfee50a598 100644
--- a/meta/classes/module-base.bbclass
+++ b/meta/classes/module-base.bbclass
@@ -7,22 +7,6 @@ export CROSS_COMPILE = "${TARGET_PREFIX}"
7 7
8export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}" 8export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
9KERNEL_OBJECT_SUFFIX = ".ko" 9KERNEL_OBJECT_SUFFIX = ".ko"
10KERNEL_CCSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ccsuffix')}"
11KERNEL_LDSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ldsuffix')}"
12KERNEL_ARSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-arsuffix')}"
13
14# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
15# specific options necessary for building the kernel and modules.
16TARGET_CC_KERNEL_ARCH ?= ""
17HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
18TARGET_LD_KERNEL_ARCH ?= ""
19HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
20TARGET_AR_KERNEL_ARCH ?= ""
21HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
22
23KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}"
24KERNEL_LD = "${HOST_PREFIX}ld${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}"
25KERNEL_AR = "${HOST_PREFIX}ar${KERNEL_ARSUFFIX} ${HOST_AR_KERNEL_ARCH}"
26 10
27# kernel modules are generally machine specific 11# kernel modules are generally machine specific
28PACKAGE_ARCH = "${MACHINE_ARCH}" 12PACKAGE_ARCH = "${MACHINE_ARCH}"