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