[OE-core] [PATCH] utils.bbclass: Avoid recursive symlink in oe_soinstall

Andre McCurdy armccurdy at gmail.com
Wed Feb 26 20:07:46 UTC 2020


On Tue, Feb 25, 2020 at 6:17 AM Yevhenii Shchehlov
<eugenyshcheglov at gmail.com> wrote:
>
> This patch fixes an issue when oe_soinstall function creates
> non-functional recursive symlinks in case library soname is equal
> to library real (file) name.
>
> Signed-off-by: Yevhenii Shchehlov <eugenyshcheglov at gmail.com>
> ---
>  meta/classes/utils.bbclass | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
> index cd3d05709e..dea824f54f 100644
> --- a/meta/classes/utils.bbclass
> +++ b/meta/classes/utils.bbclass
> @@ -25,7 +25,7 @@ oe_soinstall() {
>         libname=`basename $1`
>         case "$libname" in
>             *.so)
> -               bbfatal "oe_soinstall: Shared library must haved versioned filename (e.g. libfoo.so.1.2.3)"
> +               bbfatal "oe_soinstall: Shared library must haved versioned filename (e.g. libfoo.so.1.2.3 instead of libfoo.so)"

This patch look OK but it might be nice to also clean up this error
message (and the Example comment a few lines above it) to drop the 3
levels of version number. There should only be 2, ie the fully
versioned filename would be libfoo.so.1.2 instead of libfoo.so.1.2.3

>                 ;;
>         esac
>         install -m 755 $1 $2/$libname
> @@ -33,8 +33,12 @@ oe_soinstall() {
>         if [ -z $sonamelink ]; then
>                 bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'."
>         fi
> +       if [ "$sonamelink" == "$libname" ]; then
> +               bbwarn "oe_soinstall: $libname soname is equal to real (file) name. Minor version should be added to a real name (e.g. libfoo.so.1.2 instead of libfoo.so.1)"

It might be clearer to say:

"oe_soinstall: $libname soname is equal to fully versioned real (file)
name. The soname should include the major version only (e.g.
libfoo.so.1 instead of libfoo.so.1.2)"

> +       else
> +               ln -sf $libname $2/$sonamelink
> +       fi
>         solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
> -       ln -sf $libname $2/$sonamelink
>         ln -sf $libname $2/$solink
>  }
>
> --
> 2.25.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


More information about the Openembedded-core mailing list