From f8e42237283d2b4ec829449adbbcfc9e51ac8756 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 21 Aug 2017 14:27:42 -0500 Subject: Android: gallium_dri: pass dri.sym to linker 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. HAVE_DLADDR also needs to be set so that __driDriverExtensions is defined. We need to pass "--undefined-version" because the Android build system sets --no-undefined-version by default and we get an error on driver specific symbols if those drivers are disabled without the option. Suggested-by: Emil Velikov Reviewed-by: Emil Velikov Signed-off-by: Rob Herring --- src/gallium/targets/dri/Android.mk | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk index 96b570ea116..e40288c21b9 100644 --- a/src/gallium/targets/dri/Android.mk +++ b/src/gallium/targets/dri/Android.mk @@ -32,6 +32,13 @@ LOCAL_SRC_FILES := target.c LOCAL_CFLAGS := +# We need --undefined-version as some functions in dri.sym may be missing +# depending on which drivers are enabled or not. Otherwise, we get the error: +# "version script assignment of to symbol FOO failed: symbol not defined" +LOCAL_LDFLAGS := \ + -Wl,--version-script=$(LOCAL_PATH)/dri.sym \ + -Wl,--undefined-version + LOCAL_SHARED_LIBRARIES := \ libdl \ libglapi \ -- cgit v1.2.3