diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-05-18 18:29:24 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-05-18 18:29:24 +0200 |
commit | f0ed90b7678045759ffa2a44d2b4cac96968b077 (patch) | |
tree | d341b174630f4d1821ea9b4df401557dbde430f8 | |
parent | f34939e79b77c324f4c294429d01f69387d24e2e (diff) |
build: use --gc-sections, -fvisibility=hidden
After:
# ls -l /sbin/udevadm /sbin/udevd /lib/udev/*_id
-rwxr-xr-x 1 root root 22984 May 18 18:19 /lib/udev/ata_id
-rwxr-xr-x 1 root root 31208 May 18 18:19 /lib/udev/cdrom_id
-rwxr-xr-x 1 root root 27128 May 18 18:19 /lib/udev/input_id
-rwxr-xr-x 1 root root 31272 May 18 18:19 /lib/udev/path_id
-rwxr-xr-x 1 root root 31896 May 18 18:19 /lib/udev/scsi_id
-rwxr-xr-x 1 root root 35456 May 18 18:19 /lib/udev/usb_id
-rwxr-xr-x 1 root root 6416 May 18 18:19 /lib/udev/v4l_id
-rwxr-xr-x 1 root root 130320 May 18 18:19 /sbin/udevadm
-rwxr-xr-x 1 root root 134648 May 18 18:19 /sbin/udevd
Before:
# ls -l /sbin/udevadm /sbin/udevd /lib/udev/*_id
-rwxr-xr-x 1 root root 27208 May 18 18:22 /lib/udev/ata_id
-rwxr-xr-x 1 root root 35456 May 18 18:22 /lib/udev/cdrom_id
-rwxr-xr-x 1 root root 39584 May 18 18:22 /lib/udev/input_id
-rwxr-xr-x 1 root root 39600 May 18 18:22 /lib/udev/path_id
-rwxr-xr-x 1 root root 36056 May 18 18:22 /lib/udev/scsi_id
-rwxr-xr-x 1 root root 43712 May 18 18:22 /lib/udev/usb_id
-rwxr-xr-x 1 root root 6504 May 18 18:22 /lib/udev/v4l_id
-rwxr-xr-x 1 root root 142656 May 18 18:22 /sbin/udevadm
-rwxr-xr-x 1 root root 142888 May 18 18:22 /sbin/udevd
-rw-r--r-- | Makefile.am | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index 0a340aa391..1b0d6a3797 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,13 @@ AM_CPPFLAGS = \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DLIBEXECDIR=\""$(libexecdir)"\" +AM_CFLAGS = \ + -fvisibility=hidden \ + -ffunction-sections \ + -fdata-sections + AM_LDFLAGS = \ + -Wl,--gc-sections \ -Wl,--as-needed DISTCHECK_CONFIGURE_FLAGS = \ @@ -54,6 +60,9 @@ libudev_libudev_la_SOURCES =\ libudev/libudev-monitor.c \ libudev/libudev-queue.c +libudev_libudev_la_CFLAGS = \ + -fvisibility=default + libudev_libudev_la_LDFLAGS = \ -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \ -export-symbols $(top_srcdir)/libudev/exported_symbols @@ -404,7 +413,11 @@ extras_gudev_libgudev_1_0_la_CPPFLAGS = \ -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \ -D_GUDEV_COMPILATION \ -DG_LOG_DOMAIN=\"GUdev\" -extras_gudev_libgudev_1_0_la_CFLAGS = $(GLIB_CFLAGS) + +extras_gudev_libgudev_1_0_la_CFLAGS = \ + -fvisibility=default \ + $(GLIB_CFLAGS) + extras_gudev_libgudev_1_0_la_LIBADD = libudev/libudev.la $(GLIB_LIBS) extras_gudev_libgudev_1_0_la_LDFLAGS = \ @@ -434,20 +447,20 @@ extras/gudev/gudevenumtypes.c: extras/gudev/gudevenumtypes.c.template extras/gud $@.tmp && mv $@.tmp $@ if ENABLE_INTROSPECTION -extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER) Makefile.am - $(AM_V_GEN)PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \ - LD_LIBRARY_PATH=$(top_builddir)/extras/gudev:$$LD_LIBRARY_PATH \ - $(G_IR_SCANNER) -v \ +extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER) + $(AM_V_GEN)$(G_IR_SCANNER) -v \ + --warn-all \ --namespace GUdev \ --nsversion=1.0 \ --include=GObject-2.0 \ --library=gudev-1.0 \ - --library-path=extras/gudev \ + --library-path=$(top_builddir)/libudev \ + --library-path=$(top_builddir)/extras/gudev \ --output $@ \ --pkg=glib-2.0 \ --pkg=gobject-2.0 \ - -I$(top_builddir)/extras \ -I$(top_srcdir)/extras \ + -I$(top_builddir)/extras \ -D_GUDEV_COMPILATION \ -D_GUDEV_WORK_AROUND_DEV_T_BUG \ $(top_srcdir)/extras/gudev/gudev.h \ |