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