Commit Graph

29 Commits

Author SHA1 Message Date
Oliver Kranz
a3c1be72af Allow global override of golang GO_DYNLINK
Small golang applications create massive memory overhead if go-runtime
is deployed. So it is helpfull to be able to disable the GO_DYNLINK
option on a per distro/local.conf basis by making it a ?= instead of =.

(From OE-Core rev: 2a7f5843c4ad2a3bd44bf9c262aacab2931b5677)

Signed-off-by: Oliver Kranz <o.kranz.88@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-20 08:53:03 +01:00
Richard Purdie
bb6ddc3691 Convert to new override syntax
This is the result of automated script conversion:

scripts/contrib/convert-overrides.py <oe-core directory>

converting the metadata to use ":" as the override character instead of "_".

(From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02 15:44:10 +01:00
Khem Raj
510406ddf5 goarch: Use softfloat instead of 387 for 386 goarch
387 has been removed from go 1.16 see [1]

[1] https://github.com/golang/go/issues/40255

(From OE-Core rev: fd549c139f534f28974c86a4e4c7acf6f5c40a79)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-26 15:21:20 +00:00
Khem Raj
47a2fffca4 goarch.bbclass: Fix ppc64le detection
ppc64le should go above ppc64 in checks otherwise it gets subsumed
wrongly with ppc64 check

(From OE-Core rev: 126ecfe0d2ce65b2d2cf5598612e60bad7b3302e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-23 22:35:01 +00:00
Khem Raj
dd2862668a goarch.bbclass: Disable dynamic linking on PPC64 LE
(From OE-Core rev: cbcaa7e4808d881e19bdefc9123232449d8a2cad)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-21 12:52:53 +00:00
Khem Raj
89b336f24c goarch: Dont use -fno-PIE on mips
This was added with

98b24e9268 goarch.bbclass: set SECURITY_CFLAGS for mips64

to overcome a problem that was inherent in go linker which has been now
fixed in golang compiler upstream

https://github.com/golang/go/issues/20243
39c07ce9e5

(From OE-Core rev: ea93adc30ee3d8e0baa0f374c92afb7c6a133b2a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30 23:39:09 +00:00
Khem Raj
d07fba12a0 goarch: Remove target specific dependencies
goarch is used in all classes of recipes ranging from native to target,
therefore its best to contain the variables and not spill over into
recipe classes where they can adversely affect shared state reuse e.g.
go-native currently gets TUNE_FEATURES into dependency chain of
referenced variables which means go-native gets rebuilt when we change
from qemuarm to qemux86 machine types since TUNE_FEATURES is defined
with DEFAULTTUNE which would change as machines are switched

These variables are specific to arm/mips/x86 so marking them with
appropriate overrides for native recipes will be right thing here

Chose 'hardfloat' for mips which is default too, 7 for arm and sse2 for x86
somehow go-native bootstrap compiler (1.4) still needs them so feed
commonly used values or defaults.

Fixes
ERROR: go-native different signature for task do_configure.sigdata between qemux86copy and qemuarm
...
List of dependencies for variable TUNE_FEATURES changed from '{'DEFAULTTUNE', 'TUNE_FEATURES_tune-core2-32'}' to '{'DEFAULTTUNE', 'TUNE_FEATURES_tune-armv7vethf-neon'}'
changed items: {'TUNE_FEATURES_tune-core2-32', 'TUNE_FEATURES_tune-armv7vethf-neon'}

(From OE-Core rev: 83eebf5577dd0a23be937375c1a8a15e3da4fa64)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-15 09:10:46 +00:00
Richard Purdie
00a0e90f17 goarch.bbclass: Simplify logic
Further simplification of the go_map_arm() function.

(From OE-Core rev: 9c333505897b2bf0d80737c855af31785d23435a)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-12 09:29:06 +01:00
Mark Asselstine
a126d23833 goarch.bbclass: use MACHINEOVERRIDES and simplify go_map_arm()
Per https://github.com/golang/go/wiki/GoArm we need to set GOARM when
cross building for ARMv5, ARMv6 and ARMv7. The current approach of
using TUNE_FEATURES can be error prone, as we can see today when
attempting to build for Cortex-A7 which results in GOARM=''.

Since the value of MACHINEOVERRIDES already consolidates the values of
TUNE_FEATURES into something more consistent we can use the overrides
mechanism to set GOARM, leaving just a little bit of logic in
go_map_arm() to trigger off the arch (basically target vs host)
for the setting of GOARM.

(From OE-Core rev: 5f48939e26402b77fc3343f326765137f9570f40)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10 13:46:17 +01:00
Alistair Francis
2187d06166 goarch: Add riscv64
Although RISC-V 64-bit doesn't have official golang support there are
forks that now exist with at least some support and work is ongoing in
the upstream tree. In order to be able to use the goarch class add
support for RISC-V.

For more details see here:
https://github.com/golang/go/issues/27532

(From OE-Core rev: 91e3b2a762124bf5cf923654ef3a7c871b84c82f)

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-21 16:19:23 +00:00
Robert Yang
7a713b0fbf goarch.bbclass: Set CCACHE_DISABLE
Go can't be built with ccache.

(From OE-Core rev: cf64c9413a2264aa67e26c6302342ff4aa99a575)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Khem Raj
b297c1aa4b recipes: Enforce ARM ISA just for arm arches <= armv5
armv7+ used thumb2 ISA and it compiles fine with thumb2
issues are only when using thumb1 ISA

(From OE-Core rev: c0ef8a91f671f30acd92e2734144f7ddf1acda53)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Kai Kang
95a8753766 goarch.bbclass: set SECURITY_CFLAGS for mips64
When include conf/distro/include/security_flags.inc, NOPIE flags are
still required for mips64 target builds. Otherwise it fails to build
packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/
| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:
| relocation r_mips_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC`

Use override 'mipsarch' to set SECURITY_CFLAGS for both mips and mips64.

(From OE-Core rev: 98b24e9268dc444356ce8bd9ddfec6adcce5e02a)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Matt Madison
3ffafcd9cf go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
With go1.10 the NOPIE flags are only required for
MIPS target builds, and are now incompatible for
the other architectures.

(From OE-Core rev: f2ff90eb7d27a2f69f5948fa8c301de30f5c8132)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
58472bc7d0 goarch.bbclass: disable shared runtime for nativesdk builds
While useful on embedded devices for saving disk space, use
of shared runtime in Go is not the usual practice, so disable
it for nativesdk builds.  We don't use it for native builds,
either, so this makes the SDK match the native environment
more closely.

(From OE-Core rev: fde7017f9735c0d317023022817b28771df53109)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
dc2e108efe go: set GOMIPS envrionment variable
Go 1.10 adds support for selecting hard/soft float
object code through the GOMIPS environment variable.

(From OE-Core rev: f3cabc92dca3408da18f04e4af4051fba1f63c14)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Richard Purdie
8146e929e2 classes/recipes: Convert SkipPackage -> SkipRecipe
The new name is much more consistent with what this actually means. We put
the pieces in place to rename everything a while back but looks like we
forgot to actually do it! Fix that now.

(From OE-Core rev: af9612f5d6b848fceea22d10ee964437299be776)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-26 13:09:09 +00:00
Joe Slater
5b6bb4fcb5 goarch: There is no GOARCH defined for mips64-n32
Defeat building for mipsarchn32 because there is no corresponding
GOARCH.  Neither "mips" nor "mips64" allows go-runtime to compile.
Existing mips32 code assumes the o32 ABI.

(From OE-Core rev: fe72090a30d1fc810de3dd07350e5e6afba745de)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:33:23 +00:00
Paul Barker
68e77cfb8a goarch.bbclass: Define HOST_GO386 and TARGET_GO386
These variables are used to control the floating-point instructions emitted by
the go compiler for x86 architectures.

The default is '387' which disables the use of sse/sse2 instructions and is safe
to use on all x86 processors from the i486 onwards.

If TUNE_FEATURES contains a feature set which is known to support sse/sse2
instructions then they are set to 'sse2' to enable the use of these
instructions. This is suitable for most processors from Pentium 4 onwards.

Only the 'core2' and 'corei7' TUNE_FEATURES are defined in the oe-core layer and
are known to support ss2 instructions. Other layers may introduce additional
tunings which support sse2 instructions and for these layers, TARGET_GO386
or go_map_386 should be overridden as needed.

(From OE-Core rev: 7e96cf3c9850dc34d53af73a9ac22b1624994484)

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-16 23:52:44 +01:00
Matt Madison
b2646b5cf7 goarch.bbclass: rework mips architecture checks
Remove the TUNE_FEATURES references from go_map_arch,
to avoid an unwanted variable dependency.  Direct
comparisons of the architecture name are sufficient
for covering what Go currently supports, and using
TUNE_CCARGS_remove adequately handles the conflict
with the cgo-supplied flags for mips.

(From OE-Core rev: 1bc4c1d880096083d1891a74024fb225a6340b9b)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:39 +01:00
Matt Madison
988e253f47 goarch.bbclass: fixups for Go mips32 support
* Fix the regular expression in the mips test

* Flag as incompatible any mips32 tunes for n32 ABI
  or soft-float, as go does not support them.

* Replace mips32r2 tune with mips32r1. Go only supports
  mips32r1, which is a strict subset of r2.  Adjusting
  this tune is not ideal, but is hopefully a temporary
  measure until more complete mips32 ISA coverage
  arrives upstream.

[YOCTO #12108]

(From OE-Core rev: bdd20c296048937737da0f10bd1a3b63843c5bf4)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:00 +01:00
Matt Madison
e6542356b4 goarch.bbclass: set ARM_INSTRUCTION_SET to "arm"
Go does not play well with thumb, so ensure that the
toolchain and any packages use arm, not thumb, instructions.

(From OE-Core rev: 24da8c321831dcc5de00d65d6c5613efee109b57)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Matt Madison
e3c693eaea goarch.bbclass: identify archs with Go dynamic linking support
Go only supports shared libraries for some architectures, so
add a variable for use elsewhere that gets a non-null value
only for those architectures.

(From OE-Core rev: 2275712df152b73ce49b36bdf9f8d744c68c9c50)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Otavio Salvador
8738f2bfb6 goarch.bbclass: Add support for ARMv5
This adds support to return the proper ARMv5 format.

This change is based on the meta-golang[1] layer. Thanks to Matt
Madison <matt@madison.systems> for his work on this.

1. https://github.com/madisongh/meta-golang

(From OE-Core rev: e242e7c3617ded87582c5d384b15027498b0c1a4)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Will Newton
602f786ecd 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
"armv7" instead. At the same time add a check for "armv6" and
set GOARM to 6 in that case.

(From OE-Core rev: 07b60c15e9ef650940afdde37bf3f3b9c50a336d)

Signed-off-by: Will Newton <willn@resin.io>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
b34479ee9f goarch.bbclass: Stop passing True as second argument of d.getVar
The d.getVar has the second argument as True by default, avoid passing
it here.

(From OE-Core rev: 1a5026db41929d42bece22bd0ae60c13219a98f5)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
sweeaun
178d5845c3 goarch: Disable build for muslx32
Disable build for muslx32.

(From OE-Core rev: 7f6e47b0d8aec9cb22db50ccb40ebb01677f01ea)

Signed-off-by: sweeaun <swee.aun.khor@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-18 23:46:38 +01:00
Joe Slater
25717652b6 go: centralize definition of COMPATIBLE_HOST
Put it in goarch.bbclass which all go related recipes inherit.

(From OE-Core rev: 9e899bbc081cb932c1492f6d6802b908d70ef42f)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27 22:36:52 +01:00
Khem Raj
760e81678c go: Add recipes for golang compilers and tools
* This is converging the recipes for go from
  meta-virtualization and oe-meta-go

* Add recipes for go 1.7

* go.bbclass is added to ease out writing
  recipes for go packages

* go-examples: Add an example, helloworld written in go
  This should serve as temlate for writing go recipes

* Disable for musl, at least for now

* Disable for x32/ppc32 which is not supported

(From OE-Core rev: 78615e9260fb5d6569de4883521b049717fa4340)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 15:51:55 +00:00