diff options
author | Emil Velikov <[email protected]> | 2014-03-11 17:58:08 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-03-31 14:56:14 +0100 |
commit | d681b22ed77274a805c6c8e81925c18eeb57a968 (patch) | |
tree | 123ac46987e30805fe5ca7b514597ae0b0565f02 /src/mesa/drivers | |
parent | d187a150d45cbf5bd3476eab49be5057382c2c86 (diff) |
automake: ask the linker to do garbage collection
By doing GC the linker removes all the symbols that are not referenced
and/or used by the final library. This results in a saving of ~100K
up-to ~600K per (stripped) binary (classic vs gallium drivers).
If interested one can ask the compiler to print the sections that are
removed using -Wl,--print-gc-sections.
v2: Check if ld supports the flag before using it.
Signed-off-by: Emil Velikov <[email protected]>
Acked-by: Matt Turner <[email protected]> (v1)
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/Makefile.am | 1 | ||||
-rw-r--r-- | src/mesa/drivers/osmesa/Makefile.am | 1 | ||||
-rw-r--r-- | src/mesa/drivers/x11/Makefile.am | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am index 17ac76be11f..f1fee122cb7 100644 --- a/src/mesa/drivers/dri/Makefile.am +++ b/src/mesa/drivers/dri/Makefile.am @@ -53,6 +53,7 @@ mesa_dri_drivers_la_SOURCES = mesa_dri_drivers_la_LDFLAGS = \ -module -avoid-version -shared \ -Wl,-Bsymbolic \ + $(GC_SECTIONS) \ $() mesa_dri_drivers_la_LIBADD = \ ../../libmesa.la \ diff --git a/src/mesa/drivers/osmesa/Makefile.am b/src/mesa/drivers/osmesa/Makefile.am index cfab70216ac..b133fd67922 100644 --- a/src/mesa/drivers/osmesa/Makefile.am +++ b/src/mesa/drivers/osmesa/Makefile.am @@ -39,6 +39,7 @@ lib@OSMESA_LIB@_la_LDFLAGS = \ -module \ -no-undefined \ -version-number @OSMESA_VERSION@ \ + $(GC_SECTIONS) \ -Wl,--no-undefined diff --git a/src/mesa/drivers/x11/Makefile.am b/src/mesa/drivers/x11/Makefile.am index 4c63d59a57c..2b38ad31101 100644 --- a/src/mesa/drivers/x11/Makefile.am +++ b/src/mesa/drivers/x11/Makefile.am @@ -64,6 +64,7 @@ lib@GL_LIB@_la_LIBADD = \ lib@GL_LIB@_la_LDFLAGS = \ -no-undefined \ -version-number $(GL_MAJOR):$(GL_MINOR):$(GL_PATCH) \ + $(GC_SECTIONS) \ -Wl,--no-undefined include $(top_srcdir)/install-lib-links.mk |