summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-10-10 17:06:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-11 12:17:03 +0100
commit27ab030dc01e9891668e6da66d2b5e0d84dba3f4 (patch)
tree541e4f381bd6496703d89013e7333d815e62d36f /meta/classes-global
parent91ba10c7a30e2363e6fc96c2b982f6686e94ab00 (diff)
downloadpoky-27ab030dc01e9891668e6da66d2b5e0d84dba3f4.tar.gz
insane: only parse ELFs if they're files, not symlinks
This reduces the number of files that need to be swept by not scanning eg the library symlinks, and means we can remove the explicit islink() checks in many of the tests. (From OE-Core rev: aa9ec4b5c719bf610ad953095d1111e4c257747e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/insane.bbclass21
1 files changed, 2 insertions, 19 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 1691d96b64..7f01908e18 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -122,9 +122,6 @@ def package_qa_check_rpath(file,name, d, elf):
122 if not elf: 122 if not elf:
123 return 123 return
124 124
125 if os.path.islink(file):
126 return
127
128 bad_dirs = [d.getVar('BASE_WORKDIR'), d.getVar('STAGING_DIR_TARGET')] 125 bad_dirs = [d.getVar('BASE_WORKDIR'), d.getVar('STAGING_DIR_TARGET')]
129 126
130 phdrs = elf.run_objdump("-p", d) 127 phdrs = elf.run_objdump("-p", d)
@@ -150,9 +147,6 @@ def package_qa_check_useless_rpaths(file, name, d, elf):
150 if not elf: 147 if not elf:
151 return 148 return
152 149
153 if os.path.islink(file):
154 return
155
156 libdir = d.getVar("libdir") 150 libdir = d.getVar("libdir")
157 base_libdir = d.getVar("base_libdir") 151 base_libdir = d.getVar("base_libdir")
158 152
@@ -337,11 +331,6 @@ def package_qa_check_arch(path,name,d, elf):
337 oe.qa.handle_error("arch", pn + ": Recipe inherits the allarch class, but has packaged architecture-specific binaries", d) 331 oe.qa.handle_error("arch", pn + ": Recipe inherits the allarch class, but has packaged architecture-specific binaries", d)
338 return 332 return
339 333
340 # avoid following links to /usr/bin (e.g. on udev builds)
341 # we will check the files pointed to anyway...
342 if os.path.islink(path):
343 return
344
345 #if this will throw an exception, then fix the dict above 334 #if this will throw an exception, then fix the dict above
346 (machine, osabi, abiversion, littleendian, bits) \ 335 (machine, osabi, abiversion, littleendian, bits) \
347 = oe.elf.machine_dict(d)[host_os][host_arch] 336 = oe.elf.machine_dict(d)[host_os][host_arch]
@@ -383,9 +372,6 @@ def package_qa_textrel(path, name, d, elf):
383 if not elf: 372 if not elf:
384 return 373 return
385 374
386 if os.path.islink(path):
387 return
388
389 phdrs = elf.run_objdump("-p", d) 375 phdrs = elf.run_objdump("-p", d)
390 376
391 import re 377 import re
@@ -405,9 +391,6 @@ def package_qa_hash_style(path, name, d, elf):
405 if not elf: 391 if not elf:
406 return 392 return
407 393
408 if os.path.islink(path):
409 return
410
411 gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS') 394 gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS')
412 if not gnu_hash: 395 if not gnu_hash:
413 gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS') 396 gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS')
@@ -601,7 +584,7 @@ def check_32bit_symbols(path, packagename, d, elf):
601 ) 584 )
602 585
603 # elf is a oe.qa.ELFFile object 586 # elf is a oe.qa.ELFFile object
604 if elf is not None: 587 if elf:
605 phdrs = elf.run_objdump("-tw", d) 588 phdrs = elf.run_objdump("-tw", d)
606 syms = re.finditer(ptrn, phdrs) 589 syms = re.finditer(ptrn, phdrs)
607 usedapis = {sym.group('notag') for sym in syms} 590 usedapis = {sym.group('notag') for sym in syms}
@@ -789,7 +772,7 @@ def package_qa_walk(checkfuncs, package, d):
789 elves = {} 772 elves = {}
790 for path in pkgfiles[package]: 773 for path in pkgfiles[package]:
791 elf = None 774 elf = None
792 if os.path.isfile(path): 775 if os.path.isfile(path) and not os.path.islink(path):
793 elf = oe.qa.ELFFile(path) 776 elf = oe.qa.ELFFile(path)
794 try: 777 try:
795 elf.open() 778 elf.open()