diff options
| -rw-r--r-- | meta/classes/goarch.bbclass | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass index 7aaf26aed1..909646b8d4 100644 --- a/meta/classes/goarch.bbclass +++ b/meta/classes/goarch.bbclass | |||
| @@ -3,18 +3,26 @@ BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH'), d)}" | |||
| 3 | BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}" | 3 | BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}" |
| 4 | HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}" | 4 | 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('BASE_GOARM'), 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_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}" |
| 9 | HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}" | 9 | HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}" |
| 10 | TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}" | 10 | TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}" |
| 11 | TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}" | 11 | TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}" |
| 12 | 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('BASE_GOARM'), d)}" |
| 13 | 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)}" | 14 | TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" |
| 15 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" | 15 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" |
| 16 | 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')]}" |
| 17 | 17 | ||
| 18 | # Use the MACHINEOVERRIDES to map ARM CPU architecture passed to GO via GOARM. | ||
| 19 | # This is combined with *_ARCH to set HOST_GOARM and TARGET_GOARM. | ||
| 20 | BASE_GOARM = '' | ||
| 21 | BASE_GOARM_armv7ve = '7' | ||
| 22 | BASE_GOARM_armv7a = '7' | ||
| 23 | BASE_GOARM_armv6 = '6' | ||
| 24 | BASE_GOARM_armv5 = '5' | ||
| 25 | |||
| 18 | # Go supports dynamic linking on a limited set of architectures. | 26 | # Go supports dynamic linking on a limited set of architectures. |
| 19 | # See the supportsDynlink function in go/src/cmd/compile/internal/gc/main.go | 27 | # See the supportsDynlink function in go/src/cmd/compile/internal/gc/main.go |
| 20 | GO_DYNLINK = "" | 28 | GO_DYNLINK = "" |
| @@ -76,12 +84,7 @@ def go_map_arch(a, d): | |||
| 76 | def go_map_arm(a, f, d): | 84 | def go_map_arm(a, f, d): |
| 77 | import re | 85 | import re |
| 78 | if re.match('arm.*', a): | 86 | if re.match('arm.*', a): |
| 79 | if 'armv7' in f: | 87 | return f |
| 80 | return '7' | ||
| 81 | elif 'armv6' in f: | ||
| 82 | return '6' | ||
| 83 | elif 'armv5' in f: | ||
| 84 | return '5' | ||
| 85 | return '' | 88 | return '' |
| 86 | 89 | ||
| 87 | def go_map_386(a, f, d): | 90 | def go_map_386(a, f, d): |
