diff options
| author | Jianxun Zhang <jianxun.zhang@linux.intel.com> | 2016-01-12 13:53:56 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-15 15:51:41 +0000 |
| commit | a6f52930a68d8462e23486d51cdda715072dd752 (patch) | |
| tree | 61c2de6b1ad36527ddb682c09a210b046b87c029 | |
| parent | e79a538a54b04fa97174127f930e1fd5df0f5066 (diff) | |
| download | poky-a6f52930a68d8462e23486d51cdda715072dd752.tar.gz | |
kernel/kernel-arch: Explicitly mapping between i386/x86_64 and x86 for kernel ARCH
For a bare-bone kernel recipe which specifies 32 bit x86 target,
a 64 bit .config will be generated from do_configure task when
building 32-bit qemux86, once all of these conditions are true:
* arch of host is x86_64
* kernel source tree used in build has commit ffee0de41 which
actually chooses i386 or x86_64 defconfig by asking host when
ARCH is "x86" (arch/x86/Makefile)
* bare-bone kernel recipe inherits directly from kernel without
other special treatments.
Build will fail because of the mismatched kernel architecture.
The patch sets ARCH i386 or x86_64 explicitly to configure
task to avoid this host contamination. Kernel artifact is also
changed so that it can map i386 and x64 back to arch/x86 when
needed.
(From OE-Core rev: 6ffcfc0bc08bcbe81e17ceeb7094f09cc9214b94)
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/kernel-arch.bbclass | 4 | ||||
| -rw-r--r-- | meta/classes/kernel.bbclass | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass index 3ed5986a52..d8b180ec49 100644 --- a/meta/classes/kernel-arch.bbclass +++ b/meta/classes/kernel-arch.bbclass | |||
| @@ -21,7 +21,9 @@ def map_kernel_arch(a, d): | |||
| 21 | 21 | ||
| 22 | valid_archs = d.getVar('valid_archs', True).split() | 22 | valid_archs = d.getVar('valid_archs', True).split() |
| 23 | 23 | ||
| 24 | if re.match('(i.86|athlon|x86.64)$', a): return 'x86' | 24 | if re.match('i.86$', a): return 'i386' |
| 25 | elif re.match('x86.64$', a): return 'x86_64' | ||
| 26 | elif re.match('athlon$', a): return 'x86' | ||
| 25 | elif re.match('armeb$', a): return 'arm' | 27 | elif re.match('armeb$', a): return 'arm' |
| 26 | elif re.match('aarch64$', a): return 'arm64' | 28 | elif re.match('aarch64$', a): return 'arm64' |
| 27 | elif re.match('aarch64_be$', a): return 'arm64' | 29 | elif re.match('aarch64_be$', a): return 'arm64' |
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 5e8b6cf343..ee3e9a0d94 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
| @@ -309,9 +309,18 @@ do_shared_workdir () { | |||
| 309 | cp -fR include/generated/* $kerneldir/include/generated/ | 309 | cp -fR include/generated/* $kerneldir/include/generated/ |
| 310 | fi | 310 | fi |
| 311 | 311 | ||
| 312 | if [ -d arch/${ARCH}/include/generated ]; then | 312 | # When ARCH is set to i386 or x86_64, we need to map ARCH to the real name of src |
| 313 | mkdir -p $kerneldir/arch/${ARCH}/include/generated/ | 313 | # dir (x86) under arch/ of kenrel tree, so that we can find correct source to copy. |
| 314 | cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/ | 314 | |
| 315 | if [ "${ARCH}" = "i386" ] || [ "${ARCH}" = "x86_64" ]; then | ||
| 316 | KERNEL_SRCARCH=x86 | ||
| 317 | else | ||
| 318 | KERNEL_SRCARCH=${ARCH} | ||
| 319 | fi | ||
| 320 | |||
| 321 | if [ -d arch/${KERNEL_SRCARCH}/include/generated ]; then | ||
| 322 | mkdir -p $kerneldir/arch/${KERNEL_SRCARCH}/include/generated/ | ||
| 323 | cp -fR arch/${KERNEL_SRCARCH}/include/generated/* $kerneldir/arch/${KERNEL_SRCARCH}/include/generated/ | ||
| 315 | fi | 324 | fi |
| 316 | } | 325 | } |
| 317 | 326 | ||
