Patchwork [meta-fsl-ppc,3/6] asf: build as 64-bit kernel module on e6500

login
register
mail settings
Submitter Ting Liu
Date Oct. 9, 2013, 7:33 a.m.
Message ID <1381303991-11600-4-git-send-email-b28495@freescale.com>
Download mbox | patch
Permalink /patch/59549/
State Accepted
Headers show

Comments

Ting Liu - Oct. 9, 2013, 7:33 a.m.
From: Ting Liu <b28495@freescale.com>

e6500 is built with 32b rootfs/64b kernel, build asf as 64bit too.

Fix the below build issue on e6500 core:
| DEBUG: Executing shell function do_make_scripts
| make: Entering directory
`.../tmp/sysroots/t4240qds/usr/src/kernel'
|   CC      scripts/mod/empty.o
| scripts/mod/empty.c:1:0: error: -mcmodel not supported in this
configuration
| make[2]: *** [scripts/mod/empty.o] Error 1
| make[1]: *** [scripts/mod] Error 2
| make: *** [scripts] Error 2

Signed-off-by: Ting Liu <b28495@freescale.com>
---
 recipes-kernel/asf/asf_git.bb |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

Patch

diff --git a/recipes-kernel/asf/asf_git.bb b/recipes-kernel/asf/asf_git.bb
index 6a6917f..e3fa896 100644
--- a/recipes-kernel/asf/asf_git.bb
+++ b/recipes-kernel/asf/asf_git.bb
@@ -14,6 +14,25 @@  S = "${WORKDIR}/git/asfmodule"
 
 EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} KERNEL_PATH=${STAGING_KERNEL_DIR}"
 
+python () {
+    ma = d.getVar("DISTRO_FEATURES", True)
+    arch = d.getVar("OVERRIDES", True)
+
+    # the : after the arch is to skip the message on 64b
+    if not "multiarch" in ma and "e6500:" in arch:
+        raise bb.parse.SkipPackage("Building the kernel for this arch requires multiarch to be in DISTRO_FEATURES")
+
+    promote_kernel = d.getVar('BUILD_64BIT_KERNEL')
+
+    if promote_kernel == "1":
+        d.setVar('KERNEL_CC_append', ' -m64')
+        d.setVar('KERNEL_LD_append', ' -melf64ppc')
+
+    error_qa = d.getVar('ERROR_QA', True)
+    if 'arch' in error_qa:
+        d.setVar('ERROR_QA', error_qa.replace(' arch', ''))
+}
+
 do_install(){
 	mkdir -p ${D}/usr/driver/asf
 	cp -rf ${S}/bin/full ${D}/usr/driver/asf