blob: fb07995b3e44c010fa7855f72fed775c28105029 [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),
24 "mips": ( 8, 0, 0, False, 32),
25 "mipsel": ( 8, 0, 0, True, 32),
26 "microblaze": (189, 0, 0, False, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027 "microblazeel":(189, 0, 0, True, 32),
28 "powerpc": (20, 0, 0, False, 32),
29 "riscv32": (243, 0, 0, True, 32),
30 "riscv64": (243, 0, 0, True, 64),
31 },
32 "linux" : {
33 "aarch64" : (183, 0, 0, True, 64),
34 "aarch64_be" :(183, 0, 0, False, 64),
35 "arm" : (40, 97, 0, True, 32),
36 "armeb": (40, 97, 0, False, 32),
37 "powerpc": (20, 0, 0, False, 32),
38 "powerpc64": (21, 0, 0, False, 64),
Andrew Geissler82c905d2020-04-13 13:39:40 -050039 "powerpc64le": (21, 0, 0, True, 64),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040 "i386": ( 3, 0, 0, True, 32),
41 "i486": ( 3, 0, 0, True, 32),
42 "i586": ( 3, 0, 0, True, 32),
43 "i686": ( 3, 0, 0, True, 32),
44 "x86_64": (62, 0, 0, True, 64),
45 "ia64": (50, 0, 0, True, 64),
46 "alpha": (36902, 0, 0, True, 64),
47 "hppa": (15, 3, 0, False, 32),
48 "m68k": ( 4, 0, 0, False, 32),
49 "mips": ( 8, 0, 0, False, 32),
50 "mipsel": ( 8, 0, 0, True, 32),
51 "mips64": ( 8, 0, 0, False, 64),
52 "mips64el": ( 8, 0, 0, True, 64),
53 "mipsisa32r6": ( 8, 0, 0, False, 32),
54 "mipsisa32r6el": ( 8, 0, 0, True, 32),
55 "mipsisa64r6": ( 8, 0, 0, False, 64),
56 "mipsisa64r6el": ( 8, 0, 0, True, 64),
57 "nios2": (113, 0, 0, True, 32),
58 "riscv32": (243, 0, 0, True, 32),
59 "riscv64": (243, 0, 0, True, 64),
60 "s390": (22, 0, 0, False, 32),
61 "sh4": (42, 0, 0, True, 32),
62 "sparc": ( 2, 0, 0, False, 32),
63 "microblaze": (189, 0, 0, False, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064 "microblazeel":(189, 0, 0, True, 32),
65 },
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050066 "linux-android" : {
67 "aarch64" : (183, 0, 0, True, 64),
68 "i686": ( 3, 0, 0, True, 32),
69 "x86_64": (62, 0, 0, True, 64),
70 },
71 "linux-androideabi" : {
72 "arm" : (40, 97, 0, True, 32),
73 },
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074 "linux-musl" : {
75 "aarch64" : (183, 0, 0, True, 64),
76 "aarch64_be" :(183, 0, 0, False, 64),
77 "arm" : ( 40, 97, 0, True, 32),
78 "armeb": ( 40, 97, 0, False, 32),
79 "powerpc": ( 20, 0, 0, False, 32),
Brad Bishop19323692019-04-05 15:28:33 -040080 "powerpc64": ( 21, 0, 0, False, 64),
Andrew Geissler82c905d2020-04-13 13:39:40 -050081 "powerpc64le": (21, 0, 0, True, 64),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080082 "i386": ( 3, 0, 0, True, 32),
83 "i486": ( 3, 0, 0, True, 32),
84 "i586": ( 3, 0, 0, True, 32),
85 "i686": ( 3, 0, 0, True, 32),
86 "x86_64": ( 62, 0, 0, True, 64),
87 "mips": ( 8, 0, 0, False, 32),
88 "mipsel": ( 8, 0, 0, True, 32),
89 "mips64": ( 8, 0, 0, False, 64),
90 "mips64el": ( 8, 0, 0, True, 64),
91 "microblaze": (189, 0, 0, False, 32),
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080092 "microblazeel":(189, 0, 0, True, 32),
93 "riscv32": (243, 0, 0, True, 32),
94 "riscv64": (243, 0, 0, True, 64),
95 "sh4": ( 42, 0, 0, True, 32),
96 },
97 "uclinux-uclibc" : {
98 "bfin": ( 106, 0, 0, True, 32),
99 },
100 "linux-gnueabi" : {
101 "arm" : (40, 0, 0, True, 32),
102 "armeb" : (40, 0, 0, False, 32),
103 },
104 "linux-musleabi" : {
105 "arm" : (40, 0, 0, True, 32),
106 "armeb" : (40, 0, 0, False, 32),
107 },
108 "linux-gnuspe" : {
109 "powerpc": (20, 0, 0, False, 32),
110 },
111 "linux-muslspe" : {
112 "powerpc": (20, 0, 0, False, 32),
113 },
114 "linux-gnu" : {
115 "powerpc": (20, 0, 0, False, 32),
116 "sh4": (42, 0, 0, True, 32),
117 },
118 "linux-gnu_ilp32" : {
119 "aarch64" : (183, 0, 0, True, 32),
120 },
121 "linux-gnux32" : {
122 "x86_64": (62, 0, 0, True, 32),
123 },
124 "linux-muslx32" : {
125 "x86_64": (62, 0, 0, True, 32),
126 },
127 "linux-gnun32" : {
128 "mips64": ( 8, 0, 0, False, 32),
129 "mips64el": ( 8, 0, 0, True, 32),
130 "mipsisa64r6": ( 8, 0, 0, False, 32),
131 "mipsisa64r6el":( 8, 0, 0, True, 32),
132 },
133 }
134
135 # Add in any extra user supplied data which may come from a BSP layer, removing the
136 # need to always change this class directly
137 extra_machdata = (d and d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS" or None) or "").split()
138 for m in extra_machdata:
139 call = m + "(machdata, d)"
140 locs = { "machdata" : machdata, "d" : d}
141 machdata = bb.utils.better_eval(call, locs)
142
143 return machdata