All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Explicitly map ARCH to 32 or 64 bit for Intel machines
@ 2015-12-03 23:03 Jianxun Zhang
  2015-12-03 23:31 ` Saul Wold
  0 siblings, 1 reply; 3+ messages in thread
From: Jianxun Zhang @ 2015-12-03 23:03 UTC (permalink / raw)
  To: openembedded-core

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 arch if
ARCH is "x86" (arch/x86/Makefile)
() bare-bone kernel recipe inherits directly from kernel without
other special treatment

Build will fail in this case because of the mismatched architecture
of kernel image after compiling.

The patch sets ARCH i386 or x86_64 explicitly to configure
task to avoid this host contamination.

Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
---
 meta/classes/kernel-arch.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass
index 3ed5986..d8b180e 100644
--- a/meta/classes/kernel-arch.bbclass
+++ b/meta/classes/kernel-arch.bbclass
@@ -21,7 +21,9 @@ def map_kernel_arch(a, d):
 
     valid_archs = d.getVar('valid_archs', True).split()
 
-    if   re.match('(i.86|athlon|x86.64)$', a):  return 'x86'
+    if   re.match('i.86$', a):                  return 'i386'
+    elif re.match('x86.64$', a):                return 'x86_64'
+    elif re.match('athlon$', a):                return 'x86'
     elif re.match('armeb$', a):                 return 'arm'
     elif re.match('aarch64$', a):               return 'arm64'
     elif re.match('aarch64_be$', a):            return 'arm64'
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Explicitly map ARCH to 32 or 64 bit for Intel machines
  2015-12-03 23:03 [PATCH] Explicitly map ARCH to 32 or 64 bit for Intel machines Jianxun Zhang
@ 2015-12-03 23:31 ` Saul Wold
  2015-12-10  0:07   ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2015-12-03 23:31 UTC (permalink / raw)
  To: Jianxun Zhang, openembedded-core

On Thu, 2015-12-03 at 15:03 -0800, Jianxun Zhang wrote:
> 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 arch if
> ARCH is "x86" (arch/x86/Makefile)
> () bare-bone kernel recipe inherits directly from kernel without
> other special treatment
> 
> Build will fail in this case because of the mismatched architecture
> of kernel image after compiling.
> 
> The patch sets ARCH i386 or x86_64 explicitly to configure
> task to avoid this host contamination.
> 
Just to be clear about this, it does not change the TUNE_ARCH, the ARCH
that is set is local to the kernel-arch.bbclass.

This should also be a candidate for backport to Jethro

Sau!

> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
> ---
>  meta/classes/kernel-arch.bbclass | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-
> arch.bbclass
> index 3ed5986..d8b180e 100644
> --- a/meta/classes/kernel-arch.bbclass
> +++ b/meta/classes/kernel-arch.bbclass
> @@ -21,7 +21,9 @@ def map_kernel_arch(a, d):
>  
>      valid_archs = d.getVar('valid_archs', True).split()
>  
> -    if   re.match('(i.86|athlon|x86.64)$', a):  return 'x86'
> +    if   re.match('i.86$', a):                  return 'i386'
> +    elif re.match('x86.64$', a):                return 'x86_64'
> +    elif re.match('athlon$', a):                return 'x86'
>      elif re.match('armeb$', a):                 return 'arm'
>      elif re.match('aarch64$', a):               return 'arm64'
>      elif re.match('aarch64_be$', a):            return 'arm64'
> -- 
> 1.9.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Explicitly map ARCH to 32 or 64 bit for Intel machines
  2015-12-03 23:31 ` Saul Wold
@ 2015-12-10  0:07   ` Burton, Ross
  0 siblings, 0 replies; 3+ messages in thread
From: Burton, Ross @ 2015-12-10  0:07 UTC (permalink / raw)
  To: Saul Wold; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

On 3 December 2015 at 23:31, Saul Wold <saul.wold@intel.com> wrote:

> Just to be clear about this, it does not change the TUNE_ARCH, the ARCH
> that is set is local to the kernel-arch.bbclass.
>
> This should also be a candidate for backport to Jethro
>

This also appears to be the cause of lttng-modules breaking in my staging
branch:

http://errors.yoctoproject.org/Errors/Details/22254/

Ross

[-- Attachment #2: Type: text/html, Size: 1077 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-10  0:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 23:03 [PATCH] Explicitly map ARCH to 32 or 64 bit for Intel machines Jianxun Zhang
2015-12-03 23:31 ` Saul Wold
2015-12-10  0:07   ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.