diff options
Diffstat (limited to 'meta/classes/goarch.bbclass')
-rw-r--r-- | meta/classes/goarch.bbclass | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass deleted file mode 100644 index e4e0ca37be..0000000000 --- a/meta/classes/goarch.bbclass +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | BUILD_GOOS = "${@go_map_os(d.getVar('BUILD_OS'), d)}" | ||
2 | BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH'), d)}" | ||
3 | BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}" | ||
4 | HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}" | ||
5 | HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}" | ||
6 | HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), 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)}" | ||
9 | HOST_GOARM_class-native = "7" | ||
10 | HOST_GO386_class-native = "sse2" | ||
11 | HOST_GOMIPS_class-native = "hardfloat" | ||
12 | HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}" | ||
13 | TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}" | ||
14 | TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}" | ||
15 | TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d)}" | ||
16 | TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | ||
17 | TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" | ||
18 | TARGET_GOARM_class-native = "7" | ||
19 | TARGET_GO386_class-native = "sse2" | ||
20 | TARGET_GOMIPS_class-native = "hardfloat" | ||
21 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" | ||
22 | GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}" | ||
23 | |||
24 | # Use the MACHINEOVERRIDES to map ARM CPU architecture passed to GO via GOARM. | ||
25 | # This is combined with *_ARCH to set HOST_GOARM and TARGET_GOARM. | ||
26 | BASE_GOARM = '' | ||
27 | BASE_GOARM_armv7ve = '7' | ||
28 | BASE_GOARM_armv7a = '7' | ||
29 | BASE_GOARM_armv6 = '6' | ||
30 | BASE_GOARM_armv5 = '5' | ||
31 | |||
32 | # Go supports dynamic linking on a limited set of architectures. | ||
33 | # See the supportsDynlink function in go/src/cmd/compile/internal/gc/main.go | ||
34 | GO_DYNLINK = "" | ||
35 | GO_DYNLINK_arm = "1" | ||
36 | GO_DYNLINK_aarch64 = "1" | ||
37 | GO_DYNLINK_x86 = "1" | ||
38 | GO_DYNLINK_x86-64 = "1" | ||
39 | GO_DYNLINK_powerpc64 = "1" | ||
40 | GO_DYNLINK_powerpc64le = "1" | ||
41 | GO_DYNLINK_class-native = "" | ||
42 | GO_DYNLINK_class-nativesdk = "" | ||
43 | |||
44 | # define here because everybody inherits this class | ||
45 | # | ||
46 | COMPATIBLE_HOST_linux-gnux32 = "null" | ||
47 | COMPATIBLE_HOST_linux-muslx32 = "null" | ||
48 | COMPATIBLE_HOST_powerpc = "null" | ||
49 | COMPATIBLE_HOST_powerpc64 = "null" | ||
50 | COMPATIBLE_HOST_mipsarchn32 = "null" | ||
51 | |||
52 | ARM_INSTRUCTION_SET_armv4 = "arm" | ||
53 | ARM_INSTRUCTION_SET_armv5 = "arm" | ||
54 | ARM_INSTRUCTION_SET_armv6 = "arm" | ||
55 | |||
56 | TUNE_CCARGS_remove = "-march=mips32r2" | ||
57 | SECURITY_NOPIE_CFLAGS ??= "" | ||
58 | |||
59 | # go can't be built with ccache: | ||
60 | # gcc: fatal error: no input files | ||
61 | CCACHE_DISABLE ?= "1" | ||
62 | |||
63 | def go_map_arch(a, d): | ||
64 | import re | ||
65 | if re.match('i.86', a): | ||
66 | return '386' | ||
67 | elif a == 'x86_64': | ||
68 | return 'amd64' | ||
69 | elif re.match('arm.*', a): | ||
70 | return 'arm' | ||
71 | elif re.match('aarch64.*', a): | ||
72 | return 'arm64' | ||
73 | elif re.match('mips64el.*', a): | ||
74 | return 'mips64le' | ||
75 | elif re.match('mips64.*', a): | ||
76 | return 'mips64' | ||
77 | elif a == 'mips': | ||
78 | return 'mips' | ||
79 | elif a == 'mipsel': | ||
80 | return 'mipsle' | ||
81 | elif re.match('p(pc|owerpc)(64le)', a): | ||
82 | return 'ppc64le' | ||
83 | elif re.match('p(pc|owerpc)(64)', a): | ||
84 | return 'ppc64' | ||
85 | elif a == 'riscv64': | ||
86 | return 'riscv64' | ||
87 | else: | ||
88 | raise bb.parse.SkipRecipe("Unsupported CPU architecture: %s" % a) | ||
89 | |||
90 | def go_map_arm(a, d): | ||
91 | if a.startswith("arm"): | ||
92 | return d.getVar('BASE_GOARM') | ||
93 | return '' | ||
94 | |||
95 | def go_map_386(a, f, d): | ||
96 | import re | ||
97 | if re.match('i.86', a): | ||
98 | if ('core2' in f) or ('corei7' in f): | ||
99 | return 'sse2' | ||
100 | else: | ||
101 | return 'softfloat' | ||
102 | return '' | ||
103 | |||
104 | def go_map_mips(a, f, d): | ||
105 | import re | ||
106 | if a == 'mips' or a == 'mipsel': | ||
107 | if 'fpu-hard' in f: | ||
108 | return 'hardfloat' | ||
109 | else: | ||
110 | return 'softfloat' | ||
111 | return '' | ||
112 | |||
113 | def go_map_os(o, d): | ||
114 | if o.startswith('linux'): | ||
115 | return 'linux' | ||
116 | return o | ||