summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/insane.bbclass6
-rw-r--r--meta/lib/oe/qa.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/elf.py1
3 files changed, 7 insertions, 3 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 8c360c83e7..4644221bc6 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -301,8 +301,10 @@ def package_qa_check_arch(path,name,d, elf, messages):
301 301
302 # Check the architecture and endiannes of the binary 302 # Check the architecture and endiannes of the binary
303 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 \
304 (target_os == "linux-gnux32" or target_os == "linux-muslx32" or target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE'))) 304 (target_os == "linux-gnux32" or target_os == "linux-muslx32" or \
305 if not ((machine == elf.machine()) or is_32): 305 target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
306 is_bpf = (oe.qa.elf_machine_to_string(elf.machine()) == "BPF")
307 if not ((machine == elf.machine()) or is_32 or is_bpf):
306 package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \ 308 package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \
307 (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d))) 309 (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d)))
308 elif not ((bits == elf.abiSize()) or is_32): 310 elif not ((bits == elf.abiSize()) or is_32):
diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py
index 3231e60cea..59c72ce580 100644
--- a/meta/lib/oe/qa.py
+++ b/meta/lib/oe/qa.py
@@ -158,7 +158,8 @@ def elf_machine_to_string(machine):
158 0x2A: "SuperH", 158 0x2A: "SuperH",
159 0x32: "IA-64", 159 0x32: "IA-64",
160 0x3E: "x86-64", 160 0x3E: "x86-64",
161 0xB7: "AArch64" 161 0xB7: "AArch64",
162 0xF7: "BPF"
162 }[machine] 163 }[machine]
163 except: 164 except:
164 return "Unknown (%s)" % repr(machine) 165 return "Unknown (%s)" % repr(machine)
diff --git a/meta/lib/oeqa/selftest/cases/oelib/elf.py b/meta/lib/oeqa/selftest/cases/oelib/elf.py
index 74ee6a11cc..15c03f4609 100644
--- a/meta/lib/oeqa/selftest/cases/oelib/elf.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/elf.py
@@ -15,6 +15,7 @@ class TestElf(TestCase):
15 self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64") 15 self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
16 self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64") 16 self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
17 self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64") 17 self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
18 self.assertEqual(oe.qa.elf_machine_to_string(0xF7), "BPF")
18 19
19 self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)") 20 self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
20 self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)") 21 self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")