blob: eab2349a4fe80a0e4d37a434e7cfea7542aab071 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: GPL-2.0-only
5#
6
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007def machine_dict(d):
8# TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit?
9 machdata = {
10 "darwin9" : {
11 "arm" : (40, 0, 0, True, 32),
12 },
13 "eabi" : {
14 "arm" : (40, 0, 0, True, 32),
15 },
16 "elf" : {
17 "aarch64" : (183, 0, 0, True, 64),
18 "aarch64_be" :(183, 0, 0, False, 64),
19 "i586" : (3, 0, 0, True, 32),
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 "i686" : (3, 0, 0, True, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021 "x86_64": (62, 0, 0, True, 64),
22 "epiphany": (4643, 0, 0, True, 32),
23 "lm32": (138, 0, 0, False, 32),
Patrick Williams864cc432023-02-09 14:54:44 -060024 "loongarch64":(258, 0, 0, True, 64),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025 "mips": ( 8, 0, 0, False, 32),
26 "mipsel": ( 8, 0, 0, True, 32),
27 "microblaze": (189, 0, 0, False, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028 "microblazeel":(189, 0, 0, True, 32),
29 "powerpc": (20, 0, 0, False, 32),
30 "riscv32": (243, 0, 0, True, 32),
31 "riscv64": (243, 0, 0, True, 64),
32 },
33 "linux" : {
34 "aarch64" : (183, 0, 0, True, 64),
35 "aarch64_be" :(183, 0, 0, False, 64),
36 "arm" : (40, 97, 0, True, 32),
37 "armeb": (40, 97, 0, False, 32),
38 "powerpc": (20, 0, 0, False, 32),
39 "powerpc64": (21, 0, 0, False, 64),
Andrew Geissler82c905d2020-04-13 13:39:40 -050040 "powerpc64le": (21, 0, 0, True, 64),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041 "i386": ( 3, 0, 0, True, 32),
42 "i486": ( 3, 0, 0, True, 32),
43 "i586": ( 3, 0, 0, True, 32),
44 "i686": ( 3, 0, 0, True, 32),
45 "x86_64": (62, 0, 0, True, 64),
46 "ia64": (50, 0, 0, True, 64),
47 "alpha": (36902, 0, 0, True, 64),
48 "hppa": (15, 3, 0, False, 32),
Patrick Williams864cc432023-02-09 14:54:44 -060049 "loongarch64":(258, 0, 0, True, 64),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080050 "m68k": ( 4, 0, 0, False, 32),
51 "mips": ( 8, 0, 0, False, 32),
52 "mipsel": ( 8, 0, 0, True, 32),
53 "mips64": ( 8, 0, 0, False, 64),
54 "mips64el": ( 8, 0, 0, True, 64),
55 "mipsisa32r6": ( 8, 0, 0, False, 32),
56 "mipsisa32r6el": ( 8, 0, 0, True, 32),
57 "mipsisa64r6": ( 8, 0, 0, False, 64),
58 "mipsisa64r6el": ( 8, 0, 0, True, 64),
59 "nios2": (113, 0, 0, True, 32),
60 "riscv32": (243, 0, 0, True, 32),
61 "riscv64": (243, 0, 0, True, 64),
62 "s390": (22, 0, 0, False, 32),
63 "sh4": (42, 0, 0, True, 32),
64 "sparc": ( 2, 0, 0, False, 32),
65 "microblaze": (189, 0, 0, False, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066 "microblazeel":(189, 0, 0, True, 32),
67 },
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050068 "linux-android" : {
69 "aarch64" : (183, 0, 0, True, 64),
70 "i686": ( 3, 0, 0, True, 32),
71 "x86_64": (62, 0, 0, True, 64),
72 },
73 "linux-androideabi" : {
74 "arm" : (40, 97, 0, True, 32),
75 },
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080076 "linux-musl" : {
77 "aarch64" : (183, 0, 0, True, 64),
78 "aarch64_be" :(183, 0, 0, False, 64),
79 "arm" : ( 40, 97, 0, True, 32),
80 "armeb": ( 40, 97, 0, False, 32),
81 "powerpc": ( 20, 0, 0, False, 32),
Brad Bishop19323692019-04-05 15:28:33 -040082 "powerpc64": ( 21, 0, 0, False, 64),
Andrew Geissler82c905d2020-04-13 13:39:40 -050083 "powerpc64le": (21, 0, 0, True, 64),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080084 "i386": ( 3, 0, 0, True, 32),
85 "i486": ( 3, 0, 0, True, 32),
86 "i586": ( 3, 0, 0, True, 32),
87 "i686": ( 3, 0, 0, True, 32),
88 "x86_64": ( 62, 0, 0, True, 64),
89 "mips": ( 8, 0, 0, False, 32),
90 "mipsel": ( 8, 0, 0, True, 32),
91 "mips64": ( 8, 0, 0, False, 64),
92 "mips64el": ( 8, 0, 0, True, 64),
93 "microblaze": (189, 0, 0, False, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080094 "microblazeel":(189, 0, 0, True, 32),
95 "riscv32": (243, 0, 0, True, 32),
96 "riscv64": (243, 0, 0, True, 64),
97 "sh4": ( 42, 0, 0, True, 32),
98 },
99 "uclinux-uclibc" : {
100 "bfin": ( 106, 0, 0, True, 32),
101 },
102 "linux-gnueabi" : {
103 "arm" : (40, 0, 0, True, 32),
104 "armeb" : (40, 0, 0, False, 32),
105 },
106 "linux-musleabi" : {
107 "arm" : (40, 0, 0, True, 32),
108 "armeb" : (40, 0, 0, False, 32),
109 },
110 "linux-gnuspe" : {
111 "powerpc": (20, 0, 0, False, 32),
112 },
113 "linux-muslspe" : {
114 "powerpc": (20, 0, 0, False, 32),
115 },
116 "linux-gnu" : {
117 "powerpc": (20, 0, 0, False, 32),
118 "sh4": (42, 0, 0, True, 32),
119 },
120 "linux-gnu_ilp32" : {
121 "aarch64" : (183, 0, 0, True, 32),
122 },
123 "linux-gnux32" : {
124 "x86_64": (62, 0, 0, True, 32),
125 },
126 "linux-muslx32" : {
127 "x86_64": (62, 0, 0, True, 32),
128 },
129 "linux-gnun32" : {
130 "mips64": ( 8, 0, 0, False, 32),
131 "mips64el": ( 8, 0, 0, True, 32),
132 "mipsisa64r6": ( 8, 0, 0, False, 32),
133 "mipsisa64r6el":( 8, 0, 0, True, 32),
134 },
135 }
136
137 # Add in any extra user supplied data which may come from a BSP layer, removing the
138 # need to always change this class directly
139 extra_machdata = (d and d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS" or None) or "").split()
140 for m in extra_machdata:
141 call = m + "(machdata, d)"
142 locs = { "machdata" : machdata, "d" : d}
143 machdata = bb.utils.better_eval(call, locs)
144
145 return machdata