[git commit] Fix link failure on some platforms when PAM is enabled

Denys Vlasenko vda.linux at googlemail.com
Mon Dec 5 03:38:58 UTC 2011

commit: http://git.busybox.net/busybox/commit/?id=5560e1af0ada7eb75e8bd4945e2c05ab5d31b415
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Tristan Schmelcher <tristan_schmelcher at alumni.uwaterloo.ca>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
 Makefile.flags |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/Makefile.flags b/Makefile.flags
index 7e1c603..ee4c518 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -105,7 +105,14 @@ LDLIBS += m
 ifeq ($(CONFIG_PAM),y)
-LDLIBS += pam pam_misc
+# libpam uses libpthread, so for static builds busybox must be linked to
+# libpthread. On some platforms that requires an explicit -lpthread, so
+# it should be in LDLIBS. For non-static builds, scripts/trylink will
+# take care of removing -lpthread if possible. (Not bothering to check
+# CONFIG_STATIC because even in a non-static build it could be that the
+# only libpam available is libpam.a, so -lpthread could still be
+# needed.)
+LDLIBS += pam pam_misc pthread
 ifeq ($(CONFIG_SELINUX),y)

More information about the busybox-cvs mailing list