Commit 1ae42edd authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Reland "Android: Fix secondary_abi_loadable_modules being ignored"

This reverts commit 9e256bdc.

Reason for reland: Fixed incremental_install=true error

> Original change's description:
> > Android: Fix secondary_abi_loadable_modules being ignored
> >
> > They worked in bundles, but not in apk targets.
> >
> > As identified in the linked bug, this was broken by:
> > e1dc23f1
> >
> > Verified contents of apks are same with & without this change:
> > * Monochrome.apk (with & without build_apk_secondary_abi)
> > * TrichromeChrome.aab
> > * TrichromeLibrary.apk
> > * SystemWebview.apk (with & without build_apk_secondary_abi)

TBR=agrieve  # reland

Bug: 1024862
Change-Id: I2ae7c6f4e1b70245a6320df54cd17ccef865909c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933631Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718664}
parent 8516369a
...@@ -51,6 +51,8 @@ template("system_webview_apk_tmpl") { ...@@ -51,6 +51,8 @@ template("system_webview_apk_tmpl") {
_use_trichrome_library = _use_trichrome_library =
defined(use_trichrome_library) && use_trichrome_library defined(use_trichrome_library) && use_trichrome_library
_is_64_bit_browser = defined(is_64_bit_browser) && is_64_bit_browser
assert(_is_64_bit_browser || !_is_64_bit_browser) # Mark used.
if (!_use_trichrome_library) { if (!_use_trichrome_library) {
deps += [ "//android_webview:monochrome_webview_assets" ] deps += [ "//android_webview:monochrome_webview_assets" ]
...@@ -58,44 +60,25 @@ template("system_webview_apk_tmpl") { ...@@ -58,44 +60,25 @@ template("system_webview_apk_tmpl") {
if (!_use_trichrome_library) { if (!_use_trichrome_library) {
shared_libraries = [ "//android_webview:libwebviewchromium" ] shared_libraries = [ "//android_webview:libwebviewchromium" ]
deps += [ shared_resources = true
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
]
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
if (build_apk_secondary_abi && android_64bit_target_cpu) { if (build_apk_secondary_abi && android_64bit_target_cpu) {
secondary_abi_shared_libraries = [ "//android_webview:libwebviewchromium($android_secondary_abi_toolchain)" ] secondary_abi_shared_libraries = [ "//android_webview:libwebviewchromium($android_secondary_abi_toolchain)" ]
_trampoline = "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline($android_secondary_abi_toolchain)"
deps += [ _trampoline ]
_secondary_out_dir = get_label_info(_trampoline, "root_out_dir")
secondary_abi_loadable_modules =
[ "$_secondary_out_dir/libcrashpad_handler_trampoline.so" ]
} }
shared_resources = true
} else { } else {
uncompress_shared_libraries = true uncompress_shared_libraries = true
app_as_shared_lib = true app_as_shared_lib = true
# Include placeholder libraries to ensure we are treated as the desired # Include placeholder libraries to ensure we are treated as the desired
# architecture. # architecture.
if (android_64bit_target_cpu) { if (android_64bit_target_cpu) {
if (defined(is_64_bit_browser) && is_64_bit_browser) { if (_is_64_bit_browser) {
native_lib_placeholders = [ "libdummy.so" ] native_lib_placeholders = [ "libdummy.so" ]
if (build_apk_secondary_abi) { if (build_apk_secondary_abi) {
secondary_abi_shared_libraries = [ "//android_webview:monochrome_64($android_secondary_abi_toolchain)" ] secondary_abi_shared_libraries = [ "//android_webview:monochrome_64($android_secondary_abi_toolchain)" ]
_trampoline = "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline($android_secondary_abi_toolchain)"
deps += [ _trampoline ]
_secondary_out_dir = get_label_info(_trampoline, "root_out_dir")
secondary_abi_loadable_modules =
[ "$_secondary_out_dir/libcrashpad_handler_trampoline.so" ]
deps += [ "//android_webview:v8_snapshot_secondary_abi_assets" ] deps += [ "//android_webview:v8_snapshot_secondary_abi_assets" ]
} }
} else { } else {
shared_libraries = [ "//android_webview:monochrome" ] shared_libraries = [ "//android_webview:monochrome" ]
deps += [ "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline" ]
loadable_modules =
[ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
if (build_apk_secondary_abi) { if (build_apk_secondary_abi) {
secondary_native_lib_placeholders = [ "libdummy.so" ] secondary_native_lib_placeholders = [ "libdummy.so" ]
if (use_v8_context_snapshot) { if (use_v8_context_snapshot) {
...@@ -106,17 +89,31 @@ template("system_webview_apk_tmpl") { ...@@ -106,17 +89,31 @@ template("system_webview_apk_tmpl") {
} }
} }
} }
} else if (defined(is_64_bit_browser) && is_64_bit_browser) { } else if (_is_64_bit_browser) {
shared_libraries = [ "//android_webview:monochrome_64" ] shared_libraries = [ "//android_webview:monochrome_64" ]
deps += [
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
]
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
} else { } else {
native_lib_placeholders = [ "libdummy.so" ] native_lib_placeholders = [ "libdummy.so" ]
} }
} }
if (!_use_trichrome_library ||
android_64bit_target_cpu != _is_64_bit_browser) {
deps += [
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
]
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
}
if (build_apk_secondary_abi && android_64bit_target_cpu) {
if (!_use_trichrome_library || _is_64_bit_browser) {
_trampoline = "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline($android_secondary_abi_toolchain)"
deps += [ _trampoline ]
_secondary_out_dir = get_label_info(_trampoline, "root_out_dir")
secondary_abi_loadable_modules =
[ "$_secondary_out_dir/libcrashpad_handler_trampoline.so" ]
}
}
if (!_use_trichrome_library || android_64bit_target_cpu) { if (!_use_trichrome_library || android_64bit_target_cpu) {
# 32-bit TrichromeWebView doesn't have a native library, so only do this # 32-bit TrichromeWebView doesn't have a native library, so only do this
# for other configs. # for other configs.
...@@ -163,7 +160,7 @@ template("system_webview_apk_tmpl") { ...@@ -163,7 +160,7 @@ template("system_webview_apk_tmpl") {
if (!defined(version_code)) { if (!defined(version_code)) {
if (_use_trichrome_library) { if (_use_trichrome_library) {
if (defined(is_64_bit_browser) && is_64_bit_browser) { if (_is_64_bit_browser) {
version_code = trichrome_64_32_version_code version_code = trichrome_64_32_version_code
} else { } else {
version_code = trichrome_version_code version_code = trichrome_version_code
......
...@@ -370,11 +370,14 @@ Empty if only a single ABI is supported. ...@@ -370,11 +370,14 @@ Empty if only a single ABI is supported.
A boolean indicating whether native libraries are stored uncompressed in the A boolean indicating whether native libraries are stored uncompressed in the
APK. APK.
* `native['extra_shared_libraries']` * `native['loadable_modules']`
A list of native libraries to store within the APK, in addition to those from A list of native libraries to store within the APK, in addition to those from
`native['libraries']`. These correspond to things like the Chromium linker `native['libraries']`. These correspond to things like the Chromium linker
or instrumentation libraries. or instrumentation libraries.
* `native['secondary_abi_loadable_modules']`
Secondary ABI version of loadable_modules
* `assets` * `assets`
A list of assets stored compressed in the APK. Each entry has the format A list of assets stored compressed in the APK. Each entry has the format
`<source-path>:<destination-path>`, where `<source-path>` is relative to `<source-path>:<destination-path>`, where `<source-path>` is relative to
...@@ -881,19 +884,21 @@ def main(argv): ...@@ -881,19 +884,21 @@ def main(argv):
parser.add_option('--shared-libraries-runtime-deps', parser.add_option('--shared-libraries-runtime-deps',
help='Path to file containing runtime deps for shared ' help='Path to file containing runtime deps for shared '
'libraries.') 'libraries.')
parser.add_option('--native-libs', parser.add_option(
action='append', '--loadable-modules',
help='GN-list of native libraries for primary ' action='append',
'android-abi. Can be specified multiple times.', help='GN-list of native libraries for primary '
default=[]) 'android-abi. Can be specified multiple times.',
default=[])
parser.add_option('--secondary-abi-shared-libraries-runtime-deps', parser.add_option('--secondary-abi-shared-libraries-runtime-deps',
help='Path to file containing runtime deps for secondary ' help='Path to file containing runtime deps for secondary '
'abi shared libraries.') 'abi shared libraries.')
parser.add_option('--secondary-native-libs', parser.add_option(
action='append', '--secondary-abi-loadable-modules',
help='GN-list of native libraries for secondary ' action='append',
'android-abi. Can be specified multiple times.', help='GN-list of native libraries for secondary '
default=[]) 'android-abi. Can be specified multiple times.',
default=[])
parser.add_option( parser.add_option(
'--native-lib-placeholders', '--native-lib-placeholders',
action='append', action='append',
...@@ -1669,16 +1674,15 @@ def main(argv): ...@@ -1669,16 +1674,15 @@ def main(argv):
options.secondary_abi_shared_libraries_runtime_deps) options.secondary_abi_shared_libraries_runtime_deps)
all_inputs.append(options.secondary_abi_shared_libraries_runtime_deps) all_inputs.append(options.secondary_abi_shared_libraries_runtime_deps)
secondary_abi_library_paths.extend(
build_utils.ParseGnList(options.secondary_native_libs))
native_library_placeholder_paths = build_utils.ParseGnList( native_library_placeholder_paths = build_utils.ParseGnList(
options.native_lib_placeholders) options.native_lib_placeholders)
secondary_native_library_placeholder_paths = build_utils.ParseGnList( secondary_native_library_placeholder_paths = build_utils.ParseGnList(
options.secondary_native_lib_placeholders) options.secondary_native_lib_placeholders)
extra_shared_libraries = build_utils.ParseGnList(options.native_libs) loadable_modules = build_utils.ParseGnList(options.loadable_modules)
secondary_abi_loadable_modules = build_utils.ParseGnList(
options.secondary_abi_loadable_modules)
config['native'] = { config['native'] = {
'libraries': 'libraries':
...@@ -1693,8 +1697,10 @@ def main(argv): ...@@ -1693,8 +1697,10 @@ def main(argv):
java_libraries_list, java_libraries_list,
'uncompress_shared_libraries': 'uncompress_shared_libraries':
options.uncompress_shared_libraries, options.uncompress_shared_libraries,
'extra_shared_libraries': 'loadable_modules':
extra_shared_libraries, loadable_modules,
'secondary_abi_loadable_modules':
secondary_abi_loadable_modules,
} }
config['assets'], config['uncompressed_assets'], locale_paks = ( config['assets'], config['uncompressed_assets'], locale_paks = (
_MergeAssets(deps.All('android_assets'))) _MergeAssets(deps.All('android_assets')))
......
...@@ -366,15 +366,10 @@ template("write_build_config") { ...@@ -366,15 +366,10 @@ template("write_build_config") {
args += [ "--is-base-module" ] args += [ "--is-base-module" ]
} }
if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) { if (defined(invoker.loadable_modules)) {
_rebased_modules = rebase_path(invoker.loadable_modules, root_build_dir) _rebased_loadable_modules =
args += [ "--native-libs=$_rebased_modules" ] rebase_path(invoker.loadable_modules, root_build_dir)
} args += [ "--loadable-modules=$_rebased_loadable_modules" ]
if (defined(invoker.extra_shared_libraries)) {
_rebased_extra_shared_libraries =
rebase_path(invoker.extra_shared_libraries, root_build_dir)
args += [ "--native-libs=$_rebased_extra_shared_libraries" ]
} }
if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) { if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) {
...@@ -390,9 +385,9 @@ template("write_build_config") { ...@@ -390,9 +385,9 @@ template("write_build_config") {
if (defined(invoker.secondary_abi_loadable_modules) && if (defined(invoker.secondary_abi_loadable_modules) &&
invoker.secondary_abi_loadable_modules != []) { invoker.secondary_abi_loadable_modules != []) {
_rebased_secondary_abi_modules = _rebased_secondary_abi_loadable_modules =
rebase_path(invoker.secondary_abi_loadable_modules, root_build_dir) rebase_path(invoker.secondary_abi_loadable_modules, root_build_dir)
args += [ "--secondary-native-libs=$_rebased_secondary_abi_modules" ] args += [ "--secondary-abi-loadable-modules=$_rebased_secondary_abi_loadable_modules" ]
} }
if (defined(invoker.native_lib_placeholders) && if (defined(invoker.native_lib_placeholders) &&
...@@ -2557,9 +2552,9 @@ if (enable_java_templates) { ...@@ -2557,9 +2552,9 @@ if (enable_java_templates) {
# (optional). # (optional).
# secondary_native_lib_placeholders: List of placeholder filenames to add to # secondary_native_lib_placeholders: List of placeholder filenames to add to
# the apk for the secondary ABI (optional). # the apk for the secondary ABI (optional).
# native_libs: List of native libraries. # loadable_modules: List of native libraries.
# native_libs_filearg: @FileArg() of additionally native libraries. # native_libs_filearg: @FileArg() of additionally native libraries.
# secondary_abi_native_libs: (optional) List of native libraries for # secondary_abi_loadable_modules: (optional) List of native libraries for
# secondary ABI. # secondary ABI.
# secondary_abi_native_libs_filearg: (optional). @FileArg() of additional # secondary_abi_native_libs_filearg: (optional). @FileArg() of additional
# secondary ABI native libs. # secondary ABI native libs.
...@@ -2594,12 +2589,12 @@ if (enable_java_templates) { ...@@ -2594,12 +2589,12 @@ if (enable_java_templates) {
"//tools/android/md5sum", "//tools/android/md5sum",
] # Used when deploying APKs ] # Used when deploying APKs
inputs = invoker.native_libs + [ inputs = [
invoker.keystore_path, invoker.keystore_path,
invoker.packaged_resources_path, invoker.packaged_resources_path,
_apksigner, _apksigner,
_zipalign, _zipalign,
] ]
outputs = [ outputs = [
invoker.output_apk_path, invoker.output_apk_path,
...@@ -2648,16 +2643,20 @@ if (enable_java_templates) { ...@@ -2648,16 +2643,20 @@ if (enable_java_templates) {
_rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir)
args += [ "--dex-file=$_rebased_dex_path" ] args += [ "--dex-file=$_rebased_dex_path" ]
} }
if (invoker.native_libs != [] || defined(invoker.native_libs_filearg) || if ((defined(invoker.loadable_modules) &&
invoker.loadable_modules != []) ||
defined(invoker.native_libs_filearg) ||
_native_lib_placeholders != []) { _native_lib_placeholders != []) {
args += [ "--android-abi=$android_app_abi" ] args += [ "--android-abi=$android_app_abi" ]
} }
if (defined(android_app_secondary_abi)) { if (defined(android_app_secondary_abi)) {
args += [ "--secondary-android-abi=$android_app_secondary_abi" ] args += [ "--secondary-android-abi=$android_app_secondary_abi" ]
} }
if (invoker.native_libs != []) { if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) {
_rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) inputs += invoker.loadable_modules
args += [ "--native-libs=$_rebased_native_libs" ] _rebased_loadable_modules =
rebase_path(invoker.loadable_modules, root_build_dir)
args += [ "--native-libs=$_rebased_loadable_modules" ]
} }
if (defined(invoker.native_libs_filearg)) { if (defined(invoker.native_libs_filearg)) {
args += [ "--native-libs=${invoker.native_libs_filearg}" ] args += [ "--native-libs=${invoker.native_libs_filearg}" ]
...@@ -2665,13 +2664,20 @@ if (enable_java_templates) { ...@@ -2665,13 +2664,20 @@ if (enable_java_templates) {
if (_native_lib_placeholders != []) { if (_native_lib_placeholders != []) {
args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] args += [ "--native-lib-placeholders=$_native_lib_placeholders" ]
} }
if (_secondary_native_lib_placeholders != []) {
args += [ "--secondary-native-lib-placeholders=$_secondary_native_lib_placeholders" ]
}
if (defined(invoker.secondary_abi_native_libs_filearg)) { if (defined(invoker.secondary_abi_native_libs_filearg)) {
args += [ "--secondary-native-libs=${invoker.secondary_abi_native_libs_filearg}" ] args += [ "--secondary-native-libs=${invoker.secondary_abi_native_libs_filearg}" ]
} }
if (defined(invoker.secondary_abi_loadable_modules)) {
_rebased_secondary_abi_loadable_modules =
rebase_path(invoker.secondary_abi_loadable_modules, root_build_dir)
args += [
"--secondary-native-libs=$_rebased_secondary_abi_loadable_modules",
]
}
if (_secondary_native_lib_placeholders != []) {
args += [ "--secondary-native-lib-placeholders=$_secondary_native_lib_placeholders" ]
}
if (defined(invoker.uncompress_shared_libraries) && if (defined(invoker.uncompress_shared_libraries) &&
invoker.uncompress_shared_libraries) { invoker.uncompress_shared_libraries) {
...@@ -3007,8 +3013,10 @@ if (enable_java_templates) { ...@@ -3007,8 +3013,10 @@ if (enable_java_templates) {
# secondary_abi_shared_libraries_runtime_deps_file: # secondary_abi_shared_libraries_runtime_deps_file:
# secondary_native_lib_placeholders: Optional. List of placeholder filenames # secondary_native_lib_placeholders: Optional. List of placeholder filenames
# to add to the APK for the secondary ABI. # to add to the APK for the secondary ABI.
# extra_shared_libraries: Optional list of extra native libraries to # loadable_modules: Optional list of extra native libraries to
# be stored in the APK. # be stored in the APK.
# secondary_abi_loadable_modules: Optional list of native libraries for
# secondary ABI.
# uncompress_shared_libraries: Optional. True to store native shared # uncompress_shared_libraries: Optional. True to store native shared
# libraries uncompressed and page-aligned. # libraries uncompressed and page-aligned.
# proto_resources_path: The path of an zip archive containing the APK's # proto_resources_path: The path of an zip archive containing the APK's
...@@ -3214,13 +3222,11 @@ if (enable_java_templates) { ...@@ -3214,13 +3222,11 @@ if (enable_java_templates) {
"base_whitelist_rtxt_path", "base_whitelist_rtxt_path",
"gradle_treat_as_prebuilt", "gradle_treat_as_prebuilt",
"input_jars_paths", "input_jars_paths",
"loadable_modules",
"main_class", "main_class",
"proguard_configs", "proguard_configs",
"proguard_enabled", "proguard_enabled",
"proguard_mapping_path", "proguard_mapping_path",
"r_text_path", "r_text_path",
"secondary_abi_loadable_modules",
"type", "type",
]) ])
if (type == "android_apk" || type == "android_app_bundle_module") { if (type == "android_apk" || type == "android_app_bundle_module") {
...@@ -3229,10 +3235,11 @@ if (enable_java_templates) { ...@@ -3229,10 +3235,11 @@ if (enable_java_templates) {
[ [
"android_manifest", "android_manifest",
"android_manifest_dep", "android_manifest_dep",
"extra_shared_libraries",
"final_dex_path", "final_dex_path",
"loadable_modules",
"native_lib_placeholders", "native_lib_placeholders",
"res_size_info_path", "res_size_info_path",
"secondary_abi_loadable_modules",
"secondary_abi_shared_libraries_runtime_deps_file", "secondary_abi_shared_libraries_runtime_deps_file",
"secondary_native_lib_placeholders", "secondary_native_lib_placeholders",
"shared_libraries_runtime_deps_file", "shared_libraries_runtime_deps_file",
......
...@@ -2313,11 +2313,6 @@ if (enable_java_templates) { ...@@ -2313,11 +2313,6 @@ if (enable_java_templates) {
_native_libs_deps = [] _native_libs_deps = []
_shared_libraries_is_valid = _shared_libraries_is_valid =
defined(invoker.shared_libraries) && invoker.shared_libraries != [] defined(invoker.shared_libraries) && invoker.shared_libraries != []
_secondary_abi_native_libs_deps = []
assert(_secondary_abi_native_libs_deps == []) # mark as used.
_secondary_abi_shared_libraries_is_valid =
defined(invoker.secondary_abi_shared_libraries) &&
invoker.secondary_abi_shared_libraries != []
if (_shared_libraries_is_valid) { if (_shared_libraries_is_valid) {
_native_libs_deps += invoker.shared_libraries _native_libs_deps += invoker.shared_libraries
...@@ -2341,8 +2336,12 @@ if (enable_java_templates) { ...@@ -2341,8 +2336,12 @@ if (enable_java_templates) {
} }
} }
if (_secondary_abi_shared_libraries_is_valid) { _secondary_abi_native_libs_deps = []
_secondary_abi_native_libs_deps += invoker.secondary_abi_shared_libraries assert(_secondary_abi_native_libs_deps == []) # mark as used.
if (defined(invoker.secondary_abi_shared_libraries) &&
invoker.secondary_abi_shared_libraries != []) {
_secondary_abi_native_libs_deps = invoker.secondary_abi_shared_libraries
# Write shared library output files of all dependencies to a file. Those # Write shared library output files of all dependencies to a file. Those
# will be the shared libraries packaged into the APK. # will be the shared libraries packaged into the APK.
...@@ -2721,15 +2720,18 @@ if (enable_java_templates) { ...@@ -2721,15 +2720,18 @@ if (enable_java_templates) {
} }
} }
_extra_native_libs = [] _loadable_modules = []
_extra_native_libs_deps = [] if (defined(invoker.loadable_modules)) {
assert(_extra_native_libs_deps == []) # Mark as used. _loadable_modules = invoker.loadable_modules
}
_loadable_modules_deps = []
if (_native_libs_deps != []) { if (_native_libs_deps != []) {
_extra_native_libs += _sanitizer_runtimes _loadable_modules += _sanitizer_runtimes
if (_use_chromium_linker) { if (_use_chromium_linker) {
_extra_native_libs += _loadable_modules +=
[ "$root_out_dir/libchromium_android_linker$shlib_extension" ] [ "$root_out_dir/libchromium_android_linker$shlib_extension" ]
_extra_native_libs_deps += _loadable_modules_deps +=
[ "//base/android/linker:chromium_android_linker" ] [ "//base/android/linker:chromium_android_linker" ]
} }
} }
...@@ -2820,7 +2822,6 @@ if (enable_java_templates) { ...@@ -2820,7 +2822,6 @@ if (enable_java_templates) {
"jacoco_never_instrument", "jacoco_never_instrument",
"java_files", "java_files",
"javac_args", "javac_args",
"loadable_modules",
"manifest_package", "manifest_package",
"native_lib_placeholders", "native_lib_placeholders",
"no_build_hooks", "no_build_hooks",
...@@ -2897,12 +2898,12 @@ if (enable_java_templates) { ...@@ -2897,12 +2898,12 @@ if (enable_java_templates) {
if (_native_libs_deps != []) { if (_native_libs_deps != []) {
shared_libraries_runtime_deps_file = _shared_library_list_file shared_libraries_runtime_deps_file = _shared_library_list_file
} }
if (_secondary_abi_native_libs_deps != []) { if (defined(_secondary_abi_shared_library_list_file)) {
secondary_abi_shared_libraries_runtime_deps_file = secondary_abi_shared_libraries_runtime_deps_file =
_secondary_abi_shared_library_list_file _secondary_abi_shared_library_list_file
} }
extra_shared_libraries = _extra_native_libs loadable_modules = _loadable_modules
uncompress_shared_libraries = _uncompress_shared_libraries uncompress_shared_libraries = _uncompress_shared_libraries
...@@ -3111,8 +3112,6 @@ if (enable_java_templates) { ...@@ -3111,8 +3112,6 @@ if (enable_java_templates) {
} }
} }
_loadable_modules = []
assert(_loadable_modules == []) # Mark as used.
if (_native_libs_deps != []) { if (_native_libs_deps != []) {
_create_stack_script_rule_name = "${_template_name}__stack_script" _create_stack_script_rule_name = "${_template_name}__stack_script"
_final_deps += [ ":${_create_stack_script_rule_name}" ] _final_deps += [ ":${_create_stack_script_rule_name}" ]
...@@ -3122,11 +3121,7 @@ if (enable_java_templates) { ...@@ -3122,11 +3121,7 @@ if (enable_java_templates) {
} }
} }
if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) { _all_native_libs_deps = _native_libs_deps + _loadable_modules_deps +
_loadable_modules += invoker.loadable_modules
}
_all_native_libs_deps = _native_libs_deps + _extra_native_libs_deps +
_secondary_abi_native_libs_deps _secondary_abi_native_libs_deps
if (_all_native_libs_deps != []) { if (_all_native_libs_deps != []) {
_native_libs_file_arg_dep = ":$_build_config_target" _native_libs_file_arg_dep = ":$_build_config_target"
...@@ -3223,6 +3218,7 @@ if (enable_java_templates) { ...@@ -3223,6 +3218,7 @@ if (enable_java_templates) {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"native_lib_placeholders", "native_lib_placeholders",
"secondary_abi_loadable_modules",
"secondary_native_lib_placeholders", "secondary_native_lib_placeholders",
"uncompress_dex", "uncompress_dex",
"uncompress_shared_libraries", "uncompress_shared_libraries",
...@@ -3234,7 +3230,6 @@ if (enable_java_templates) { ...@@ -3234,7 +3230,6 @@ if (enable_java_templates) {
keystore_password = _keystore_password keystore_password = _keystore_password
uncompress_shared_libraries = _uncompress_shared_libraries uncompress_shared_libraries = _uncompress_shared_libraries
native_libs = _loadable_modules
deps = _deps + [ ":$_build_config_target" ] deps = _deps + [ ":$_build_config_target" ]
if (_incremental_apk) { if (_incremental_apk) {
...@@ -3249,16 +3244,18 @@ if (enable_java_templates) { ...@@ -3249,16 +3244,18 @@ if (enable_java_templates) {
dex_path = dex_path =
get_label_info(_dex_target, "target_out_dir") + "/bootstrap.dex" get_label_info(_dex_target, "target_out_dir") + "/bootstrap.dex"
# http://crbug.com/384638 # All native libraries are side-loaded, so use a placeholder to force
# the proper bitness for the app.
_has_native_libs = _has_native_libs =
defined(invoker.native_libs_filearg) || _extra_native_libs != [] defined(invoker.native_libs_filearg) || _loadable_modules != []
if (_has_native_libs && _loadable_modules == []) { if (_has_native_libs) {
native_lib_placeholders = [ "libfix.crbug.384638.so" ] native_lib_placeholders = [ "libfix.crbug.384638.so" ]
} }
packaged_resources_path = _incremental_compiled_resources_path packaged_resources_path = _incremental_compiled_resources_path
output_apk_path = _incremental_apk_path output_apk_path = _incremental_apk_path
} else { } else {
loadable_modules = _loadable_modules
deps += _all_native_libs_deps + [ deps += _all_native_libs_deps + [
":$_merge_manifest_target", ":$_merge_manifest_target",
":$_compile_resources_target", ":$_compile_resources_target",
...@@ -3269,7 +3266,6 @@ if (enable_java_templates) { ...@@ -3269,7 +3266,6 @@ if (enable_java_templates) {
deps += [ _final_dex_target_dep ] deps += [ _final_dex_target_dep ]
} }
native_libs += _extra_native_libs
if (_optimize_resources) { if (_optimize_resources) {
packaged_resources_path = _optimized_arsc_resources_path packaged_resources_path = _optimized_arsc_resources_path
} else { } else {
...@@ -3317,10 +3313,10 @@ if (enable_java_templates) { ...@@ -3317,10 +3313,10 @@ if (enable_java_templates) {
args += [ "--native-libs=$_native_libs_file_arg" ] args += [ "--native-libs=$_native_libs_file_arg" ]
deps += [ _native_libs_file_arg_dep ] deps += [ _native_libs_file_arg_dep ]
} }
if (_extra_native_libs != []) { if (_loadable_modules != []) {
_rebased_extra_native_libs = _rebased_loadable_modules =
rebase_path(_extra_native_libs, root_build_dir) rebase_path(_loadable_modules, root_build_dir)
args += [ "--native-libs=$_rebased_extra_native_libs" ] args += [ "--native-libs=$_rebased_loadable_modules" ]
} }
if (_load_library_from_apk) { if (_load_library_from_apk) {
args += [ "--dont-even-try=Incremental builds do not work with load_library_from_apk. Try setting is_component_build=true in your GN args." ] args += [ "--dont-even-try=Incremental builds do not work with load_library_from_apk. Try setting is_component_build=true in your GN args." ]
...@@ -3401,7 +3397,7 @@ if (enable_java_templates) { ...@@ -3401,7 +3397,7 @@ if (enable_java_templates) {
# device/commands is used by the installer script to push files via .zip. # device/commands is used by the installer script to push files via .zip.
data_deps += [ "//build/android/pylib/device/commands" ] + data_deps += [ "//build/android/pylib/device/commands" ] +
_native_libs_deps + _extra_native_libs_deps _native_libs_deps + _loadable_modules_deps
} }
} }
} }
...@@ -4583,7 +4579,7 @@ if (enable_java_templates) { ...@@ -4583,7 +4579,7 @@ if (enable_java_templates) {
modules = _modules modules = _modules
native_libraries_filearg_keys = [ native_libraries_filearg_keys = [
"native:libraries", "native:libraries",
"native:extra_shared_libraries", "native:loadable_modules",
] ]
output = _native_libraries_config output = _native_libraries_config
if (_uses_static_library) { if (_uses_static_library) {
...@@ -4596,7 +4592,10 @@ if (enable_java_templates) { ...@@ -4596,7 +4592,10 @@ if (enable_java_templates) {
allot_native_libraries( allot_native_libraries(
"${_target_name}__allot_secondary_abi_native_libraries") { "${_target_name}__allot_secondary_abi_native_libraries") {
modules = _modules modules = _modules
native_libraries_filearg_keys = [ "native:secondary_abi_libraries" ] native_libraries_filearg_keys = [
"native:secondary_abi_libraries",
"native:secondary_abi_loadable_modules",
]
output = _secondary_abi_native_libraries_config output = _secondary_abi_native_libraries_config
if (_uses_static_library) { if (_uses_static_library) {
modules += [ _lib_proxy_module ] modules += [ _lib_proxy_module ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment