Patchwork Fix multiarch DISTRO_FEATURE

login
register
mail settings
Submitter Julian Pidancet
Date Dec. 1, 2011, 12:01 a.m.
Message ID <262b7b5f2bc5cf31b54a7f5d3ff27306a6a45de8.1322697616.git.julian.pidancet@gmail.com>
Download mbox | patch
Permalink /patch/15919/
State Accepted
Commit 0b42b2fc118bef8ce0d1473b146673182f5d1f78
Headers show

Comments

Richard Purdie - Nov. 30, 2011, 11:35 p.m.
On Thu, 2011-12-01 at 00:01 +0000, Julian Pidancet wrote:
> Make get_gcc_multiarch_setting more elegant. Use a dictionnary
> to store the config options and replace bb.data.getVar with d.getVar.
> Remove i686 from the architecture list because it doesn't seem
> to be a valid TARGET_ARCH any more in OE.
> Configure gdb (gdb and gdb-cross) with --enable-64-bit-bfd if
> multiarch DISTRO_FEATURE is present
> 
> Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
> ---
>  meta/recipes-devtools/gcc/gcc-common.inc |   17 ++++++++++-------
>  meta/recipes-devtools/gdb/gdb-common.inc |    1 +
>  2 files changed, 11 insertions(+), 7 deletions(-)

Applied to master, thanks and sorry about the mixup with the patches.

Cheers,

Richard
Julian Pidancet - Dec. 1, 2011, 12:01 a.m.
Make get_gcc_multiarch_setting more elegant. Use a dictionnary
to store the config options and replace bb.data.getVar with d.getVar.
Remove i686 from the architecture list because it doesn't seem
to be a valid TARGET_ARCH any more in OE.
Configure gdb (gdb and gdb-cross) with --enable-64-bit-bfd if
multiarch DISTRO_FEATURE is present

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
---
 meta/recipes-devtools/gcc/gcc-common.inc |   17 ++++++++++-------
 meta/recipes-devtools/gdb/gdb-common.inc |    1 +
 2 files changed, 11 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 7ec2f7e..fe112d9 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -22,13 +22,16 @@  def get_gcc_mips_plt_setting(bb, d):
     return ""
 
 def get_gcc_multiarch_setting(bb, d):
-    if 'multiarch' in bb.data.getVar('DISTRO_FEATURES',d,1).split() :
-        if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'i586', 'i686' ] :
-            return "--enable-targets=all"
-        if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'powerpc' ] :
-            return "--enable-targets=powerpc64"
-        if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'sparc' ] :
-            return "--enable-targets=all"
+    target_arch = d.getVar('TARGET_ARCH', True)
+    multiarch_options = {
+        "i586":    "--enable-targets=all",
+        "powerpc": "--enable-targets=powerpc64",
+        "sparc":   "--enable-targets=all",
+    }
+
+    if 'multiarch' in d.getVar('DISTRO_FEATURES', True).split() :
+        if target_arch in multiarch_options :
+            return multiarch_options[target_arch]
     return ""
 
 # We really need HOST_SYS here for some packages and TARGET_SYS for others.
diff --git a/meta/recipes-devtools/gdb/gdb-common.inc b/meta/recipes-devtools/gdb/gdb-common.inc
index e01b57c..d728139 100644
--- a/meta/recipes-devtools/gdb/gdb-common.inc
+++ b/meta/recipes-devtools/gdb/gdb-common.inc
@@ -41,6 +41,7 @@  EXPAT = "--without-expat"
 EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x \
                 --with-curses --disable-multilib --with-system-readline --disable-sim \
                 ${GDBPROPREFIX} --with-libelf=${STAGING_DIR_TARGET} ${EXPAT} \
+                ${@base_contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \
                "
 
 GDBPROPREFIX = "--program-prefix=''"