diff options
author | Ross Burton <ross.burton@arm.com> | 2024-10-10 17:06:18 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-11 12:17:03 +0100 |
commit | 876d319f73cadd1168beecb5b2eedae696f68fd9 (patch) | |
tree | d98f613e858ebf66c2e25bf35e884705aeb4ba80 | |
parent | 27ab030dc01e9891668e6da66d2b5e0d84dba3f4 (diff) | |
download | poky-876d319f73cadd1168beecb5b2eedae696f68fd9.tar.gz |
insane: check for RUNPATH as well as RPATH
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
(From OE-Core rev: d6c5076d179a3d5ebb74b719ec4d523c197c1918)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-global/insane.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 7f01908e18..401807b2be 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): | |||
115 | oe.qa.handle_error("libexec", "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d, name), libexec), d) | 115 | oe.qa.handle_error("libexec", "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d, name), libexec), d) |
116 | 116 | ||
117 | QAPATHTEST[rpaths] = "package_qa_check_rpath" | 117 | QAPATHTEST[rpaths] = "package_qa_check_rpath" |
118 | def package_qa_check_rpath(file,name, d, elf): | 118 | def package_qa_check_rpath(file, name, d, elf): |
119 | """ | 119 | """ |
120 | Check for dangerous RPATHs | 120 | Check for dangerous RPATHs |
121 | """ | 121 | """ |
@@ -127,14 +127,14 @@ def package_qa_check_rpath(file,name, d, elf): | |||
127 | phdrs = elf.run_objdump("-p", d) | 127 | phdrs = elf.run_objdump("-p", d) |
128 | 128 | ||
129 | import re | 129 | import re |
130 | rpath_re = re.compile(r"\s+RPATH\s+(.*)") | 130 | rpath_re = re.compile(r"\s+(?:RPATH|RUNPATH)\s+(.*)") |
131 | for line in phdrs.split("\n"): | 131 | for line in phdrs.split("\n"): |
132 | m = rpath_re.match(line) | 132 | m = rpath_re.match(line) |
133 | if m: | 133 | if m: |
134 | rpath = m.group(1) | 134 | rpath = m.group(1) |
135 | for dir in bad_dirs: | 135 | for dir in bad_dirs: |
136 | if dir in rpath: | 136 | if dir in rpath: |
137 | oe.qa.handle_error("rpaths", "package %s contains bad RPATH %s in file %s" % (name, rpath, file), d) | 137 | oe.qa.handle_error("rpaths", "%s: %s contains bad RPATH %s" % (name, package_qa_clean_path(file, d, name), rpath), d) |
138 | 138 | ||
139 | QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths" | 139 | QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths" |
140 | def package_qa_check_useless_rpaths(file, name, d, elf): | 140 | def package_qa_check_useless_rpaths(file, name, d, elf): |
@@ -153,7 +153,7 @@ def package_qa_check_useless_rpaths(file, name, d, elf): | |||
153 | phdrs = elf.run_objdump("-p", d) | 153 | phdrs = elf.run_objdump("-p", d) |
154 | 154 | ||
155 | import re | 155 | import re |
156 | rpath_re = re.compile(r"\s+RPATH\s+(.*)") | 156 | rpath_re = re.compile(r"\s+(?:RPATH|RUNPATH)\s+(.*)") |
157 | for line in phdrs.split("\n"): | 157 | for line in phdrs.split("\n"): |
158 | m = rpath_re.match(line) | 158 | m = rpath_re.match(line) |
159 | if m: | 159 | if m: |