summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-04 23:33:07 +0100
committerMax Kellermann <max@musicpd.org>2018-01-04 23:33:07 +0100
commit5724656acb2058c6adb6bd4040fb0867576c6353 (patch)
tree3b035bea85a5fdb30b38f100bd40083c876c2013 /android
parent329f9cd9fe4d41afa2986dbf358339b7a48d044b (diff)
android/build.py: enable function/data sections in static libraries
.. and make all library symbols hidden by default. Saves big amounts of .text section size with --gc-sections, because only this allows discarding unused functions from those (static) third-party libraries.
Diffstat (limited to 'android')
-rwxr-xr-xandroid/build.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/android/build.py b/android/build.py
index fab6ecb49..edabccf01 100755
--- a/android/build.py
+++ b/android/build.py
@@ -73,6 +73,8 @@ class AndroidNdkToolchain:
self.cxx = os.path.join(llvm_bin, 'clang++')
common_flags += ' -target ' + llvm_triple + ' -integrated-as -gcc-toolchain ' + toolchain_path
+ common_flags += ' -fvisibility=hidden -fdata-sections -ffunction-sections'
+
self.ar = os.path.join(toolchain_bin, arch + '-ar')
self.ranlib = os.path.join(toolchain_bin, arch + '-ranlib')
self.nm = os.path.join(toolchain_bin, arch + '-nm')