Skip to contentSkip to conversation

goarch.bbclass: Replace logic for setting GOARM

PATCH Superseded Will Newton 3 participants 5 messages Sep 7, 2017 – Sep 8, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 goarch.bbclass: Replace logic for setting GOARM

The previous logic applied a regex to TUNE_FEATURES which could set the GOARM value to 7 incorrectly, for example when dealing with an arm1176 core. Simplify to check for the presence of "armv7a" instead. At the same time add a check for "armv6" and set GOARM to 6 in that case.

---
 meta/classes/goarch.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/goarch.bbclass +5 -2
index 4a5b2ec..35f2987 100644
@@ -38,8 +38,11 @@ def go_map_arch(a, d):
 
 def go_map_arm(a, f, d):
     import re
-    if re.match('arm.*', a) and re.match('arm.*7.*', f):
-        return '7'
+    if re.match('arm.*', a):
+        if 'armv7a' in f:
+            return '7'
+        elif 'armv6' in f:
+            return '6'
     return ''
 
 def go_map_os(o, d):
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Will Newton

The previous logic applied a regex to TUNE_FEATURES which could set the GOARM value to 7 incorrectly, for example when dealing with an arm1176 core. Simplify to check for the presence of "armv7a" instead. At the same time add a check for "armv6" and set GOARM to 6 in that case.

this looks ok

Quoted 31 lines
---
 meta/classes/goarch.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/goarch.bbclass +5 -3
index 4a5b2ec..35f2987 100644
@@ -38,8 +38,11 @@ def go_map_arch(a, d):
 
 def go_map_arm(a, f, d):
     import re
-    if re.match('arm.*', a) and re.match('arm.*7.*', f):
-        return '7'
+    if re.match('arm.*', a):
+        if 'armv7a' in f:
+            return '7'
+        elif 'armv6' in f:
+            return '6'
     return ''
 
 def go_map_os(o, d):
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
In reply to Will Newton
Quoted 16 lines · Will Newton

The previous logic applied a regex to TUNE_FEATURES which could set the GOARM value to 7 incorrectly, for example when dealing with an arm1176 core. Simplify to check for the presence of "armv7a" instead. At the same time add a check for "armv6" and set GOARM to 6 in that case.

---
 meta/classes/goarch.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/goarch.bbclass +0 -0
index 4a5b2ec..35f2987 100644

meta/classes/goarch.bbclass def go_map_arch(a, d): · line 42

Quoted 7 lines
meta/classes/goarch.bbclass +2 -2
@@ -38,8 +38,11 @@ def go_map_arch(a, d):
 
 def go_map_arm(a, f, d):
     import re
-    if re.match('arm.*', a) and re.match('arm.*7.*', f):
-        return '7'
+    if re.match('arm.*', a):
+        if 'armv7a' in f:

You need to test for both armv7a (Cortex A9, etc) and armv7ve (Cortex A7, A15, etc).

Quoted 14 lines
meta/classes/goarch.bbclass +3 -1
+            return '7'
+        elif 'armv6' in f:
+            return '6'
     return ''
 
 def go_map_os(o, d):
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 18 lines · Andre McCurdy
Quoted 17 lines · Will Newton

The previous logic applied a regex to TUNE_FEATURES which could set the GOARM value to 7 incorrectly, for example when dealing with an arm1176 core. Simplify to check for the presence of "armv7a" instead. At the same time add a check for "armv6" and set GOARM to 6 in that case.

---
 meta/classes/goarch.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/goarch.bbclass +0 -0
index 4a5b2ec..35f2987 100644
@@ -38,8 +38,11 @@ def go_map_arch(a, d):
 
Quoted 9 lines

meta/classes/goarch.bbclass def go_map_arch(a, d): · line 42

Quoted 6 lines
meta/classes/goarch.bbclass +2 -2
 def go_map_arm(a, f, d):
     import re
-    if re.match('arm.*', a) and re.match('arm.*7.*', f):
-        return '7'
+    if re.match('arm.*', a):
+        if 'armv7a' in f:

You need to test for both armv7a (Cortex A9, etc) and armv7ve (Cortex A7, A15, etc).

yes good point.

Quoted 20 lines
Quoted 10 lines
meta/classes/goarch.bbclass +3 -1
+            return '7'
+        elif 'armv6' in f:
+            return '6'
     return ''
 
 def go_map_os(o, d):
--

2.7.4

Quoted 5 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
In reply to Andre McCurdy
Quoted 18 lines · Andre McCurdy
Quoted 17 lines · Will Newton

The previous logic applied a regex to TUNE_FEATURES which could set the GOARM value to 7 incorrectly, for example when dealing with an arm1176 core. Simplify to check for the presence of "armv7a" instead. At the same time add a check for "armv6" and set GOARM to 6 in that case.

---
 meta/classes/goarch.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/goarch.bbclass +0 -0
index 4a5b2ec..35f2987 100644
@@ -38,8 +38,11 @@ def go_map_arch(a, d):
 
Quoted 9 lines

meta/classes/goarch.bbclass def go_map_arch(a, d): · line 42

Quoted 6 lines
meta/classes/goarch.bbclass +2 -2
 def go_map_arm(a, f, d):
     import re
-    if re.match('arm.*', a) and re.match('arm.*7.*', f):
-        return '7'
+    if re.match('arm.*', a):
+        if 'armv7a' in f:

You need to test for both armv7a (Cortex A9, etc) and armv7ve (Cortex A7, A15, etc).

Thanks, I've done a v2 that should take care of that.