[waffle] [PATCH 3/6] android: export only the required functions

Emil Velikov emil.l.velikov at gmail.com
Tue Feb 3 16:55:16 PST 2015


By adding -fvisibility=hidden to the compiler flags. This obviously
requires GCC 4.0 or later, which has been an undocumented requirement
for our android build since day one.

Additionally it nicely reduces the size of the binary

Before

   text    data     bss     dec     hex filename
  49310     660      20   49990    c346 libwaffle-1.so

Overall size: 67K

After:

   text    data     bss     dec     hex filename
  36612     560      20   37192    9148 libwaffle-1.so

Overall size: 52K

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Reviewed-by: Chad Versace <chad.versace at intel.com>
---
 Android.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Android.mk b/Android.mk
index b7865ed..d29a16a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -36,7 +36,7 @@ LOCAL_CFLAGS := \
     -DWAFFLE_ANDROID_MINOR_VERSION=$(waffle_android_minor_version) \
     -Wno-pointer-arith
 
-LOCAL_CFLAGS += -std=c99
+LOCAL_CFLAGS += -std=c99 -fvisibility=hidden
 
 LOCAL_C_INCLUDES := \
     $(LOCAL_PATH)/include \
-- 
2.1.3



More information about the waffle mailing list