summaryrefslogtreecommitdiffstats
path: root/src/gallium/Automake.inc
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-03-11 17:58:08 +0000
committerEmil Velikov <[email protected]>2014-03-31 14:56:14 +0100
commitd681b22ed77274a805c6c8e81925c18eeb57a968 (patch)
tree123ac46987e30805fe5ca7b514597ae0b0565f02 /src/gallium/Automake.inc
parentd187a150d45cbf5bd3476eab49be5057382c2c86 (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/gallium/Automake.inc')
-rw-r--r--src/gallium/Automake.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 1151f916bef..56f1433a0f8 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -57,6 +57,7 @@ GALLIUM_DRI_LINKER_FLAGS = \
-shared \
-module \
-avoid-version \
+ $(GC_SECTIONS) \
-Wl,--version-script=$(DRI_VERSION_SCRIPT)
GALLIUM_VDPAU_LINKER_FLAGS = \
@@ -65,6 +66,7 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
-no-undefined \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-export-symbols-regex $(VDPAU_EXPORTS) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
GALLIUM_XVMC_LINKER_FLAGS = \
@@ -73,6 +75,7 @@ GALLIUM_XVMC_LINKER_FLAGS = \
-no-undefined \
-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-export-symbols-regex '^XvMC' \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
GALLIUM_OMX_LINKER_FLAGS = \
@@ -80,6 +83,7 @@ GALLIUM_OMX_LINKER_FLAGS = \
-module \
-no-undefined \
-export-symbols-regex $(EXPORTS) \
+ $(GC_SECTIONS) \
-Wl,--no-undefined
GALLIUM_VDPAU_LIB_DEPS = \