Commit 200a953f authored by Siddhartha's avatar Siddhartha Committed by Commit Bot

Make sure unwind tables are added for 32 bit libraries in arm64 monochrome

The assets were not added since we checked "can_unwind_with_cfi_table"
value, which depends on "build_secondary_abi" build arg. So, explicitly
add the asset for 64-bit monochrome apk, which contains 32 bit library.

BUG=924842

Change-Id: I6488d5c4e5a80787735c5b09134b013a87b5c553
Reviewed-on: https://chromium-review.googlesource.com/c/1432836
Commit-Queue: ssid <ssid@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625789}
parent eedb2069
......@@ -14,18 +14,24 @@ template("unwind_table_asset") {
testonly = invoker.testonly
}
_root_dir = "$root_out_dir"
if (build_apk_secondary_abi && defined(android_secondary_abi_cpu)) {
_root_dir = get_label_info(":foo($android_secondary_abi_toolchain)",
"root_out_dir")
}
script = "//build/android/gyp/extract_unwind_tables.py"
outputs = [
_asset_path,
]
inputs = [
"$root_out_dir/lib.unstripped/$shlib_prefix${invoker.library_target}$shlib_extension",
"${_root_dir}/lib.unstripped/$shlib_prefix${invoker.library_target}$shlib_extension",
]
args = [
"--input_path",
rebase_path(
"$root_out_dir/lib.unstripped/$shlib_prefix${invoker.library_target}$shlib_extension",
"${_root_dir}/lib.unstripped/$shlib_prefix${invoker.library_target}$shlib_extension",
root_build_dir),
"--output_path",
rebase_path(_asset_path, root_build_dir),
......
......@@ -1407,8 +1407,9 @@ static_library("browser_test_support") {
# Unwind tables are added to only official builds (public_apk(s)) so that
# developer builds are not affected.
_add_unwind_tables_in_chrome_public_apk =
can_unwind_with_cfi_table && is_official_build
_add_unwind_tables_in_chrome_32bit_apk =
is_android && !is_component_build && is_official_build &&
(target_cpu == "arm" || target_cpu == "arm64")
# Defines a target that derives from the chrome public application. This
# can be either an APK or an app bundle module. This supports both the
......@@ -1462,8 +1463,9 @@ template("chrome_public_apk_or_module_tmpl") {
}
shared_libraries = [ ":libchrome${_suffix}" ]
add_unwind_tables_in_apk = _add_unwind_tables_in_chrome_public_apk
if (_add_unwind_tables_in_chrome_public_apk) {
add_unwind_tables_in_apk =
_add_unwind_tables_in_chrome_32bit_apk && target_cpu == "arm"
if (add_unwind_tables_in_apk) {
shared_library_for_unwind_asset = "chrome${_suffix}"
}
......@@ -1575,8 +1577,10 @@ template("monochrome_public_apk_or_module_tmpl") {
"//chrome/android:chrome_java",
]
_needs_arm32_lib = target_cpu == "arm" ||
(target_cpu == "arm64" && build_apk_secondary_abi)
add_unwind_tables_in_apk =
_add_unwind_tables_in_chrome_public_apk &&
_add_unwind_tables_in_chrome_32bit_apk && _needs_arm32_lib &&
(!defined(use_trichrome_library) || !use_trichrome_library)
version_name = chrome_version_name
......@@ -1684,8 +1688,9 @@ template("chrome_test_apk_tmpl") {
testonly = true
target_type = "instrumentation_test_apk"
add_unwind_tables_in_apk = _add_unwind_tables_in_chrome_public_apk
if (_add_unwind_tables_in_chrome_public_apk) {
add_unwind_tables_in_apk =
_add_unwind_tables_in_chrome_32bit_apk && target_cpu == "arm"
if (add_unwind_tables_in_apk) {
shared_library_for_unwind_asset = "chromefortest"
}
......
......@@ -96,6 +96,9 @@ template("chrome_public_common_apk_or_module_tmpl") {
library_target = invoker.shared_library_for_unwind_asset
deps = invoker.shared_libraries
if (defined(invoker.secondary_abi_shared_libraries)) {
deps += invoker.secondary_abi_shared_libraries
}
}
}
......
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