summaryrefslogtreecommitdiffstats
path: root/poky/meta/classes/insane.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes/insane.bbclass')
-rw-r--r--poky/meta/classes/insane.bbclass155
1 files changed, 12 insertions, 143 deletions
diff --git a/poky/meta/classes/insane.bbclass b/poky/meta/classes/insane.bbclass
index eb2d96711..4644221bc 100644
--- a/poky/meta/classes/insane.bbclass
+++ b/poky/meta/classes/insane.bbclass
@@ -46,139 +46,6 @@ ALL_QA = "${WARN_QA} ${ERROR_QA}"
UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot --disable-static"
-#
-# dictionary for elf headers
-#
-# feel free to add and correct.
-#
-# TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit?
-def package_qa_get_machine_dict(d):
- machdata = {
- "darwin9" : {
- "arm" : (40, 0, 0, True, 32),
- },
- "eabi" : {
- "arm" : (40, 0, 0, True, 32),
- },
- "elf" : {
- "aarch64" : (183, 0, 0, True, 64),
- "aarch64_be" :(183, 0, 0, False, 64),
- "i586" : (3, 0, 0, True, 32),
- "x86_64": (62, 0, 0, True, 64),
- "epiphany": (4643, 0, 0, True, 32),
- "mips": ( 8, 0, 0, False, 32),
- "mipsel": ( 8, 0, 0, True, 32),
- "microblaze": (189, 0, 0, False, 32),
- "microblazeeb":(189, 0, 0, False, 32),
- "microblazeel":(189, 0, 0, True, 32),
- "riscv32": (243, 0, 0, True, 32),
- "riscv64": (243, 0, 0, True, 64),
- },
- "linux" : {
- "aarch64" : (183, 0, 0, True, 64),
- "aarch64_be" :(183, 0, 0, False, 64),
- "arm" : (40, 97, 0, True, 32),
- "armeb": (40, 97, 0, False, 32),
- "powerpc": (20, 0, 0, False, 32),
- "powerpc64": (21, 0, 0, False, 64),
- "i386": ( 3, 0, 0, True, 32),
- "i486": ( 3, 0, 0, True, 32),
- "i586": ( 3, 0, 0, True, 32),
- "i686": ( 3, 0, 0, True, 32),
- "x86_64": (62, 0, 0, True, 64),
- "ia64": (50, 0, 0, True, 64),
- "alpha": (36902, 0, 0, True, 64),
- "hppa": (15, 3, 0, False, 32),
- "m68k": ( 4, 0, 0, False, 32),
- "mips": ( 8, 0, 0, False, 32),
- "mipsel": ( 8, 0, 0, True, 32),
- "mips64": ( 8, 0, 0, False, 64),
- "mips64el": ( 8, 0, 0, True, 64),
- "mipsisa32r6": ( 8, 0, 0, False, 32),
- "mipsisa32r6el": ( 8, 0, 0, True, 32),
- "mipsisa64r6": ( 8, 0, 0, False, 64),
- "mipsisa64r6el": ( 8, 0, 0, True, 64),
- "nios2": (113, 0, 0, True, 32),
- "riscv32": (243, 0, 0, True, 32),
- "riscv64": (243, 0, 0, True, 64),
- "s390": (22, 0, 0, False, 32),
- "sh4": (42, 0, 0, True, 32),
- "sparc": ( 2, 0, 0, False, 32),
- "microblaze": (189, 0, 0, False, 32),
- "microblazeeb":(189, 0, 0, False, 32),
- "microblazeel":(189, 0, 0, True, 32),
- },
- "linux-musl" : {
- "aarch64" : (183, 0, 0, True, 64),
- "aarch64_be" :(183, 0, 0, False, 64),
- "arm" : ( 40, 97, 0, True, 32),
- "armeb": ( 40, 97, 0, False, 32),
- "powerpc": ( 20, 0, 0, False, 32),
- "i386": ( 3, 0, 0, True, 32),
- "i486": ( 3, 0, 0, True, 32),
- "i586": ( 3, 0, 0, True, 32),
- "i686": ( 3, 0, 0, True, 32),
- "x86_64": ( 62, 0, 0, True, 64),
- "mips": ( 8, 0, 0, False, 32),
- "mipsel": ( 8, 0, 0, True, 32),
- "mips64": ( 8, 0, 0, False, 64),
- "mips64el": ( 8, 0, 0, True, 64),
- "microblaze": (189, 0, 0, False, 32),
- "microblazeeb":(189, 0, 0, False, 32),
- "microblazeel":(189, 0, 0, True, 32),
- "riscv32": (243, 0, 0, True, 32),
- "riscv64": (243, 0, 0, True, 64),
- "sh4": ( 42, 0, 0, True, 32),
- },
- "uclinux-uclibc" : {
- "bfin": ( 106, 0, 0, True, 32),
- },
- "linux-gnueabi" : {
- "arm" : (40, 0, 0, True, 32),
- "armeb" : (40, 0, 0, False, 32),
- },
- "linux-musleabi" : {
- "arm" : (40, 0, 0, True, 32),
- "armeb" : (40, 0, 0, False, 32),
- },
- "linux-gnuspe" : {
- "powerpc": (20, 0, 0, False, 32),
- },
- "linux-muslspe" : {
- "powerpc": (20, 0, 0, False, 32),
- },
- "linux-gnu" : {
- "powerpc": (20, 0, 0, False, 32),
- "sh4": (42, 0, 0, True, 32),
- },
- "linux-gnu_ilp32" : {
- "aarch64" : (183, 0, 0, True, 32),
- },
- "linux-gnux32" : {
- "x86_64": (62, 0, 0, True, 32),
- },
- "linux-muslx32" : {
- "x86_64": (62, 0, 0, True, 32),
- },
- "linux-gnun32" : {
- "mips64": ( 8, 0, 0, False, 32),
- "mips64el": ( 8, 0, 0, True, 32),
- "mipsisa64r6": ( 8, 0, 0, False, 32),
- "mipsisa64r6el":( 8, 0, 0, True, 32),
- },
- }
-
- # Add in any extra user supplied data which may come from a BSP layer, removing the
- # need to always change this class directly
- extra_machdata = (d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS") or "").split()
- for m in extra_machdata:
- call = m + "(machdata, d)"
- locs = { "machdata" : machdata, "d" : d}
- machdata = bb.utils.better_eval(call, locs)
-
- return machdata
-
-
def package_qa_clean_path(path, d, pkg=None):
"""
Remove redundant paths from the path for display. If pkg isn't set then
@@ -403,7 +270,7 @@ def package_qa_check_arch(path,name,d, elf, messages):
"""
Check if archs are compatible
"""
- import re
+ import re, oe.elf
if not elf:
return
@@ -430,12 +297,14 @@ def package_qa_check_arch(path,name,d, elf, messages):
#if this will throw an exception, then fix the dict above
(machine, osabi, abiversion, littleendian, bits) \
- = package_qa_get_machine_dict(d)[target_os][target_arch]
+ = oe.elf.machine_dict(d)[target_os][target_arch]
# Check the architecture and endiannes of the binary
is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \
- (target_os == "linux-gnux32" or target_os == "linux-muslx32" or target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
- if not ((machine == elf.machine()) or is_32):
+ (target_os == "linux-gnux32" or target_os == "linux-muslx32" or \
+ target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
+ is_bpf = (oe.qa.elf_machine_to_string(elf.machine()) == "BPF")
+ if not ((machine == elf.machine()) or is_32 or is_bpf):
package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \
(oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d)))
elif not ((bits == elf.abiSize()) or is_32):
@@ -599,7 +468,7 @@ python populate_lic_qa_checksum() {
return
if not lic_files and d.getVar('SRC_URI'):
- sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
+ sane &= package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
srcdir = d.getVar('S')
corebase_licensefile = d.getVar('COREBASE') + "/LICENSE"
@@ -607,11 +476,11 @@ python populate_lic_qa_checksum() {
try:
(type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
except bb.fetch.MalformedUrl:
- sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
+ sane &= package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
continue
srclicfile = os.path.join(srcdir, path)
if not os.path.isfile(srclicfile):
- package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
+ sane &= package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
continue
if (srclicfile == corebase_licensefile):
@@ -695,7 +564,7 @@ python populate_lic_qa_checksum() {
else:
msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url
msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum
- sane = package_qa_handle_error("license-checksum", msg, d)
+ sane &= package_qa_handle_error("license-checksum", msg, d)
if not sane:
bb.fatal("Fatal QA errors found, failing task.")
@@ -732,14 +601,14 @@ def package_qa_check_staged(path,d):
file_content = file_content.replace(recipesysroot, "")
if workdir in file_content:
error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
- sane = package_qa_handle_error("la", error_msg, d)
+ sane &= package_qa_handle_error("la", error_msg, d)
elif file.endswith(".pc"):
with open(path) as f:
file_content = f.read()
file_content = file_content.replace(recipesysroot, "")
if pkgconfigcheck in file_content:
error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root)
- sane = package_qa_handle_error("pkgconfig", error_msg, d)
+ sane &= package_qa_handle_error("pkgconfig", error_msg, d)
return sane
OpenPOWER on IntegriCloud