summaryrefslogtreecommitdiff
path: root/patches/patch-small-lib
blob: d62085a56aa5d22fb718866e7c5a52ba976f136a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

An idea.  Don't remember if it works or helps.  Enabling
-ffunction-sections could be a good first step to implementing
library peeling.

Index: configure.ac
===================================================================
RCS file: /var/cvs/liboil/configure.ac,v
retrieving revision 1.33
diff -u -r1.33 configure.ac
--- configure.ac	11 Jan 2005 08:03:08 -0000	1.33
+++ configure.ac	13 Jan 2005 06:41:40 -0000
@@ -128,7 +128,7 @@
     true)
 fi
 
-LIBOIL_CFLAGS="$LIBOIL_CFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L -I\$(top_srcdir) -O2"
+LIBOIL_CFLAGS="$LIBOIL_CFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L -I\$(top_srcdir) -O2 -ffunction-sections -fdata-sections"
 AC_SUBST(LIBOIL_CFLAGS)
 
 LIBOIL_LIBS="\$(top_builddir)/liboil/liboil-$LIBOIL_MAJORMINOR.la"
Index: liboil/Makefile.am
===================================================================
RCS file: /var/cvs/liboil/liboil/Makefile.am,v
retrieving revision 1.26
diff -u -r1.26 Makefile.am
--- liboil/Makefile.am	10 Jan 2005 04:51:51 -0000	1.26
+++ liboil/Makefile.am	13 Jan 2005 06:41:40 -0000
@@ -30,7 +30,8 @@
 
 liboiltmp1_la_SOURCES =
 liboiltmp1_la_LDFLAGS = -lm \
-	-export-symbols-regex 'oil_'
+	-export-symbols-regex 'oil_' \
+	-Wl,--gc-sections
 liboiltmp1_la_LIBADD = \
 	liboilfunctions.la
 
@@ -55,7 +56,8 @@
 liboil_@LIBOIL_MAJORMINOR@_la_CFLAGS = $(LIBOIL_CFLAGS)
 liboil_@LIBOIL_MAJORMINOR@_la_LDFLAGS = -lm \
 	-version-info $(LIBOIL_LIBVERSION) \
-	-export-symbols-regex '^oil_'
+	-export-symbols-regex '^oil_' \
+	-Wl,--gc-sections
 
 # This is required to use 'make -j2'. Automake doesn't seem to notice
 # that one of the dependencies is in this directory.
@@ -85,11 +87,11 @@
 	echo '  NULL' >>liboilarray.c
 	echo '};' >>liboilarray.c
 	echo >>liboilarray.c
-	grep '^_oil_function_impl_' .libs/liboiltmp1.exp | \
+	grep '^_oil_function_impl_.*ref' .libs/liboiltmp1.exp | \
 	  sed 's/.*/extern OilFunctionImpl &;/' >>liboilarray.c
 	echo >>liboilarray.c
 	echo 'OilFunctionImpl *_oil_function_impl_array[] = {' >>liboilarray.c
-	grep '^_oil_function_impl_' .libs/liboiltmp1.exp | \
+	grep '^_oil_function_impl_.*ref' .libs/liboiltmp1.exp | \
 	  sed 's/.*/  \&&,/' >>liboilarray.c
 	echo '  NULL' >>liboilarray.c
 	echo '};' >>liboilarray.c