Static build errors with pthread

Denys Vlasenko vda.linux at googlemail.com
Thu Oct 8 13:45:55 UTC 2015


I've seen this problem too.

Try newer git, now LDLIBS += pthread is done only if enabled in .config


On Thu, Oct 8, 2015 at 7:08 AM, James B <jamesbond3142 at gmail.com> wrote:
> Commit 2156e228537065f04e5f862e186421df0db36612 (Makefile.flags: survive a build system which has no pthread) doesn't fully fix the problem introduced bb2fd67d0bfe16441d4b1d2e6ece83b04955b379 (unconditional inclusion of pthread).
>
> The test included in that commit only tests for dynamic linking of pthread; and if it works, pthread is added to LDLIBS.
>
> Unfortunately, there are (buggy) toolchains where dynamic linking of pthread library works fine but static linking fails; e.g. http://lists.uclibc.org/pipermail/uclibc-cvs/2015-May/031562.html. In this case, because the test succeeds, the build will continue until the final linking stage where it bombs out with duplicate symbols for setresgid and setresuid.
>
> I don't know how prevalent these toolchains are; I use the one from Aboriginal Linux and I am able to reproduce the error from the latest release (Sep 2015) back to releases from two years ago. Yet I've been able to build busybox with these toolchains until very recently.
>
> My own fix includes commenting out that entire block of #ifdefs because I don't need to use pthread (apparently only PAM code requires that); but the better fix would be to make the test follows the configuration - if static build is specified then test static pthread linking; if shared build is specified then test for dynamic linking.
>
> cheers!
>
> --
> James B <jamesbond3142 at gmail.com>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list