diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-12 03:12:17 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-12 03:12:17 +0200 |
commit | c8e5ead03ac97da5b8a864481c8a790cfe8dfe4d (patch) | |
tree | 68b49cc0e7bf184c32613637e8d53ae04fe39b2a | |
parent | 2dbbf823efe2e74458d5927e6b21310d72266b0f (diff) | |
download | busybox-w32-c8e5ead03ac97da5b8a864481c8a790cfe8dfe4d.tar.gz busybox-w32-c8e5ead03ac97da5b8a864481c8a790cfe8dfe4d.tar.bz2 busybox-w32-c8e5ead03ac97da5b8a864481c8a790cfe8dfe4d.zip |
build system: remove special-casing for extra libs
It is not reliable (tried on three systems, multiple problems).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | Config.in | 8 | ||||
-rw-r--r-- | Makefile.flags | 25 |
2 files changed, 11 insertions, 22 deletions
@@ -514,14 +514,6 @@ config PIE | |||
514 | 514 | ||
515 | Most people will leave this set to 'N'. | 515 | Most people will leave this set to 'N'. |
516 | 516 | ||
517 | config LINK_WITH_PTHREAD | ||
518 | bool "Link with pthread library" | ||
519 | default n | ||
520 | help | ||
521 | On some systems, some libraries (such as crypt) also require pthread. | ||
522 | |||
523 | Select this only if your build otherwise fails. | ||
524 | |||
525 | config NOMMU | 517 | config NOMMU |
526 | bool "Force NOMMU build" | 518 | bool "Force NOMMU build" |
527 | default n | 519 | default n |
diff --git a/Makefile.flags b/Makefile.flags index b6cd32e42..9f77674ba 100644 --- a/Makefile.flags +++ b/Makefile.flags | |||
@@ -129,22 +129,19 @@ else | |||
129 | LDLIBS += m | 129 | LDLIBS += m |
130 | endif | 130 | endif |
131 | 131 | ||
132 | ifeq ($(CONFIG_LINK_WITH_PTHREAD),y) | 132 | # libpam may use libpthread, libdl and/or libaudit. |
133 | PTHREAD_AVAILABLE := $(shell echo 'int main(void){return 0;}' >pthreadtest.c; $(CC) $(CFLAGS) -lpthread -o /dev/null pthreadtest.c >/dev/null 2>&1 && echo "y"; rm pthreadtest.c) | 133 | # On some platforms that requires an explicit -lpthread, -ldl, -laudit. |
134 | ifeq ($(PTHREAD_AVAILABLE),y) | 134 | # However, on *other platforms* it fails when some of those flags |
135 | LDLIBS += pthread | 135 | # given needlessly. On some systems, crypt needs pthread. |
136 | endif | 136 | # |
137 | endif | 137 | # I even had a system where a runtime test for pthread |
138 | # (similar to CRYPT_AVAILABLE test above) was not reliable. | ||
139 | # | ||
140 | # Do not propagate this mess by adding libraries to CONFIG_PAM/CRYPT_AVAILABLE blocks. | ||
141 | # Add libraries you need to CONFIG_EXTRA_LDLIBS instead. | ||
138 | 142 | ||
139 | ifeq ($(CONFIG_PAM),y) | 143 | ifeq ($(CONFIG_PAM),y) |
140 | # libpam uses libpthread, libdl and libaudit, so for static builds busybox | 144 | LDLIBS += pam pam_misc |
141 | # must be linked to libpthread, libdl and libaudit. On some platforms that | ||
142 | # requires an explicit -lpthread, -ldl and -laudit, so it should be in | ||
143 | # LDLIBS. For non-static builds, scripts/trylink will take care of removing | ||
144 | # these flags if possible. (Not bothering to check CONFIG_STATIC because | ||
145 | # even in a non-static build it could be that the only libpam available is | ||
146 | # libpam.a, so -lpthread & Co. could still be needed.) | ||
147 | LDLIBS += pam pam_misc pthread dl audit | ||
148 | endif | 145 | endif |
149 | 146 | ||
150 | ifeq ($(CONFIG_SELINUX),y) | 147 | ifeq ($(CONFIG_SELINUX),y) |