]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils.bbclass: Added error checking for oe_soinstall
authorHenry Bruce <henry.bruce@intel.com>
Wed, 7 Sep 2016 21:09:54 +0000 (14:09 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 9 Sep 2016 10:52:10 +0000 (11:52 +0100)
Fixes [YOCTO #10146]

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/utils.bbclass

index d56f51e32042df0f67a0e5d957755846abbdfad9..3c2a14fa421073beaaf27c7f3e9397d0120211ee 100644 (file)
@@ -62,15 +62,18 @@ def is_machine_specific(d):
 oe_soinstall() {
        # Purpose: Install shared library file and
        #          create the necessary links
-       # Example:
-       #
-       # oe_
-       #
-       #bbnote installing shared library $1 to $2
-       #
+       # Example: oe_soinstall libfoo.so.1.2.3 ${D}${libdir}
        libname=`basename $1`
+       case "$libname" in
+           *.so)
+               bbfatal "oe_soinstall: Shared library must haved versioned filename (e.g. libfoo.so.1.2.3)"
+               ;;
+       esac
        install -m 755 $1 $2/$libname
        sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+       if [ -z $sonamelink ]; then
+               bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'."
+       fi
        solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
        ln -sf $libname $2/$sonamelink
        ln -sf $libname $2/$solink