[OE-core] [PATCH] goarch.bbclass: rework mips architecture checks

Matt Madison matt at madison.systems
Wed Sep 27 12:01:46 UTC 2017


Move the mips32r2->mips32 rewrite to an anonymous
python function, and change the GOARCH setting to
use just the passed-in architecture string, to
avoid an unwanted variable dependency.

Signed-off-by: Matt Madison <matt at madison.systems>
---
 meta/classes/goarch.bbclass | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 9ed562d..7553987 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -43,14 +43,10 @@ def go_map_arch(a, d):
         return 'mips64le'
     elif re.match('mips64*', a):
         return 'mips64'
-    elif re.match('mips.*', a):
-        tf = d.getVar('TUNE_FEATURES').split()
-        if 'fpu-hard' in tf and 'n32' not in tf:
-            if 'mips32r2' in tf:
-                newtf = [t for t in tf if t != 'mips32r2']
-                newtf.append('mips32')
-                d.setVar('TUNE_FEATURES', ' '.join(newtf))
-            return 'mips' if 'bigendian' in tf else 'mipsle'
+    elif re.match('mipsel.*', a) and 'r6' not in a and '-nf' not in a and '-n32' not in a:
+        return 'mipsle'
+    elif re.match('mips', a) and 'r6' not in a and '-nf' not in a and '-n32' not in a:
+        return 'mipsle'
     elif re.match('p(pc|owerpc)(64)', a):
         return 'ppc64'
     elif re.match('p(pc|owerpc)(64el)', a):
@@ -74,4 +70,10 @@ def go_map_os(o, d):
         return 'linux'
     return o
 
-
+python __anonymous () {
+    tf = d.getVar('TUNE_FEATURES').split()
+    if 'mips32r2' in tf:
+        newtf = [t for t in tf if t != 'mips32r2']
+        newtf.append('mips32')
+        d.setVar('TUNE_FEATURES', ' '.join(newtf))
+}
-- 
2.7.4




More information about the Openembedded-core mailing list