Package: argon2
Version: 0~20190702+dfsg-4+b1
Severity: wishlist

Hey.

I stumbled over some odd issue, originally described here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068849#84

In short:
I use the argon2 tool inside the initramfs, into which I copy it via
initramfs-tools’ copy_exec function (defined in
/usr/share/initramfs-tools/hook-functions).

Now that function uses ldd to find out whether a binary is linked
against libpthread and if so, also includes libgcc because of #950254
(in short: pthread seems to dlopen() libgcc).

Now argon2 somehow doesn't indicate it uses libpthread:
$ ldd /usr/bin/argon2
        linux-vdso.so.1 (0x00007ffedb996000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f90666bb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f90668cb000)

which I don't quite understand why.
Actually, even when building it manually, an explicitly -lpthread it never
shows up there.

No idea why... perhaps some linker optimisation that goes wrong?
I tried with -Wl,--no-as-needed, but that doesn't help either.
I can only force it to link if using
   gcc … -Wl,--no-as-needed /usr/lib/x86_64-linux-gnu/libpthread.so.0
i.e. the real path of the .so.


So in my case, pthread_exit() fails eventually (in the initramfs), with
an error that libgcc cannot be found.


Any ideas what to do?


Thanks,
Chris.

Reply via email to