Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index c242572c8c125f366fbed752f65d007f94c8f7ee..97ed899db8b7b87b58c86f996fc825a5a704aa7b 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -1798,9 +1798,6 @@ |
# Copy it out one scope. |
'android_webview_build%': '<(android_webview_build)', |
- |
- # Default android linker script for shared library exports. |
- 'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst', |
}], # OS=="android" |
['embedded==1', { |
'use_system_fontconfig%': 0, |
@@ -2473,6 +2470,14 @@ |
'-Wno-unnamed-type-template-args', |
], |
+ # By default, Android targets have their exported JNI symbols stripped, |
+ # so we test the manual JNI registration code paths that are required |
+ # when using the crazy linker. To allow use of native JNI exports (lazily |
+ # resolved by the JVM), targets can enable this variable, which will stop |
+ # the stripping from happening. Only targets which do not need to be |
+ # compatible with the crazy linker are permitted to set this. |
+ 'use_native_jni_exports%': 0, |
+ |
'conditions': [ |
['OS=="win" and component=="shared_library"', { |
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx |
@@ -4573,10 +4578,19 @@ |
'-Wl,--no-undefined', |
], |
'conditions': [ |
- ['component=="static_library"', { |
+ ['component=="static_library" and android_webview_build==0', { |
'ldflags': [ |
'-Wl,--exclude-libs=ALL', |
], |
+ 'target_conditions': [ |
+ ['use_native_jni_exports==0', { |
+ # Use a linker version script to strip JNI exports from |
+ # binaries which have not specifically asked to use them. |
+ 'ldflags': [ |
+ '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst', |
+ ], |
+ }], |
+ ], |
}], |
['clang==1', { |
'cflags': [ |
@@ -4635,6 +4649,22 @@ |
'ldflags': [ |
'--sysroot=<(android_ndk_sysroot)', |
'-nostdlib', |
+ # Don't allow visible symbols from libgcc or stlport to be |
+ # re-exported. |
+ '-Wl,--exclude-libs=libgcc.a', |
+ '-Wl,--exclude-libs=libstlport_static.a', |
+ # Don't allow visible symbols from libraries that contain |
+ # assembly code with symbols that aren't hidden properly. |
+ # http://crbug.com/448386 |
+ '-Wl,--exclude-libs=libcommon_audio.a', |
+ '-Wl,--exclude-libs=libcommon_audio_neon.a', |
+ '-Wl,--exclude-libs=libcommon_audio_sse2.a', |
+ '-Wl,--exclude-libs=libiSACFix.a', |
+ '-Wl,--exclude-libs=libisac_neon.a', |
+ '-Wl,--exclude-libs=libopenmax_dl.a', |
+ '-Wl,--exclude-libs=libopenmax_dl_armv7.a', |
+ '-Wl,--exclude-libs=libopus.a', |
+ '-Wl,--exclude-libs=libvpx.a', |
], |
'libraries': [ |
'-l<(android_stlport_library)', |