1 From e980dffe7903fb24af6e6ca9962ec43275c9d254 Mon Sep 17 00:00:00 2001
2 From: Andreas Oberritter <obi@saftware.de>
3 Date: Fri, 15 Mar 2013 15:17:27 +0100
4 Subject: [PATCH] autofs-5.0.7 - link autofs.a into executable only
6 This reduces the (stripped) binary size from 1.6M to 540K
9 The linker option -Wl,--whole-archive is used in order to
10 avoid discarding symbols used by modules but not by automount.
12 Signed-off-by: Andreas Oberritter <obi@saftware.de>
15 daemon/Makefile | 2 +-
16 modules/Makefile | 6 +++---
17 3 files changed, 5 insertions(+), 5 deletions(-)
19 diff --git a/Makefile.rules b/Makefile.rules
20 index 58b4bb2..ae0a43d 100644
23 @@ -67,5 +67,5 @@ endif
27 - $(CC) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(AUTOFS_LIB) $(DMALLOCLIB) $(LIBNSL)
28 + $(CC) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(DMALLOCLIB) $(LIBNSL)
30 diff --git a/daemon/Makefile b/daemon/Makefile
31 index 9e9d635..e9f6178 100644
34 @@ -30,7 +30,7 @@ endif
37 automount: $(OBJS) $(AUTOFS_LIB)
38 - $(CC) $(LDFLAGS) $(DAEMON_LDFLAGS) -o automount $(OBJS) $(AUTOFS_LIB) $(LIBS)
39 + $(CC) $(LDFLAGS) $(DAEMON_LDFLAGS) -o automount $(OBJS) -Wl,--whole-archive $(AUTOFS_LIB) -Wl,--no-whole-archive $(LIBS)
43 diff --git a/modules/Makefile b/modules/Makefile
44 index c5deb24..cb9142c 100644
45 --- a/modules/Makefile
46 +++ b/modules/Makefile
47 @@ -97,7 +97,7 @@ endif
49 lookup_hesiod.so: lookup_hesiod.c
50 $(CC) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \
51 - lookup_hesiod.c $(AUTOFS_LIB) $(LIBHESIOD) $(LIBRESOLV)
52 + lookup_hesiod.c $(LIBHESIOD) $(LIBRESOLV)
53 $(STRIP) lookup_hesiod.so
55 cyrus-sasl.o: cyrus-sasl.c
56 @@ -109,11 +109,11 @@ cyrus-sasl-extern.o: cyrus-sasl-extern.c
57 lookup_ldap.so: lookup_ldap.c dclist.o base64.o $(SASL_OBJ)
58 $(CC) $(SOLDFLAGS) $(CFLAGS) $(LDAP_FLAGS) -o lookup_ldap.so \
59 lookup_ldap.c dclist.o base64.o $(SASL_OBJ) \
60 - $(AUTOFS_LIB) $(LIBLDAP) $(LIBRESOLV)
61 + $(LIBLDAP) $(LIBRESOLV)
62 $(STRIP) lookup_ldap.so
64 mount_nfs.so: mount_nfs.c replicated.o
65 $(CC) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \
66 - mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL)
67 + mount_nfs.c replicated.o $(LIBNSL)