Commit e61ad0df authored by Fabrice de Gans-Riberi's avatar Fabrice de Gans-Riberi Committed by Commit Bot

Revert "Add a flag for building HWASAN splits."

This reverts commit 27453d76.

Reason for revert: Suspected cause for build failure:
https://ci.chromium.org/p/chromium/builders/ci/chromeos-amd64-generic-asan-rel/23333

Original change's description:
> Add a flag for building HWASAN splits.
> 
> The new build_hwasan_splits flag causes HWASAN splits to be created for
> the Monochrome6432 and TrichromeChrome6432 bundles, as well as any of its
> DFMs that contain native code. The intent is that this flag will eventually
> default to true in official builds.
> 
> The library is deliberately installed in TrichromeChrome6432 rather than
> TrichromeLibrary6432 (where the regular native library lives) because the
> Android platform does not support splits for the library containing the
> WebView implementation. This means that only Chrome will use the HWASANified
> native library, and WebView will use the regular native library.
> 
> Bug: 916828
> Change-Id: Ie92bb36e83df245ab431b0123a44b0f0a3182100
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769731
> Commit-Queue: Peter Collingbourne <pcc@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#729945}

TBR=torne@chromium.org,cjgrant@chromium.org,pcc@chromium.org,agrieve@chromium.org

Change-Id: Ic8ee9206385f27941f1fa12e7927376c673e4149
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 916828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993747Reviewed-by: default avatarFabrice de Gans-Riberi <fdegans@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729966}
parent 3106d6b7
......@@ -238,11 +238,7 @@ def _AddNativeLibraries(out_apk, native_libs, android_abi, uncompress,
if has_crazy_linker and not has_monochrome:
basename = 'crazy.' + basename
lib_android_abi = android_abi
if path.startswith('android_clang_arm64_hwasan/'):
lib_android_abi = 'arm64-v8a-hwasan'
apk_path = 'lib/%s/%s' % (lib_android_abi, basename)
apk_path = 'lib/%s/%s' % (android_abi, basename)
zipalign.AddToZipHermetic(
out_apk,
apk_path,
......
......@@ -789,8 +789,7 @@ def _CreateJavaLibrariesList(library_paths):
"""Returns a java literal array with the "base" library names:
e.g. libfoo.so -> foo
"""
names = ['"%s"' % os.path.basename(s)[3:-3] for s in library_paths]
return ('{%s}' % ','.join(sorted(set(names))))
return ('{%s}' % ','.join(['"%s"' % s[3:-3] for s in library_paths]))
def _CreateJavaLocaleListFromAssets(assets, locale_paks):
......
......@@ -26,9 +26,6 @@ declare_args() {
# Only effective if use_order_profiling = true. When this is true the call
# graph based instrumentation is used.
use_call_graph = false
# Build additional browser splits with HWASAN instrumentation enabled.
build_hwasan_splits = false
}
assert(!devtools_instrumentation_dumping || use_order_profiling,
......
......@@ -285,3 +285,15 @@ assert(ignore_elf32_limitations || !is_android || target_os == "chromeos" ||
"due to 4GiB file size limit, see https://crbug.com/648948. " +
"If you really want to try this out, " +
"set ignore_elf32_limitations=true.")
# This variable is true if the current toolchain is either the default
# toolchain, or, on Android, the secondary ABI toolchain. In other words, it's
# a toolchain that generates targets for the product, as opposed to the host
# OS. It can be used in situations where we wish to avoid doing work on the
# host toolchain, but we don't want to break Android's secondary ABI.
# Ie. "current_toolchain == default_toolchain" is not a good way to infer
# "not the host toolchain".
is_a_target_toolchain =
current_toolchain == default_toolchain ||
(is_android && defined(android_secondary_abi_toolchain) &&
current_toolchain == android_secondary_abi_toolchain)
......@@ -273,11 +273,7 @@ config("common_sanitizer_flags") {
if (using_sanitizer) {
assert(is_clang, "sanitizers only supported with clang")
# Allow non-default toolchains to enable sanitizers in toolchain_args even
# in official builds.
assert(current_toolchain != default_toolchain || !is_official_build,
"sanitizers not supported in official builds")
assert(!is_official_build, "sanitizers not supported in official builds")
cflags += [
# Column info in debug data confuses Visual Studio's debugger, so don't
......
......@@ -113,8 +113,8 @@ declare_args() {
archive_seed_corpus = true
}
# Disable sanitizers for non-target toolchains.
if (!is_a_target_toolchain) {
# Disable sanitizers for non-default toolchains.
if (current_toolchain != default_toolchain) {
is_asan = false
is_cfi = false
is_hwasan = false
......
......@@ -98,15 +98,6 @@ android_clang_toolchain("android_clang_arm64") {
}
}
android_clang_toolchain("android_clang_arm64_hwasan") {
binary_prefix = "aarch64-linux-android"
toolchain_args = {
current_cpu = "arm64"
is_hwasan = true
android64_ndk_api_level = 29
}
}
android_clang_toolchain("android_clang_mips64el") {
binary_prefix = "mips64el-linux-android"
toolchain_args = {
......
......@@ -95,9 +95,3 @@ if (host_os == "win") {
stamp_command = "touch {{output}}"
copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
}
# This variable is true if the current toolchain is one of the target toolchains.
# This generally means "not the host toolchain", but in the case where we're
# targeting the host it's true then as well.
is_a_target_toolchain =
(current_toolchain != host_toolchain || default_toolchain == host_toolchain) && !is_nacl
......@@ -341,7 +341,6 @@ template("monochrome_public_common_apk_or_module_tmpl") {
defined(invoker.use_trichrome_library) && invoker.use_trichrome_library
is_monochrome = !is_trichrome
shared_libraries = []
loadable_modules = []
secondary_abi_loadable_modules = []
......@@ -478,18 +477,6 @@ template("monochrome_public_common_apk_or_module_tmpl") {
use_chromium_linker = is_trichrome && chromium_linker_supported
use_modern_linker = use_chromium_linker
if (build_hwasan_splits && android_64bit_target_cpu &&
invoker.is_64_bit_browser) {
_hwasan_toolchain = "//build/toolchain/android:android_clang_arm64_hwasan"
shared_libraries +=
[ "//chrome/android:libmonochrome_64($_hwasan_toolchain)" ]
if (use_chromium_linker) {
shared_libraries +=
[ "//base/android/linker:chromium_android_linker($_hwasan_toolchain)" ]
}
}
# Resources config for blocklisting resource names from obfuscation
resources_config_path = "//android_webview/aapt2.config"
......
......@@ -54,12 +54,6 @@ template("chrome_feature_module") {
_shared_libraries += [
"//chrome/android:${_base_target_name}_${_module_desc.name}${_toolchain}",
]
if (android_64bit_target_cpu && _is_monochrome_or_trichrome &&
invoker.is_64_bit_browser && build_hwasan_splits) {
_hwasan_toolchain = "//build/toolchain/android:android_clang_arm64_hwasan"
_shared_libraries += [ "//chrome/android:${_base_target_name}_${_module_desc.name}($_hwasan_toolchain)" ]
}
} else {
not_needed([ "_is_monochrome_or_trichrome" ])
}
......
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