diff options
author | pkotwicz <pkotwicz@chromium.org> | 2015-11-04 10:39:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-04 18:40:44 +0000 |
commit | 6fa48576c7dd5b457307f9b1afa8a774d2fb0d56 (patch) | |
tree | fe522a653482bf3dd207c38b503a363bd65c2e1a /chrome/android | |
parent | 53ebb8d1754501ccc03f07c03a0e24ee227f7b2b (diff) | |
download | chromium_src-6fa48576c7dd5b457307f9b1afa8a774d2fb0d56.zip chromium_src-6fa48576c7dd5b457307f9b1afa8a774d2fb0d56.tar.gz chromium_src-6fa48576c7dd5b457307f9b1afa8a774d2fb0d56.tar.bz2 |
Port load_library_from_zip logic for chrome_public_apk from GYP to GN
This CL:
- Ports load_library_from_zip logic for chrome_public_apk from GYP to GN
- Makes the load_library_from_zip logic dependent on whether the
chromium linker is used for simplicity.
load_library_from_zip == 1 is only supported if use_chromium_linker == 1. See:
base/android/java/templates/NativeLibraries.template
- Removes useless 'load_library_from_zip_file'
BUG=535389
Review URL: https://codereview.chromium.org/1429613003
Cr-Commit-Position: refs/heads/master@{#357855}
Diffstat (limited to 'chrome/android')
-rw-r--r-- | chrome/android/BUILD.gn | 8 | ||||
-rw-r--r-- | chrome/android/chrome_apk.gyp | 10 | ||||
-rw-r--r-- | chrome/android/chrome_apk.gypi | 29 |
3 files changed, 24 insertions, 23 deletions
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 47f28f3..f2a91a2 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -423,6 +423,14 @@ chrome_public_apk_tmpl("chrome_public_apk") { native_libs = [ "$root_build_dir/lib.stripped/libchrome_public.so" ] native_lib_version_rule = "//build/util:chrome_version_json" + # Only attempt loading the library from the APK for 64 bit devices + # until the number of 32 bit devices which don't support this + # approach falls to a minimal level - http://crbug.com/390618. + if (chromium_linker_supported && + (target_cpu == "arm64" || target_cpu == "x64")) { + load_library_from_apk = true + } + deps = [ ":chrome_java", ":chrome_public", diff --git a/chrome/android/chrome_apk.gyp b/chrome/android/chrome_apk.gyp index e1cf10c..e92491d 100644 --- a/chrome/android/chrome_apk.gyp +++ b/chrome/android/chrome_apk.gyp @@ -204,9 +204,8 @@ # Only attempt loading the library from the APK for 64 bit devices # until the number of 32 bit devices which don't support this # approach falls to a minimal level - http://crbug.com/390618. - ['component != "shared_library" and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', { - 'load_library_from_zip_file': '<(chrome_apk_load_library_from_zip)', - 'load_library_from_zip': '<(chrome_apk_load_library_from_zip)', + ['chrome_apk_use_chromium_linker==1 and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', { + 'load_library_from_zip': 1, }], ], }, @@ -243,9 +242,8 @@ # Only attempt loading the library from the APK for 64 bit devices # until the number of 32 bit devices which don't support this # approach falls to a minimal level - http://crbug.com/390618. - ['component != "shared_library" and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', { - 'load_library_from_zip_file': '<(chrome_apk_load_library_from_zip)', - 'load_library_from_zip': '<(chrome_apk_load_library_from_zip)', + ['chrome_apk_use_chromium_linker==1 and profiling==0 and (target_arch == "arm64" or target_arch == "x86_64")', { + 'load_library_from_zip': 1, }], ], }, diff --git a/chrome/android/chrome_apk.gypi b/chrome/android/chrome_apk.gypi index feee8a2..e21863f 100644 --- a/chrome/android/chrome_apk.gypi +++ b/chrome/android/chrome_apk.gypi @@ -7,9 +7,10 @@ 'native_lib_placeholders_file%': '', 'chrome_apk_use_relocation_packer%': 1, 'conditions': [ - # Use the chromium linker unless cygprofile instrumentation is active. + # Chromium linker crashes on component builds on Android 4.4. See + # b/11379966 # Chromium linker causes instrumentation to return incorrect results. - ['order_profiling == 0', { + ['android_must_copy_system_libraries == 0 and order_profiling == 0', { 'chrome_apk_use_chromium_linker%': 1, 'chrome_apk_load_library_from_zip%': 1, }, { @@ -24,22 +25,16 @@ 'proguard_enabled': 'true', 'proguard_flags_paths': ['<(DEPTH)/chrome/android/java/proguard.flags'], 'additional_input_paths' : ['<@(chrome_android_pak_output_resources)'], + 'use_chromium_linker': '<(chrome_apk_use_chromium_linker)', 'conditions': [ - ['android_must_copy_system_libraries == 0', { - # Only enable the chromium linker on regular builds, since the - # component build crashes on Android 4.4. See b/11379966 - 'use_chromium_linker': '<(chrome_apk_use_chromium_linker)', - 'conditions': [ - ['"<(native_lib_placeholders_file)" != ""', { - 'native_lib_placeholders': ['<!@(cat <(native_lib_placeholders_file))'], - }], - # Pack relocations where the chromium linker is enabled. Packing is - # a no-op if this is not a Release build. - # TODO: Enable packed relocations for x64. See: b/20532404 - ['chrome_apk_use_chromium_linker == 1 and target_arch != "x64"', { - 'use_relocation_packer': '<(chrome_apk_use_relocation_packer)', - }], - ], + ['android_must_copy_system_libraries == 0 and "<(native_lib_placeholders_file)" != ""', { + 'native_lib_placeholders': ['<!@(cat <(native_lib_placeholders_file))'], + }], + # Pack relocations where the chromium linker is enabled. Packing is a + # no-op if this is not a Release build. + # TODO: Enable packed relocations for x64. See: b/20532404 + ['chrome_apk_use_chromium_linker == 1 and target_arch != "x64"', { + 'use_relocation_packer': '<(chrome_apk_use_relocation_packer)', }], ], 'run_findbugs': 0, |