automake: ask the linker to do garbage collection
authorEmil Velikov <emil.l.velikov@gmail.com>
Tue, 11 Mar 2014 17:58:08 +0000 (17:58 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 31 Mar 2014 13:56:14 +0000 (14:56 +0100)
commitd681b22ed77274a805c6c8e81925c18eeb57a968
tree123ac46987e30805fe5ca7b514597ae0b0565f02
parentd187a150d45cbf5bd3476eab49be5057382c2c86
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 <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com> (v1)
20 files changed:
configure.ac
src/egl/main/Makefile.am
src/egl/wayland/wayland-egl/Makefile.am
src/gallium/Automake.inc
src/gallium/targets/egl-static/Makefile.am
src/gallium/targets/gbm/Makefile.am
src/gallium/targets/libgl-xlib/Makefile.am
src/gallium/targets/opencl/Makefile.am
src/gallium/targets/osmesa/Makefile.am
src/gallium/targets/pipe-loader/Makefile.am
src/gallium/targets/xa/Makefile.am
src/gbm/Makefile.am
src/glx/Makefile.am
src/mapi/es1api/Makefile.am
src/mapi/es2api/Makefile.am
src/mapi/shared-glapi/Makefile.am
src/mapi/vgapi/Makefile.am
src/mesa/drivers/dri/Makefile.am
src/mesa/drivers/osmesa/Makefile.am
src/mesa/drivers/x11/Makefile.am