SliTaz SliTaz Forum

You are not logged in.

#1 2013-03-06 23:09:10

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

[development] Problems with libffi

Download latest cooking glib package (as example): http://mirror.slitaz.org/packages/cooking/glib-2.32.4.tazpkg

Double click, extract, go to inner filesystem glib-2.32.4/fs/usr/bin

Open terminal here (F4 in PCManFM).

[c]root@slitaz:/home/slitaz/test-depends/glib-2.32.4/fs/usr/bin# ldd ./gdbus
    linux-gate.so.1 =>  (0xffffe000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0xb77ae000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb777d000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb777a000)
    libdl.so.2 => /lib/libdl.so.2 (0xb7776000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7764000)
    libresolv.so.2 => /lib/libresolv.so.2 (0xb774f000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7671000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb766d000)
    libpcre.so.1 => not found
    libpthread.so.0 => /lib/libpthread.so.0 (0xb7654000)
    librt.so.1 => /lib/librt.so.1 (0xb764c000)
    libffi.so.6 => not found
    libc.so.6 => /lib/libc.so.6 (0xb7508000)
    libffi.so.5 => /usr/lib/libffi.so.5 (0xb7503000)
    /lib/ld-linux.so.2 (0xb7894000)[/c]
It's my output from stable SliTaz, note that this binary need both libffi.so.5 and libffi.so.6!

What we have on Rolling? http://pkgs.slitaz.org/search.sh?file=libffi.so

Only package libffi contains libffi.so.6

(And gcc+gcj contains libffi.so.4)

Why?

And what to do?

It's not so good practice not to check reverse depends when update package. So simple 'up libffi'…

Now, I think all packages with reverse depend libffi (http://pkgs.slitaz.org/search.sh?depends=libffi) should be tested against version of libffi and recooked.

For not to put nonsence empty lines to each receipt into wok, better to do it manually. Pascal, execuse me, but it is work for you smile You can recook packages without changing wok.

I know, it takes many many time (or you know a trick? set flag in Cook settings?), reverse-deps list contains 672 lines.

So sad topic…

Offline

#2 2013-03-07 07:49:14

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: [development] Problems with libffi

You are mixing stable and cooking packages.

If you really want to do that, install http://mirror.slitaz.org/packages/cooking/libffi-3.0.11.tazpkg *and* http://mirror.slitaz.org/packages/stable/libffi-3.0.10.tazpkg

On tank cooking :

# ldd glib/taz/glib-2.32.4/fs/usr/bin/gdbus

glib/taz/glib-2.32.4/fs/usr/bin/gdbus:

        linux-gate.so.1 =>  (0xffffe000)

        libgio-2.0.so.0 => not found

        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb77d4000)

        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb77d1000)

        libdl.so.2 => /lib/libdl.so.2 (0xb77cc000)

        libz.so.1 => /usr/lib/libz.so.1 (0xb77b8000)

        libresolv.so.2 => /lib/libresolv.so.2 (0xb77a0000)

        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb76c1000)

        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb76bf000)

        libpcre.so.1 => /usr/lib/libpcre.so.1 (0xb7689000)

        libpthread.so.0 => /lib/libpthread.so.0 (0xb766d000)

        librt.so.1 => /lib/librt.so.1 (0xb7664000)

        libffi.so.6 => /usr/lib/libffi.so.6 (0xb765f000)

        libc.so.6 => /lib/libc.so.6 (0xb74e8000)

        /lib/ld-linux.so.2 => /lib/ld-2.14.1.so (0xb7815000)

# ldd libgio/taz/libgio-2.32.4/fs/usr/lib/libgio-2.0.so.0

libgio/taz/libgio-2.32.4/fs/usr/lib/libgio-2.0.so.0:

        linux-gate.so.1 =>  (0xffffe000)

        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7585000)

        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7583000)

        libffi.so.6 => /usr/lib/libffi.so.6 (0xb757e000)

        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb757b000)

        libdl.so.2 => /lib/libdl.so.2 (0xb7575000)

        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7496000)

        libpcre.so.1 => /usr/lib/libpcre.so.1 (0xb7460000)

        libpthread.so.0 => /lib/libpthread.so.0 (0xb7445000)

        librt.so.1 => /lib/librt.so.1 (0xb743c000)

        libz.so.1 => /usr/lib/libz.so.1 (0xb7429000)

        libresolv.so.2 => /lib/libresolv.so.2 (0xb7410000)

        libc.so.6 => /lib/libc.so.6 (0xb7299000)

        /lib/ld-2.14.1.so (0xb7702000)

Install a cooking and chroot into:

# mkdir /home/slitaz/test-cooking

# cat > /home/slitaz/test-cooking/INSTALL <<EOT

#!/bin/sh

DIR=$(dirname $0)

MOUNTS="/proc /sys /dev/pts /dev/shm /run"

[ -s /etc/resolv.conf ] && cp /etc/resolv.conf $DIR/etc

if [ ! -d $DIR/proc/1 ]; then

  for i in $MOUNTS; do

    [ -d $i ] && mount --bind $i $DIR/$i

  done

  mount --bind /tmp $DIR/tmp || mount -t tmpfs tmpfs $DIR/tmp

fi

SHELL=/bin/ash chroot $DIR /bin/ash -

umount $DIR/tmp

for i in $MOUNTS; do

  umount $DIR/$i

done

EOT

Offline

#3 2013-03-07 10:46:38

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: [development] Problems with libffi

Than you, Pascal!

I not tested your script, sorry. I move other ways.

Booted into SliTaz Rolling Kultex Edition. And see your results (i.e. without libffi.so.5)

Booted into Puppy-Quirky and see no libffi.so.5 in the ldd listing too.

Something wrong with ldd, thanks no with packages.

I use ldd from glibc-dev package, so anyone who still using SliTaz 4.0 can repeat my test.

Sure that I use "official" ldd, not SliTaz script:

[c]$ ldd --help
Usage: ldd [OPTION]... FILE...
      --help              print this help and exit
      --version           print version information and exit
  -d, --data-relocs       process data relocations
  -r, --function-relocs   process data and function relocations
  -u, --unused            print unused direct dependencies
  -v, --verbose           print all information

For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.[/c]
SliTaz /usr/bin/ldd script have no options.

I'm on SliTaz Stable now, and I extracted latest Cooking glib package to /home/tux/test-depends:

[c]$ ldd /home/tux/test-depends/glib-2.32.4/fs/usr/bin/gdbus
    linux-gate.so.1 =>  (0xffffe000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0xb77da000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb77a9000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb77a6000)
    libdl.so.2 => /lib/libdl.so.2 (0xb77a2000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7790000)
    libresolv.so.2 => /lib/libresolv.so.2 (0xb777b000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb769d000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7699000)
    libpcre.so.1 => not found
    libpthread.so.0 => /lib/libpthread.so.0 (0xb7680000)
    librt.so.1 => /lib/librt.so.1 (0xb7678000)
    libffi.so.6 => not found
    libc.so.6 => /lib/libc.so.6 (0xb7534000)
    libffi.so.5 => /usr/lib/libffi.so.5 (0xb752f000)
    /lib/ld-linux.so.2 (0xb78c0000)[/c]
And libffi.so.5 is here!

Let's show libffi strings from this binary:

[c]$ strings ~/test-depends/glib-2.32.4/fs/usr/bin/gdbus | grep libffi
libffi.so.6[/c]
No, don't trust your eyes with ldd listing! None libffi.so.5!

Chroot into Cooking environment:

[c]$ su
Password:
# tazdev chroot

Mounting virtual filesystems...                                      [ OK ]
Chrooting to: /home/slitaz/cooking/chroot[/c]
Which ldd I use?

[c]root@slitaz:/# ldd --help
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (ru_RU)
Usage: ldd [OPTION]... FILE...
      --help              print this help and exit
      --version           print version information and exit
  -d, --data-relocs       process data relocations
  -r, --function-relocs   process data and function relocations
  -u, --unused            print unused direct dependencies
  -v, --verbose           print all information

For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.[/c]
Same.

Let's show ldd output from /usr/bin/gdbus installed in my Cooking Chroot:

[c]root@slitaz:/# ldd /usr/bin/gdbus
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (ru_RU)
    linux-gate.so.1 =>  (0xffffe000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0xb776e000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb772f000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb772c000)
    libdl.so.2 => /lib/libdl.so.2 (0xb7727000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7713000)
    libresolv.so.2 => /lib/libresolv.so.2 (0xb76fb000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb761c000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb761a000)
    libpcre.so.1 => /usr/lib/libpcre.so.1 (0xb75e4000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb75c8000)
    librt.so.1 => /lib/librt.so.1 (0xb75bf000)
    libffi.so.6 => /usr/lib/libffi.so.6 (0xb75ba000)
    libc.so.6 => /lib/libc.so.6 (0xb7443000)
    /lib/ld-linux.so.2 (0xb78ac000)[/c]
Only libffi.so.6.

Let's calculate md5sum:

[c]root@slitaz:/# md5sum /usr/bin/gdbus
df7d621caccfa966f6b8f3a833b26e7d  /usr/bin/gdbus[/c]
Exit from chroot to my stable system:

[c]root@slitaz:/# exit

Unmounting virtual filesystems...                                    [ OK ][/c]
Calculate md5sum for latest Cooking extracted gdbus:

[c]# md5sum /home/tux/test-depends/glib-2.32.4/fs/usr/bin/gdbus
df7d621caccfa966f6b8f3a833b26e7d  /home/tux/test-depends/glib-2.32.4/fs/usr/bin/gdbus[/c]
Checksums are the same.

Test ldd, and output the same like in the very beginning. Both libffi are here…

______

For what I need these ldd outputs?

I wrote script that checks all executable binaries and libraries deep in the given folder ($fs when cooked), then it processed ldd output for that binaries and libraries, sorted, deleted existing libs, sorted, finded packages that contained needed depends, and outputs list of depends to me. I use that list in my receipts in the DEPENDS variable.

Ok, now I know that I want to run my script within Chroot. Better I add that functionality to my /usr/bin/cook, like this:

[c]cook qtfm --check-deps[/c]

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 8 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]