diff options
author | Matt Madison <matt@madison.systems> | 2018-03-04 13:09:26 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-06 06:43:10 -0800 |
commit | dc2e108efe79e24acd47724af1ef9e672f8b4400 (patch) | |
tree | e174dcf5b9aab027376dc859368a200be9fc62f6 | |
parent | 7a4ca89b557648d9aae30b405f6be09b4a383abe (diff) | |
download | poky-dc2e108efe79e24acd47724af1ef9e672f8b4400.tar.gz |
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>
-rw-r--r-- | meta/classes/goarch.bbclass | 11 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-cross-canadian.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-cross.inc | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-runtime.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-target.inc | 1 |
5 files changed, 16 insertions, 0 deletions
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass index 922c0cc8f3..1021b94d4c 100644 --- a/meta/classes/goarch.bbclass +++ b/meta/classes/goarch.bbclass | |||
@@ -5,11 +5,13 @@ HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}" | |||
5 | HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}" | 5 | HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}" |
6 | HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | 6 | HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}" |
7 | HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | 7 | HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}" |
8 | HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | ||
8 | HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}" | 9 | HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}" |
9 | TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}" | 10 | TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}" |
10 | TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}" | 11 | TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}" |
11 | TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | 12 | TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" |
12 | TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | 13 | TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" |
14 | TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | ||
13 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" | 15 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" |
14 | GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}" | 16 | GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}" |
15 | 17 | ||
@@ -78,6 +80,15 @@ def go_map_386(a, f, d): | |||
78 | return '387' | 80 | return '387' |
79 | return '' | 81 | return '' |
80 | 82 | ||
83 | def go_map_mips(a, f, d): | ||
84 | import re | ||
85 | if a == 'mips' or a == 'mipsel': | ||
86 | if 'fpu-hard' in f: | ||
87 | return 'hardfloat' | ||
88 | else: | ||
89 | return 'softfloat' | ||
90 | return '' | ||
91 | |||
81 | def go_map_os(o, d): | 92 | def go_map_os(o, d): |
82 | if o.startswith('linux'): | 93 | if o.startswith('linux'): |
83 | return 'linux' | 94 | return 'linux' |
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc index e22914e7aa..4a43d831fa 100644 --- a/meta/recipes-devtools/go/go-cross-canadian.inc +++ b/meta/recipes-devtools/go/go-cross-canadian.inc | |||
@@ -41,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}" | |||
41 | export GOOS="${TARGET_GOOS}" | 41 | export GOOS="${TARGET_GOOS}" |
42 | test -n "\$GOARM" || export GOARM="${TARGET_GOARM}" | 42 | test -n "\$GOARM" || export GOARM="${TARGET_GOARM}" |
43 | test -n "\$GO386" || export GO386="${TARGET_GO386}" | 43 | test -n "\$GO386" || export GO386="${TARGET_GO386}" |
44 | test -n "\$GOMIPS" || export GOMIPS="${TARGET_GOMIPS}" | ||
44 | export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}" | 45 | export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}" |
45 | test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" | 46 | test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" |
46 | \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" | 47 | \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" |
diff --git a/meta/recipes-devtools/go/go-cross.inc b/meta/recipes-devtools/go/go-cross.inc index fe92651581..289ae77104 100644 --- a/meta/recipes-devtools/go/go-cross.inc +++ b/meta/recipes-devtools/go/go-cross.inc | |||
@@ -11,6 +11,7 @@ export GOOS = "${TARGET_GOOS}" | |||
11 | export GOARCH = "${TARGET_GOARCH}" | 11 | export GOARCH = "${TARGET_GOARCH}" |
12 | export GOARM = "${TARGET_GOARM}" | 12 | export GOARM = "${TARGET_GOARM}" |
13 | export GO386 = "${TARGET_GO386}" | 13 | export GO386 = "${TARGET_GO386}" |
14 | export GOMIPS = "${TARGET_GOMIPS}" | ||
14 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | 15 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
15 | export GOROOT_FINAL = "${libdir}/go" | 16 | export GOROOT_FINAL = "${libdir}/go" |
16 | export GOCACHE = "off" | 17 | export GOCACHE = "off" |
@@ -40,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}" | |||
40 | export GOOS="${TARGET_GOOS}" | 41 | export GOOS="${TARGET_GOOS}" |
41 | export GOARM="\${GOARM:-${TARGET_GOARM}}" | 42 | export GOARM="\${GOARM:-${TARGET_GOARM}}" |
42 | export GO386="\${GO386:-${TARGET_GO386}}" | 43 | export GO386="\${GO386:-${TARGET_GO386}}" |
44 | export GOMIPS="\${GOMIPS:-${TARGET_GOMIPS}}" | ||
43 | \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" | 45 | \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" |
44 | END | 46 | END |
45 | chmod +x ${D}${bindir}/$2 | 47 | chmod +x ${D}${bindir}/$2 |
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc index 7a3b415b3f..0fe4566360 100644 --- a/meta/recipes-devtools/go/go-runtime.inc +++ b/meta/recipes-devtools/go/go-runtime.inc | |||
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}" | |||
8 | export GOARCH = "${TARGET_GOARCH}" | 8 | export GOARCH = "${TARGET_GOARCH}" |
9 | export GOARM = "${TARGET_GOARM}" | 9 | export GOARM = "${TARGET_GOARM}" |
10 | export GO386 = "${TARGET_GO386}" | 10 | export GO386 = "${TARGET_GO386}" |
11 | export GOMIPS = "${TARGET_GOMIPS}" | ||
11 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | 12 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
12 | export GOROOT_FINAL = "${libdir}/go" | 13 | export GOROOT_FINAL = "${libdir}/go" |
13 | export CGO_ENABLED = "1" | 14 | export CGO_ENABLED = "1" |
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc index a53a314c78..141a456cca 100644 --- a/meta/recipes-devtools/go/go-target.inc +++ b/meta/recipes-devtools/go/go-target.inc | |||
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}" | |||
8 | export GOARCH = "${TARGET_GOARCH}" | 8 | export GOARCH = "${TARGET_GOARCH}" |
9 | export GOARM = "${TARGET_GOARM}" | 9 | export GOARM = "${TARGET_GOARM}" |
10 | export GO386 = "${TARGET_GO386}" | 10 | export GO386 = "${TARGET_GO386}" |
11 | export GOMIPS = "${TARGET_GOMIPS}" | ||
11 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | 12 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
12 | export GOROOT_FINAL = "${libdir}/go" | 13 | export GOROOT_FINAL = "${libdir}/go" |
13 | export CGO_ENABLED = "1" | 14 | export CGO_ENABLED = "1" |