[v5,04/26] goarch.bbclass: Replace logic for setting GOARM

Submitted by Otavio Salvador on Sept. 11, 2017, 12:45 p.m. | Patch ID: 143941

Details

Message ID 20170911124558.2863-5-otavio@ossystems.com.br
State New
Headers show

Commit Message

Otavio Salvador Sept. 11, 2017, 12:45 p.m.
From: Will Newton <will.newton@gmail.com>

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
"armv7" instead. At the same time add a check for "armv6" and
set GOARM to 6 in that case.

Signed-off-by: Will Newton <willn@resin.io>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---

Changes in v6: None
Changes in v5: None
Changes in v4:
- new patch to consolidade in a single patchset all golang changes

Changes in v3: None
Changes in v2: None

 meta/classes/goarch.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 7960ac5f9e..0f0d8b6a60 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -45,8 +45,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 'armv7' in f:
+            return '7'
+        elif 'armv6' in f:
+            return '6'
     return ''
 
 def go_map_os(o, d):

Comments

Will Newton Sept. 18, 2017, 1:26 p.m.
Hi Armin,

Would it be possible to get this patch backported to the Pyro branch?

It fixes running Go programs on Raspberry Pi 1 systems which without
this will die with illegal instruction errors.

Thanks,


On Mon, Sep 11, 2017 at 1:45 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> From: Will Newton <will.newton@gmail.com>
>
> 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
> "armv7" instead. At the same time add a check for "armv6" and
> set GOARM to 6 in that case.
>
> Signed-off-by: Will Newton <willn@resin.io>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>
> Changes in v6: None
> Changes in v5: None
> Changes in v4:
> - new patch to consolidade in a single patchset all golang changes
>
> Changes in v3: None
> Changes in v2: None
>
>  meta/classes/goarch.bbclass | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
> index 7960ac5f9e..0f0d8b6a60 100644
> --- a/meta/classes/goarch.bbclass
> +++ b/meta/classes/goarch.bbclass
> @@ -45,8 +45,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 'armv7' in f:
> +            return '7'
> +        elif 'armv6' in f:
> +            return '6'
>      return ''
>
>  def go_map_os(o, d):
> --
> 2.14.1
>
Alexander Kanavin Sept. 18, 2017, 1:30 p.m.
On 09/18/2017 04:26 PM, Will Newton wrote:
> Would it be possible to get this patch backported to the Pyro branch?
> 
> It fixes running Go programs on Raspberry Pi 1 systems which without
> this will die with illegal instruction errors.

Just do the backport and submit it to this list with [pyro] prefix.


Alex