stripping private symbols



Hi,

Attached patch passes the -export-symbols-regex option to libtool to
strip out all underscore-prefixed symbols. This seems to have the side
effect of also stripping all local symbols, I don't know if that makes
any difference. Due to the local-symbol stripping nm reports less than
2000 symbols after this patch is applied, vs. 6000 or so before.

I noticed that lots of the libraries we build (such as the x11 and
linux-fb GDK backend libs) don't get -export-dynamic, -rpath, or
-version-info, while the main GDK and GTK libs do get those
options. Bug or feature?

Anyhow, I only added the -export-symbols-regex option to makefiles
that already had the other libtool options.

This libtool option conceivably breaks stuff, but if so we should find
out sooner rather than later, so I think it should go ahead and go in.

Havoc

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.1635
diff -u -u -r1.1635 ChangeLog
--- ChangeLog	2001/01/01 20:26:09	1.1635
+++ ChangeLog	2001/01/01 21:19:35
@@ -1,5 +1,14 @@
 2001-01-01  Havoc Pennington  <hp redhat com>
 
+	* gtk/Makefile.am (LDFLAGS): add @LIBTOOL_EXPORT_OPTIONS@
+
+	* gdk/Makefile.am (LDFLAGS): add @LIBTOOL_EXPORT_OPTIONS@
+
+	* configure.in (LIBTOOL_EXPORT_OPTIONS): define
+	LIBTOOL_EXPORT_OPTIONS with options to control symbol export
+
+2001-01-01  Havoc Pennington  <hp redhat com>
+
 	* gtk/gtktexttagprivate.h: uscore-prepend all the stuff in here.
 
 	* gtk/gtk-boxed.defs (GtkTextAttributes): Add boxed type for 
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.188
diff -u -u -r1.188 configure.in
--- configure.in	2000/12/21 10:31:29	1.188
+++ configure.in	2001/01/01 21:19:35
@@ -178,6 +178,11 @@
 # Honor aclocal flags
 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
 
+# libtool option to control which symbols are exported
+# right now, symbols starting with _ are not exported
+LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
+
 # define a MAINT-like variable REBUILD which is set if Perl
 # and awk are found, so autogenerated sources can be rebuilt
 
Index: gdk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/Makefile.am,v
retrieving revision 1.56
diff -u -u -r1.56 Makefile.am
--- gdk/Makefile.am	2000/12/06 05:31:24	1.56
+++ gdk/Makefile.am	2001/01/01 21:19:35
@@ -33,6 +33,7 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) 	\
 	-export-dynamic 					\
 	-rpath @prefix@/lib 					\
+	@LIBTOOL_EXPORT_OPTIONS@				\
 	@PANGO_LIBS@						\
 	@GLIB_DEPLIBS@						\
 	@more_ldflags@						\
Index: gdk-pixbuf/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/ChangeLog,v
retrieving revision 1.266
diff -u -u -r1.266 ChangeLog
--- gdk-pixbuf/ChangeLog	2000/12/30 20:06:13	1.266
+++ gdk-pixbuf/ChangeLog	2001/01/01 21:19:36
@@ -1,3 +1,8 @@
+2001-01-01  Havoc Pennington  <hp redhat com>
+
+	* Makefile.am (libgdk_pixbuf_1_3_la_LDFLAGS): add
+	@LIBTOOL_EXPORT_OPTIONS@
+
 2000-12-30  Tor Lillqvist  <tml iki fi>
 
 	* gdk_pixbuf.def: Update.
Index: gdk-pixbuf/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/Makefile.am,v
retrieving revision 1.79
diff -u -u -r1.79 Makefile.am
--- gdk-pixbuf/Makefile.am	2000/11/16 00:16:45	1.79
+++ gdk-pixbuf/Makefile.am	2001/01/01 21:19:36
@@ -174,6 +174,7 @@
 
 libgdk_pixbuf_1_3_la_LDFLAGS = 				        \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)    \
+	@LIBTOOL_EXPORT_OPTIONS@				\
 	$(GLIB_LIBS) 
 libgdk_pixbuf_1_3_la_LIBADD = pixops/libpixops.la
 
Index: gtk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/Makefile.am,v
retrieving revision 1.141
diff -u -u -r1.141 Makefile.am
--- gtk/Makefile.am	2000/11/16 21:17:53	1.141
+++ gtk/Makefile.am	2001/01/01 21:19:36
@@ -33,6 +33,7 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)	\
 	-export-dynamic						\
 	-rpath @prefix@/lib					\
+	@LIBTOOL_EXPORT_OPTIONS@				\
 	@PANGO_LIBS@						\
 	@GLIB_DEPLIBS@ 						\
 	@more_ldflags@						\




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]