summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/insane.bbclass41
1 files changed, 0 insertions, 41 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 5ddb87b3f7..e541c72c2d 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -405,47 +405,6 @@ def package_qa_check_perm(path,name,d, elf, messages):
405 """ 405 """
406 return 406 return
407 407
408QAPATHTEST[unsafe-references-in-binaries] = "package_qa_check_unsafe_references_in_binaries"
409def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages):
410 """
411 Ensure binaries in base_[bindir|sbindir|libdir] do not link to files under exec_prefix
412 """
413 if unsafe_references_skippable(path, name, d):
414 return
415
416 if elf:
417 import subprocess as sub
418 pn = d.getVar('PN', True)
419
420 exec_prefix = d.getVar('exec_prefix', True)
421 sysroot_path = d.getVar('STAGING_DIR_TARGET', True)
422 sysroot_path_usr = sysroot_path + exec_prefix
423
424 try:
425 ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read().decode("utf-8")
426 except bb.process.CmdError:
427 error_msg = pn + ": prelink-rtld aborted when processing %s" % path
428 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
429 return False
430
431 if sysroot_path_usr in ldd_output:
432 ldd_output = ldd_output.replace(sysroot_path, "")
433
434 pkgdest = d.getVar('PKGDEST', True)
435 packages = d.getVar('PACKAGES', True)
436
437 for package in packages.split():
438 short_path = path.replace('%s/%s' % (pkgdest, package), "", 1)
439 if (short_path != path):
440 break
441
442 base_err = pn + ": %s, installed in the base_prefix, requires a shared library under exec_prefix (%s)" % (short_path, exec_prefix)
443 for line in ldd_output.split('\n'):
444 if exec_prefix in line:
445 error_msg = "%s: %s" % (base_err, line.strip())
446 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
447
448 return False
449 408
450QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts" 409QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts"
451def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages): 410def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages):