diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-06-27 00:55:50 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-01 13:56:02 +0100 |
commit | 4b160cb6806f1abd9598ad26c888c3e4dabbf557 (patch) | |
tree | 165089209d10b526c800e7cfaab0ee3ecb09c941 /meta | |
parent | 583f1e55cc27857b929d2b8e6ec278dba0157529 (diff) | |
download | poky-4b160cb6806f1abd9598ad26c888c3e4dabbf557.tar.gz |
utils.bbclass: Use objdump instead of readelf to compute SONAME
LLVM has changed the ELF header dump format [1], the code in oe_libinstall
relied upon the format and processed the SONAME inside square brackets
e.g.
0x000000000000000e (SONAME) Library soname: libreadline.so.8
with older readelf from ( llvm <19 or GNU binutils objdump ) we get
0x000000000000000e (SONAME) Library soname: [libreadline.so.8]
The check in oe_libinstall will now trip over ELF files read by llvm-readelf
from llvm19+
To make it portable which works across GNU binutils and LLVM tools
switch to using objdump -p to dump the ELF file and modify the regexp
accordingly, as an aside, the post processing expression is simplified
too
[1] https://github.com/llvm/llvm-project/pull/96562
(From OE-Core rev: 11ea8dc57f275057e19db564e6c55d2baea980b0)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes-global/utils.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes-global/utils.bbclass b/meta/classes-global/utils.bbclass index 957389928f..c9cae8930f 100644 --- a/meta/classes-global/utils.bbclass +++ b/meta/classes-global/utils.bbclass | |||
@@ -15,7 +15,7 @@ oe_soinstall() { | |||
15 | ;; | 15 | ;; |
16 | esac | 16 | esac |
17 | install -m 755 $1 $2/$libname | 17 | install -m 755 $1 $2/$libname |
18 | sonamelink=`${READELF} -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'` | 18 | sonamelink=`${OBJDUMP} -p $1 | grep SONAME | awk '{print $2}'` |
19 | if [ -z $sonamelink ]; then | 19 | if [ -z $sonamelink ]; then |
20 | bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'." | 20 | bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'." |
21 | fi | 21 | fi |
@@ -147,7 +147,7 @@ oe_libinstall() { | |||
147 | # special case hack for non-libtool .so.#.#.# links | 147 | # special case hack for non-libtool .so.#.#.# links |
148 | baselibfile=`basename "$libfile"` | 148 | baselibfile=`basename "$libfile"` |
149 | if (echo $baselibfile | grep -qE '^lib.*\.so\.[0-9.]*$'); then | 149 | if (echo $baselibfile | grep -qE '^lib.*\.so\.[0-9.]*$'); then |
150 | sonamelink=`${READELF} -d $libfile |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'` | 150 | sonamelink=`${OBJDUMP} -p $libfile | grep SONAME | awk '{print $2}'` |
151 | solink=`echo $baselibfile | sed -e 's/\.so\..*/.so/'` | 151 | solink=`echo $baselibfile | sed -e 's/\.so\..*/.so/'` |
152 | if [ -n "$sonamelink" -a x"$baselibfile" != x"$sonamelink" ]; then | 152 | if [ -n "$sonamelink" -a x"$baselibfile" != x"$sonamelink" ]; then |
153 | __runcmd ln -sf $baselibfile $destpath/$sonamelink | 153 | __runcmd ln -sf $baselibfile $destpath/$sonamelink |