Skip to contentSkip to conversation

kernel.bbclass, module-base.bbclass: Use CC to form KERNEL_CC

PATCH In review Khem Raj 5 participants 10 messages Sep 12, 2012 – Sep 14, 2012

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/3 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

---
 meta/classes/kernel-arch.bbclass |   13 +++++++++++++
 meta/classes/kernel.bbclass      |   16 +---------------
 meta/classes/module-base.bbclass |   16 ----------------
 3 files changed, 14 insertions(+), 31 deletions(-)
meta/classes/kernel-arch.bbclass +13 -0
index 6446504..95a40f2 100644
@@ -42,3 +42,16 @@ def map_uboot_arch(a, d):
 
 export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', True), d)}"
 
+# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
+# specific options necessary for building the kernel and modules.
+TARGET_CC_KERNEL_ARCH ?= ""
+HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
+TARGET_LD_KERNEL_ARCH ?= ""
+HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
+TARGET_AR_KERNEL_ARCH ?= ""
+HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
+
+KERNEL_CC = "${CC} ${HOST_CC_KERNEL_ARCH}"
+KERNEL_LD = "${LD} ${HOST_LD_KERNEL_ARCH}"
+KERNEL_AR = "${AR} ${HOST_AR_KERNEL_ARCH}"
+
meta/classes/kernel.bbclass +1 -15
index fdef1be..bcb6bd5 100644
@@ -1,7 +1,7 @@
 inherit linux-kernel-base module_strip
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
+DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native update-modules"
 
 # we include gcc above, we dont need virtual/libc
 INHIBIT_DEFAULT_DEPS = "1"
@@ -37,20 +37,6 @@ KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.
 
 KERNEL_RELEASE ?= "${KERNEL_VERSION}"
 
-KERNEL_CCSUFFIX ?= ""
-KERNEL_LDSUFFIX ?= ""
-
-# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
-# specific options necessary for building the kernel and modules.
-#FIXME: should be this: TARGET_CC_KERNEL_ARCH ?= "${TARGET_CC_ARCH}"
-TARGET_CC_KERNEL_ARCH ?= ""
-HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
-TARGET_LD_KERNEL_ARCH ?= ""
-HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
-
-KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
-KERNEL_LD = "${HOST_PREFIX}ld${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}"
-
 # Where built kernel lies in the kernel tree
 KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
 KERNEL_IMAGEDEST = "boot"
meta/classes/module-base.bbclass +0 -16
index 9379bf8..f4ec2d4 100644
@@ -7,22 +7,6 @@ export CROSS_COMPILE = "${TARGET_PREFIX}"
 
 export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
 KERNEL_OBJECT_SUFFIX = ".ko"
-KERNEL_CCSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ccsuffix')}"
-KERNEL_LDSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ldsuffix')}"
-KERNEL_ARSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-arsuffix')}"
-
-# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
-# specific options necessary for building the kernel and modules.
-TARGET_CC_KERNEL_ARCH ?= ""
-HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
-TARGET_LD_KERNEL_ARCH ?= ""
-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${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}"
-KERNEL_LD = "${HOST_PREFIX}ld${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}"
-KERNEL_AR = "${HOST_PREFIX}ar${KERNEL_ARSUFFIX} ${HOST_AR_KERNEL_ARCH}"
 
 # kernel modules are generally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/3 runqemu: Explicitly specify MACHINE when calling bitbake

When using runqemu with distros outside oe-core then MACHINE may not be there in local.conf so use the one thats available in environment of runqemu which is actually the correct one.

---
 scripts/runqemu |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu +1 -1
index a3c3509..e843946 100755
@@ -281,7 +281,7 @@ setup_tmpdir() {
             exit 1; }
 
         # We have bitbake in PATH, get OE_TMPDIR from bitbake
-        OE_TMPDIR=`bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
+        OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
         if [ -z "$OE_TMPDIR" ]; then
             echo "Error: this script needs to be run from your build directory,"
             echo "or you need to explicitly set OE_TMPDIR in your environment"
Signature · 1 line
1.7.9.5
Acked-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] runqemu: Explicitly specify MACHINE when calling bitbake

Quoted 4 lines · Khem Raj

When using runqemu with distros outside oe-core then MACHINE may not be there in local.conf so use the one thats available in environment of runqemu which is actually the correct one.

Looks simple enough.

Quoted 20 lines
---
  scripts/runqemu |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu +1 -1
index a3c3509..e843946 100755
@@ -281,7 +281,7 @@ setup_tmpdir() {
              exit 1; }
 
          # We have bitbake in PATH, get OE_TMPDIR from bitbake
-        OE_TMPDIR=`bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
+        OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
          if [ -z "$OE_TMPDIR" ]; then
              echo "Error: this script needs to be run from your build directory,"
              echo "or you need to explicitly set OE_TMPDIR in your environment"
Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
Applied
#3 lore raw

Re: [PATCH 2/3] runqemu: Explicitly specify MACHINE when calling bitbake

In reply to Khem Raj
Quoted 16 lines · Khem Raj

When using runqemu with distros outside oe-core then MACHINE may not be there in local.conf so use the one thats available in environment of runqemu which is actually the correct one.

---
  scripts/runqemu |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu +0 -0
index a3c3509..e843946 100755

scripts/runqemu setup_tmpdir() { · line 287

Quoted 8 lines
scripts/runqemu +1 -1
@@ -281,7 +281,7 @@ setup_tmpdir() {
              exit 1; }
 
          # We have bitbake in PATH, get OE_TMPDIR from bitbake
-        OE_TMPDIR=`bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
+        OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
          if [ -z "$OE_TMPDIR" ]; then
              echo "Error: this script needs to be run from your build directory,"
              echo "or you need to explicitly set OE_TMPDIR in your environment"

Merged into OE-Core

Thanks
Sau!

author
#4 lore raw

PATCH 3/3 uclibc: Revert systemd regressing patch from upsteam uclibc

In reply to Khem Raj

This patch is causing systemd based systemd to not boot

---
 meta/recipes-core/uclibc/uclibc-git.inc            |    5 +-
 ...nt.c-wtent.c-move-functions-from-utxent.c.patch |  321 ++++++++++++++++++++
 2 files changed, 324 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
meta/recipes-core/uclibc/uclibc-git.inc +3 -2
index eec4ded..4da9c58 100644
@@ -1,9 +1,9 @@
-SRCREV="555ae2e88cd16a83f854634b6c3f35715b11d3d4"
+SRCREV="cb43f2afba0633400387fa7c55dda3396517f58a"
 
 DEFAULT_PREFERENCE = "-1"
 
 PV = "0.9.33+git${SRCPV}"
-PR = "${INC_PR}.3"
+PR = "${INC_PR}.4"
 
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}"
 
@@ -26,5 +26,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
 	file://0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \
 	file://0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch \
 	file://mount.h-update.patch \
+	file://0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch \
 	"
 S = "${WORKDIR}/git"
meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch new file +321 -0

321 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH 3/3] uclibc: Revert systemd regressing patch from upsteam uclibc

Quoted 14 lines · Khem Raj

This patch is causing systemd based systemd to not boot

---
 meta/recipes-core/uclibc/uclibc-git.inc            |    5 +-
 ...nt.c-wtent.c-move-functions-from-utxent.c.patch |  321 ++++++++++++++++++++
 2 files changed, 324 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
meta/recipes-core/uclibc/uclibc-git.inc +0 -0
index eec4ded..4da9c58 100644

meta/recipes-core/uclibc/uclibc-git.inc line 1

Quoted 2 lines
meta/recipes-core/uclibc/uclibc-git.inc +1 -1
@@ -1,9 +1,9 @@
-SRCREV="555ae2e88cd16a83f854634b6c3f35715b11d3d4"
+SRCREV="cb43f2afba0633400387fa7c55dda3396517f58a"

Why are you changing SRCREV as well?

p.

author
#6 lore raw

Re: [PATCH 3/3] uclibc: Revert systemd regressing patch from upsteam uclibc

Quoted 1 line · Phil Blundell

Why are you changing SRCREV as well?

Well I forgot to mention is in commit about SRCREV bump. I have tested the revert on top of the proposed SRCREV

I will send a V2 with more details in commit log

#7 lore raw
In reply to Khem Raj
Quoted 4 lines · Khem Raj

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.

Historically, the kernel compiler has indeed been special: there have been some machines where, due to bugs in the kernel or the compiler or both, we need to use a different version of the compiler for the kernel than we use for userspace. The most famous example of this were the old ARM kernels back in the day which needed gcc-2.95 long after everyone else had stopped using it, but I think there might be a few cases where the same situation obtains even today.

If you remove ${KERNEL_CCSUFFIX} then we will lose the ability to do that (easily). I'm not necessarily opposed to such a change but I think it does need to be justified with clear benefits.

p.

author
#8 lore raw
Quoted 6 lines · Phil Blundell
Quoted 4 lines · Khem Raj

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.

Quoted 7 lines

Historically, the kernel compiler has indeed been special: there have been some machines where, due to bugs in the kernel or the compiler or both, we need to use a different version of the compiler for the kernel than we use for userspace. The most famous example of this were the old ARM kernels back in the day which needed gcc-2.95 long after everyone else had stopped using it, but I think there might be a few cases where the same situation obtains even today.

I agree with history but we have moved away from 2.9x for long. moreover v1 of this patch has been posted for weeks no one raised a concern which I take that such cases are not there anymore with OE-Core

Quoted 5 lines

If you remove ${KERNEL_CCSUFFIX} then we will lose the ability to do that (easily). I'm not necessarily opposed to such a change but I think it does need to be justified with clear benefits.

again if there is a usecase with OE-Core of such a kind. I will be happy to deal with it no one has shown me one.

Quoted 3 lines

p.

#9 lore raw

Op 12 sep. 2012, om 09:49 heeft Khem Raj <[email protected]> het volgende geschreven:

Quoted 21 lines · Phil Blundell
Quoted 6 lines · Khem Raj
Quoted 4 lines

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.

Quoted 7 lines

Historically, the kernel compiler has indeed been special: there have been some machines where, due to bugs in the kernel or the compiler or both, we need to use a different version of the compiler for the kernel than we use for userspace. The most famous example of this were the old ARM kernels back in the day which needed gcc-2.95 long after everyone else had stopped using it, but I think there might be a few cases where the same situation obtains even today.

I agree with history but we have moved away from 2.9x for long. moreover v1 of this patch has been posted for weeks no one raised a concern which I take that such cases are not there anymore with OE-Core

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

If you remove ${KERNEL_CCSUFFIX} then we will lose the ability to do that (easily). I'm not necessarily opposed to such a change but I think it does need to be justified with clear benefits.

again if there is a usecase with OE-Core of such a kind. I will be happy to deal with it no one has shown me one.

The archos vendor kernels only work when built with CSL 2007, a common problem with TI kernels from that era