Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1008)

Unified Diff: build/common.gypi

Issue 843103003: android: Hide JNI exports by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added gn support Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/android_webview_export_whitelist.lst ('k') | build/config/BUILDCONFIG.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index 3a071c8b760483be3aadd8302aa235efcd6d1f25..311569ab44a3fc69c20d9780ad5839975b210809 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1802,9 +1802,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,
@@ -2475,6 +2472,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
@@ -4594,10 +4599,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': [
« no previous file with comments | « build/android/android_webview_export_whitelist.lst ('k') | build/config/BUILDCONFIG.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698