10963a8
10963a8
Reduce size of httpd binary by telling linker to export all symbols
10963a8
from libmain.a, rather than bloating the symbol table with ap_hack_*
10963a8
to do so indirectly.
10963a8
eb4dbe7
Upstream: https://svn.apache.org/r1861685 (as new default-off configure option)
10963a8
76f6dc7
diff --git a/Makefile.in b/Makefile.in
cd47f2b
index 40c7076..ac98e5f 100644
76f6dc7
--- a/Makefile.in
76f6dc7
+++ b/Makefile.in
76f6dc7
@@ -4,8 +4,15 @@ CLEAN_SUBDIRS = test
10963a8
 
10963a8
 PROGRAM_NAME         = $(progname)
10963a8
 PROGRAM_SOURCES      = modules.c
10963a8
-PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
10963a8
+PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) \
10963a8
+	$(PROGRAM_LDDEPS)  \
10963a8
+	$(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
10963a8
 PROGRAM_PRELINK      = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
10963a8
+PROGRAM_LDDEPS = \
10963a8
+  $(BUILTIN_LIBS) \
10963a8
+  $(MPM_LIB) \
10963a8
+  -Wl,--whole-archive,server/.libs/libmain.a,--no-whole-archive \
10963a8
+  os/$(OS_DIR)/libos.la
10963a8
 PROGRAM_DEPENDENCIES = \
10963a8
   server/libmain.la \
10963a8
   $(BUILTIN_LIBS) \
76f6dc7
diff --git a/server/Makefile.in b/server/Makefile.in
cd47f2b
index 8111877..f00bb3f 100644
76f6dc7
--- a/server/Makefile.in
76f6dc7
+++ b/server/Makefile.in
76f6dc7
@@ -12,7 +12,7 @@ LTLIBRARY_SOURCES = \
76f6dc7
 	connection.c listen.c util_mutex.c \
76f6dc7
 	mpm_common.c mpm_unix.c mpm_fdqueue.c \
76f6dc7
 	util_charset.c util_cookies.c util_debug.c util_xml.c \
76f6dc7
-	util_filter.c util_pcre.c util_regex.c exports.c \
76f6dc7
+	util_filter.c util_pcre.c util_regex.c \
cd47f2b
 	scoreboard.c error_bucket.c protocol.c core.c request.c ssl.c provider.c \
76f6dc7
 	eoc_bucket.c eor_bucket.c core_filters.c \
76f6dc7
 	util_expr_parse.c util_expr_scan.c util_expr_eval.c
76f6dc7
diff --git a/server/main.c b/server/main.c
76f6dc7
index 62e06df..17c09ee 100644
76f6dc7
--- a/server/main.c
76f6dc7
+++ b/server/main.c
76f6dc7
@@ -835,17 +835,3 @@ int main(int argc, const char * const argv[])
10963a8
     return !OK;
10963a8
 }
10963a8
 
10963a8
-#ifdef AP_USING_AUTOCONF
10963a8
-/* This ugly little hack pulls any function referenced in exports.c into
10963a8
- * the web server.  exports.c is generated during the build, and it
10963a8
- * has all of the APR functions specified by the apr/apr.exports and
10963a8
- * apr-util/aprutil.exports files.
10963a8
- */
10963a8
-const void *ap_suck_in_APR(void);
10963a8
-const void *ap_suck_in_APR(void)
10963a8
-{
10963a8
-    extern const void *ap_ugly_hack;
10963a8
-
10963a8
-    return ap_ugly_hack;
10963a8
-}
10963a8
-#endif