[meta-freescale] [meta-fsl-ppc][PATCH 01/16] use 64b toolchain binaries to build e6500 kernel

b28495 at freescale.com b28495 at freescale.com
Fri Jul 17 00:17:37 PDT 2015


From: Ting Liu <ting.liu at freescale.com>

e6500 only supports 64b kernel. When building 64b kernel + 32b rootfs,
kernel build uses a hack previously, ie. append '-m64' and '-elf64ppc'
to 32b toolchain binaries. This fails if kernel use some builtin functions:
|   LINK    vmlinux
|   LD      vmlinux.o
| powerpc-fsl-linux-ld.bfd: Relocatable linking with relocations from
| format elf32-powerpc (.../4.9.2/libgcc.a(_popcountdi2.o)) to format
| elf64-powerpc (vmlinux.o) is not supported
| make: *** [vmlinux] Error 1
| ERROR: oe_runmake failed

modify KERNEL_{CC,LD,AR} to use 64b toolchain binaries to avoid error.

Signed-off-by: Ting Liu <ting.liu at freescale.com>
---
 classes/qoriq_build_64bit_kernel.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/classes/qoriq_build_64bit_kernel.bbclass b/classes/qoriq_build_64bit_kernel.bbclass
index 5dd8931..f145746 100644
--- a/classes/qoriq_build_64bit_kernel.bbclass
+++ b/classes/qoriq_build_64bit_kernel.bbclass
@@ -4,11 +4,15 @@ REQUIRED_DISTRO_FEATURES_e6500 += "multiarch"
 python () {
     promote_kernel = d.getVar('BUILD_64BIT_KERNEL')
     if promote_kernel == "1":
-        d.setVar('KERNEL_CC_append', ' -m64')
-        d.setVar('KERNEL_LD_append', ' -melf64ppc')
+        sys_multilib = 'powerpc64' + d.getVar('TARGET_VENDOR') + 'mllib64-' + d.getVar('HOST_OS')
+        tc_options = d.getVar('TOOLCHAIN_OPTIONS') + '/../lib64-' + d.getVar("MACHINE")
+        d.setVar('DEPENDS_append', ' lib64-gcc-cross-powerpc64 lib64-libgcc')
+        d.setVar('PATH_append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/' + sys_multilib)
+        d.setVar('KERNEL_CC', d.getVar('CCACHE') + sys_multilib + '-' + 'gcc' + d.getVar('HOST_CC_KERNEL_ARCH') + tc_options)
+        d.setVar('KERNEL_LD', d.getVar('CCACHE') + sys_multilib + '-' + 'ld.bfd' + d.getVar('HOST_LD_KERNEL_ARCH') + tc_options)
+        d.setVar('KERNEL_AR', d.getVar('CCACHE') + sys_multilib + '-' + 'ar' + d.getVar('HOST_AR_KERNEL_ARCH'))
 
     error_qa = d.getVar('ERROR_QA', True)
     if 'arch' in error_qa:
         d.setVar('ERROR_QA', error_qa.replace(' arch', ''))
 }
-
-- 
1.9.1



More information about the meta-freescale mailing list