Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index f363b660403e20d78772f4d0a90828752defd9bf..b09fd36e2846081a12f2c0f31b77af88190d99b5 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -3920,6 +3920,14 @@ |
['_type=="shared_library"', { |
'product_extension': '<(android_product_extension)', |
}], |
+ ['_toolset=="target" and component=="static_library" and _type=="shared_library"', { |
+ 'ldflags': [ |
+ # Only export symbols that are specified in version script. |
+ # TODO(ostap): Gyp doesn't corectly calculate path if <(DEPTH) is used here. |
+ # Use <(DEPTH) when gyp is fixed or replaced with gn. |
+ '-Wl,--version-script="../../build/android/android_exports.lst"', |
+ ], |
+ }], |
# Settings for building device targets using Android's toolchain. |
# These are based on the setup.mk file from the Android NDK. |
@@ -3984,8 +3992,7 @@ |
'ldflags': [ |
'-nostdlib', |
'-Wl,--no-undefined', |
- # Don't export symbols from statically linked libraries. |
- '-Wl,--exclude-libs=ALL', |
+ |
], |
'libraries': [ |
'-l<(android_stlport_library)', |
@@ -3996,11 +4003,6 @@ |
'-lm', |
], |
'conditions': [ |
- ['component=="shared_library"', { |
- 'ldflags!': [ |
- '-Wl,--exclude-libs=ALL', |
- ], |
- }], |
['clang==1', { |
'cflags': [ |
# Work around incompatibilities between bionic and clang |