diff mbox series

[v2,06/11] insane: check for RUNPATH as well as RPATH

Message ID 20241010160623.2880937-6-ross.burton@arm.com
State Accepted, archived
Commit d6c5076d179a3d5ebb74b719ec4d523c197c1918
Headers show
Series [v2,01/11] ffmpeg: nasm is x86 only, so only DEPEND if x86 | expand

Commit Message

Ross Burton Oct. 10, 2024, 4:06 p.m. UTC
Since oe-core 66f8a7 merged in 2023[1], ld sets DT_RUNPATH instead of
DT_RPATH when -rpath is specified, which we don't check for.

Update the insane tests to look at both RPATH and RUNPATH.

[1] oe-core 66f8a745668a067d8d763fa2af3e65f26c9c1ebe

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-global/insane.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 7f01908e18e..401807b2be3 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -115,7 +115,7 @@  def package_qa_check_libexec(path,name, d, elf):
         oe.qa.handle_error("libexec", "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d, name), libexec), d)
 
 QAPATHTEST[rpaths] = "package_qa_check_rpath"
-def package_qa_check_rpath(file,name, d, elf):
+def package_qa_check_rpath(file, name, d, elf):
     """
     Check for dangerous RPATHs
     """
@@ -127,14 +127,14 @@  def package_qa_check_rpath(file,name, d, elf):
     phdrs = elf.run_objdump("-p", d)
 
     import re
-    rpath_re = re.compile(r"\s+RPATH\s+(.*)")
+    rpath_re = re.compile(r"\s+(?:RPATH|RUNPATH)\s+(.*)")
     for line in phdrs.split("\n"):
         m = rpath_re.match(line)
         if m:
             rpath = m.group(1)
             for dir in bad_dirs:
                 if dir in rpath:
-                    oe.qa.handle_error("rpaths", "package %s contains bad RPATH %s in file %s" % (name, rpath, file), d)
+                    oe.qa.handle_error("rpaths", "%s: %s contains bad RPATH %s" % (name, package_qa_clean_path(file, d, name), rpath), d)
 
 QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths"
 def package_qa_check_useless_rpaths(file, name, d, elf):
@@ -153,7 +153,7 @@  def package_qa_check_useless_rpaths(file, name, d, elf):
     phdrs = elf.run_objdump("-p", d)
 
     import re
-    rpath_re = re.compile(r"\s+RPATH\s+(.*)")
+    rpath_re = re.compile(r"\s+(?:RPATH|RUNPATH)\s+(.*)")
     for line in phdrs.split("\n"):
         m = rpath_re.match(line)
         if m: