Index: build/java_apk.gypi |
diff --git a/build/java_apk.gypi b/build/java_apk.gypi |
index 4ee901482267b860b13dd7dc9f08ae1e636230f4..13585dad680b8a46ebb0b9f3ec3ee27d5ac365ac 100644 |
--- a/build/java_apk.gypi |
+++ b/build/java_apk.gypi |
@@ -48,6 +48,8 @@ |
# strings.xml files, if any. |
# library_manifest_paths'- Paths to additional AndroidManifest.xml files from |
# libraries. |
+# use_chrome_linker - Enable the chrome dynamic linker that allows sharing the |
+# RELRO section of the native libraries between the different processes. |
{ |
'variables': { |
@@ -116,6 +118,7 @@ |
'variables': { |
'variables': { |
'native_lib_target%': '', |
+ 'use_chrome_linker%': 0, |
}, |
'conditions': [ |
['gyp_managed_install == 1 and native_lib_target != ""', { |
@@ -131,6 +134,7 @@ |
], |
}, |
'native_lib_target%': '', |
+ 'use_chrome_linker%': 0, |
'emma_instrument': '<(emma_coverage)', |
'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
@@ -163,6 +167,11 @@ |
'<(DEPTH)/build/android/setup.gyp:copy_system_libraries', |
], |
}], |
+ ['use_chrome_linker == 1', { |
+ 'dependencies': [ |
+ '<(DEPTH)/content/content.gyp:content_android_linker', |
+ ], |
+ }], |
['native_lib_target != ""', { |
'variables': { |
'compile_input_paths': [ '<(native_libraries_java_stamp)' ], |
@@ -188,7 +197,23 @@ |
'actions': [ |
{ |
'variables': { |
- 'input_libraries': ['<@(native_libs_paths)'], |
+ 'conditions': [ |
+ ['use_chrome_linker == 1', { |
+ 'variables': { |
+ 'linker_input_libraries': [ |
+ '<(PRODUCT_DIR)/lib/libcontent_android_linker.>(android_product_extension)', |
+ ], |
+ } |
+ }, { |
+ 'variables': { |
+ 'linker_input_libraries': [], |
+ }, |
+ }], |
+ ], |
+ 'input_libraries': [ |
+ '<@(native_libs_paths)', |
+ '<@(linker_input_libraries)', |
+ ], |
}, |
'includes': ['../build/android/write_ordered_libraries.gypi'], |
}, |
@@ -212,6 +237,24 @@ |
}, |
{ |
'action_name': 'native_libraries_<(_target_name)', |
+ 'variables': { |
+ 'conditions': [ |
+ ['use_chrome_linker == 1', { |
+ 'variables': { |
+ 'additional_gcc_preprocess_defines': [ |
+ '-D', 'ENABLE_CHROME_LINKER', |
+ ], |
+ } |
+ }, { |
+ 'variables': { |
+ 'additional_gcc_preprocess_defines': [], |
+ }, |
+ }], |
+ ], |
+ 'gcc_preprocess_defines': [ |
+ '<@(additional_gcc_preprocess_defines)', |
+ ], |
+ }, |
'message': 'Creating NativeLibraries.java for <(_target_name).', |
'inputs': [ |
'<(DEPTH)/build/android/gyp/util/build_utils.py', |
@@ -228,6 +271,7 @@ |
'--output=<(native_libraries_java_file)', |
'--template=<(native_libraries_template)', |
'--stamp=<(native_libraries_java_stamp)', |
+ '<@(gcc_preprocess_defines)', |
], |
}, |
{ |