[Mesa-dev] [PATCH] Android: gallium_dri: pass dri.sym to linker

Rob Herring robh at kernel.org
Mon Aug 21 19:33:07 UTC 2017


Pass the dri.sym version script to the linker. This ensures only
explicitly exported symbols are exported and shrinks the library by up
to 60KB.

We need to pass "--undefined-version" because the Android build system
sets --no-undefined-version by default and we get an error on
__driDriverExtensions without the option.

Suggested-by: Emil Velikov <emil.l.velikov at gmail.com>
Signed-off-by: Rob Herring <robh at kernel.org>
---
 src/gallium/targets/dri/Android.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk
index 150b2e368e51..313930b76274 100644
--- a/src/gallium/targets/dri/Android.mk
+++ b/src/gallium/targets/dri/Android.mk
@@ -32,6 +32,10 @@ LOCAL_SRC_FILES := target.c
 
 LOCAL_CFLAGS :=
 
+LOCAL_LDFLAGS := \
+	-Wl,--version-script=$(LOCAL_PATH)/dri.sym \
+	-Wl,--undefined-version
+
 LOCAL_SHARED_LIBRARIES := \
 	libdl \
 	liblog \
-- 
2.11.0



More information about the mesa-dev mailing list