OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import("//base/android/linker/config.gni") |
5 import("//build/config/android/rules.gni") | 6 import("//build/config/android/rules.gni") |
6 | 7 |
7 declare_args() { | 8 declare_args() { |
8 # Whether chrome_public_apk should use the crazy linker. | 9 # Whether chrome_public_apk should use the crazy linker. |
9 chrome_public_apk_use_chromium_linker = true | 10 chrome_public_apk_use_chromium_linker = chromium_linker_supported |
10 | 11 |
11 # Whether chrome_public_apk should use the relocation packer. | 12 # Whether chrome_public_apk should use the relocation packer. |
12 chrome_public_apk_use_relocation_packer = true | 13 # TODO: Enable packed relocations for x64. See: b/20532404 |
| 14 chrome_public_apk_use_relocation_packer = |
| 15 chromium_linker_supported && current_cpu != "x64" |
13 | 16 |
14 # Whether native libraries should be loaded from within the apk. | 17 # Whether native libraries should be loaded from within the apk. |
15 chrome_public_apk_load_library_from_apk = true | 18 # Only attempt loading the library from the APK for 64 bit devices |
| 19 # until the number of 32 bit devices which don't support this |
| 20 # approach falls to a minimal level - http://crbug.com/390618. |
| 21 chrome_public_apk_load_library_from_apk = |
| 22 chromium_linker_supported && |
| 23 (target_cpu == "arm64" || target_cpu == "x64") |
16 } | 24 } |
17 | 25 |
18 # GYP: //chrome/android/chrome_apk.gypi | 26 # GYP: //chrome/android/chrome_apk.gypi |
19 template("chrome_public_apk_tmpl") { | 27 template("chrome_public_apk_tmpl") { |
20 android_apk(target_name) { | 28 android_apk(target_name) { |
21 forward_variables_from(invoker, "*") | 29 forward_variables_from(invoker, "*") |
22 _native_lib_file = | 30 _native_lib_file = |
23 rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) | 31 rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) |
24 native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" | 32 native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" |
25 | 33 |
26 if (is_debug) { | 34 if (is_debug) { |
27 enable_multidex = true | 35 enable_multidex = true |
28 } else { | 36 } else { |
29 proguard_enabled = true | 37 proguard_enabled = true |
30 _prev_proguard_configs = [] | 38 _prev_proguard_configs = [] |
31 if (defined(proguard_configs)) { | 39 if (defined(proguard_configs)) { |
32 _prev_proguard_configs = proguard_configs | 40 _prev_proguard_configs = proguard_configs |
33 } | 41 } |
34 proguard_configs = [] | 42 proguard_configs = [] |
35 proguard_configs = | 43 proguard_configs = |
36 [ "//chrome/android/java/proguard.flags" ] + _prev_proguard_configs | 44 [ "//chrome/android/java/proguard.flags" ] + _prev_proguard_configs |
37 } | 45 } |
38 | 46 |
39 if (chromium_linker_supported) { | 47 if (!defined(use_chromium_linker)) { |
40 if (!defined(use_chromium_linker)) { | 48 use_chromium_linker = chrome_public_apk_use_chromium_linker |
41 use_chromium_linker = chrome_public_apk_use_chromium_linker | 49 } |
| 50 |
| 51 if (use_chromium_linker) { |
| 52 if (!defined(load_library_from_apk)) { |
| 53 load_library_from_apk = chrome_public_apk_load_library_from_apk |
42 } | 54 } |
43 | 55 |
44 # TODO: Enable packed relocations for x64. See: b/20532404 | 56 if (!defined(enable_relocation_packing)) { |
45 if (current_cpu != "x64") { | |
46 enable_relocation_packing = chrome_public_apk_use_relocation_packer | 57 enable_relocation_packing = chrome_public_apk_use_relocation_packer |
47 } | 58 } |
48 } | 59 } |
49 } | 60 } |
50 } | 61 } |
OLD | NEW |