summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-07-20 12:43:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-26 13:16:40 +0100
commit4f67aef1bf27652a48110a04604a3ad0d9a9a127 (patch)
tree80a50dcbc168fc768db418b26e23a578a3cf4abd /meta/classes/insane.bbclass
parent26810bc160bd78924a7f1fddac31afb4981f5b6b (diff)
downloadpoky-4f67aef1bf27652a48110a04604a3ad0d9a9a127.tar.gz
lib/oe: split out machine to ELF data dictionary
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass138
1 files changed, 2 insertions, 136 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 469d5c4cd5..8c360c83e7 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -46,140 +46,6 @@ ALL_QA = "${WARN_QA} ${ERROR_QA}"
46 46
47UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot --disable-static" 47UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot --disable-static"
48 48
49#
50# dictionary for elf headers
51#
52# feel free to add and correct.
53#
54# TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit?
55def package_qa_get_machine_dict(d):
56 machdata = {
57 "darwin9" : {
58 "arm" : (40, 0, 0, True, 32),
59 },
60 "eabi" : {
61 "arm" : (40, 0, 0, True, 32),
62 },
63 "elf" : {
64 "aarch64" : (183, 0, 0, True, 64),
65 "aarch64_be" :(183, 0, 0, False, 64),
66 "i586" : (3, 0, 0, True, 32),
67 "x86_64": (62, 0, 0, True, 64),
68 "epiphany": (4643, 0, 0, True, 32),
69 "mips": ( 8, 0, 0, False, 32),
70 "mipsel": ( 8, 0, 0, True, 32),
71 "microblaze": (189, 0, 0, False, 32),
72 "microblazeeb":(189, 0, 0, False, 32),
73 "microblazeel":(189, 0, 0, True, 32),
74 "powerpc": (20, 0, 0, False, 32),
75 "riscv32": (243, 0, 0, True, 32),
76 "riscv64": (243, 0, 0, True, 64),
77 },
78 "linux" : {
79 "aarch64" : (183, 0, 0, True, 64),
80 "aarch64_be" :(183, 0, 0, False, 64),
81 "arm" : (40, 97, 0, True, 32),
82 "armeb": (40, 97, 0, False, 32),
83 "powerpc": (20, 0, 0, False, 32),
84 "powerpc64": (21, 0, 0, False, 64),
85 "i386": ( 3, 0, 0, True, 32),
86 "i486": ( 3, 0, 0, True, 32),
87 "i586": ( 3, 0, 0, True, 32),
88 "i686": ( 3, 0, 0, True, 32),
89 "x86_64": (62, 0, 0, True, 64),
90 "ia64": (50, 0, 0, True, 64),
91 "alpha": (36902, 0, 0, True, 64),
92 "hppa": (15, 3, 0, False, 32),
93 "m68k": ( 4, 0, 0, False, 32),
94 "mips": ( 8, 0, 0, False, 32),
95 "mipsel": ( 8, 0, 0, True, 32),
96 "mips64": ( 8, 0, 0, False, 64),
97 "mips64el": ( 8, 0, 0, True, 64),
98 "mipsisa32r6": ( 8, 0, 0, False, 32),
99 "mipsisa32r6el": ( 8, 0, 0, True, 32),
100 "mipsisa64r6": ( 8, 0, 0, False, 64),
101 "mipsisa64r6el": ( 8, 0, 0, True, 64),
102 "nios2": (113, 0, 0, True, 32),
103 "riscv32": (243, 0, 0, True, 32),
104 "riscv64": (243, 0, 0, True, 64),
105 "s390": (22, 0, 0, False, 32),
106 "sh4": (42, 0, 0, True, 32),
107 "sparc": ( 2, 0, 0, False, 32),
108 "microblaze": (189, 0, 0, False, 32),
109 "microblazeeb":(189, 0, 0, False, 32),
110 "microblazeel":(189, 0, 0, True, 32),
111 },
112 "linux-musl" : {
113 "aarch64" : (183, 0, 0, True, 64),
114 "aarch64_be" :(183, 0, 0, False, 64),
115 "arm" : ( 40, 97, 0, True, 32),
116 "armeb": ( 40, 97, 0, False, 32),
117 "powerpc": ( 20, 0, 0, False, 32),
118 "i386": ( 3, 0, 0, True, 32),
119 "i486": ( 3, 0, 0, True, 32),
120 "i586": ( 3, 0, 0, True, 32),
121 "i686": ( 3, 0, 0, True, 32),
122 "x86_64": ( 62, 0, 0, True, 64),
123 "mips": ( 8, 0, 0, False, 32),
124 "mipsel": ( 8, 0, 0, True, 32),
125 "mips64": ( 8, 0, 0, False, 64),
126 "mips64el": ( 8, 0, 0, True, 64),
127 "microblaze": (189, 0, 0, False, 32),
128 "microblazeeb":(189, 0, 0, False, 32),
129 "microblazeel":(189, 0, 0, True, 32),
130 "riscv32": (243, 0, 0, True, 32),
131 "riscv64": (243, 0, 0, True, 64),
132 "sh4": ( 42, 0, 0, True, 32),
133 },
134 "uclinux-uclibc" : {
135 "bfin": ( 106, 0, 0, True, 32),
136 },
137 "linux-gnueabi" : {
138 "arm" : (40, 0, 0, True, 32),
139 "armeb" : (40, 0, 0, False, 32),
140 },
141 "linux-musleabi" : {
142 "arm" : (40, 0, 0, True, 32),
143 "armeb" : (40, 0, 0, False, 32),
144 },
145 "linux-gnuspe" : {
146 "powerpc": (20, 0, 0, False, 32),
147 },
148 "linux-muslspe" : {
149 "powerpc": (20, 0, 0, False, 32),
150 },
151 "linux-gnu" : {
152 "powerpc": (20, 0, 0, False, 32),
153 "sh4": (42, 0, 0, True, 32),
154 },
155 "linux-gnu_ilp32" : {
156 "aarch64" : (183, 0, 0, True, 32),
157 },
158 "linux-gnux32" : {
159 "x86_64": (62, 0, 0, True, 32),
160 },
161 "linux-muslx32" : {
162 "x86_64": (62, 0, 0, True, 32),
163 },
164 "linux-gnun32" : {
165 "mips64": ( 8, 0, 0, False, 32),
166 "mips64el": ( 8, 0, 0, True, 32),
167 "mipsisa64r6": ( 8, 0, 0, False, 32),
168 "mipsisa64r6el":( 8, 0, 0, True, 32),
169 },
170 }
171
172 # Add in any extra user supplied data which may come from a BSP layer, removing the
173 # need to always change this class directly
174 extra_machdata = (d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS") or "").split()
175 for m in extra_machdata:
176 call = m + "(machdata, d)"
177 locs = { "machdata" : machdata, "d" : d}
178 machdata = bb.utils.better_eval(call, locs)
179
180 return machdata
181
182
183def package_qa_clean_path(path, d, pkg=None): 49def package_qa_clean_path(path, d, pkg=None):
184 """ 50 """
185 Remove redundant paths from the path for display. If pkg isn't set then 51 Remove redundant paths from the path for display. If pkg isn't set then
@@ -404,7 +270,7 @@ def package_qa_check_arch(path,name,d, elf, messages):
404 """ 270 """
405 Check if archs are compatible 271 Check if archs are compatible
406 """ 272 """
407 import re 273 import re, oe.elf
408 274
409 if not elf: 275 if not elf:
410 return 276 return
@@ -431,7 +297,7 @@ def package_qa_check_arch(path,name,d, elf, messages):
431 297
432 #if this will throw an exception, then fix the dict above 298 #if this will throw an exception, then fix the dict above
433 (machine, osabi, abiversion, littleendian, bits) \ 299 (machine, osabi, abiversion, littleendian, bits) \
434 = package_qa_get_machine_dict(d)[target_os][target_arch] 300 = oe.elf.machine_dict(d)[target_os][target_arch]
435 301
436 # Check the architecture and endiannes of the binary 302 # Check the architecture and endiannes of the binary
437 is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \ 303 is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \