Commit 9591f2ba authored by Abhishek Arya's avatar Abhishek Arya Committed by Commit Bot

Revert "Build 32- and 64-bit Android mojo_core for Chrome OS distribution"

This reverts commit 58eabf0b.

Reason for revert: Broke ChromeOS ASan builder

Original change's description:
> Build 32- and 64-bit Android mojo_core for Chrome OS distribution
> 
> Causes Chrome builds for Chrome OS to emit additional 32-bit and
> 64-bit copies of the mojo_core shared library built against the
> Android toolchain, for use from within the ARC++ container.
> 
> In order to support building these library targets, this also
> modifies DEPS to include a minimal set of required Android support
> tools and libraries in chromeos checkouts.
> 
> Bug: 822034
> Change-Id: I219837de3076490cdea8315e6cc98c5432871ea0
> Reviewed-on: https://chromium-review.googlesource.com/1026203
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#554617}

TBR=rockot@chromium.org,dpranke@chromium.org

Change-Id: I2e2b0d3500aa948f15ec7cf0ff024f7a82fd719d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 822034
Reviewed-on: https://chromium-review.googlesource.com/1033369Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554632}
parent 5d11c9e1
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
gclient_gn_args_file = 'src/build/config/gclient_args.gni' gclient_gn_args_file = 'src/build/config/gclient_args.gni'
gclient_gn_args = [ gclient_gn_args = [
'checkout_android', 'checkout_android',
'checkout_android_native_support',
'checkout_libaom', 'checkout_libaom',
'checkout_nacl', 'checkout_nacl',
'checkout_oculus_sdk', 'checkout_oculus_sdk',
...@@ -43,10 +42,6 @@ vars = { ...@@ -43,10 +42,6 @@ vars = {
# purposes. # purposes.
'checkout_configuration': 'default', 'checkout_configuration': 'default',
# Pull in Android native toolchain dependencies for Chrome OS too, so we can
# build ARC++ support libraries.
'checkout_android_native_support': 'checkout_android or checkout_chromeos',
# By default, do not check out android sdk sources. This can be overridden # By default, do not check out android sdk sources. This can be overridden
# e.g. with custom_vars. # e.g. with custom_vars.
'checkout_android_sdk_sources': False, 'checkout_android_sdk_sources': False,
...@@ -343,7 +338,7 @@ deps = { ...@@ -343,7 +338,7 @@ deps = {
'src/third_party/android_ndk': { 'src/third_party/android_ndk': {
'url': Var('chromium_git') + '/android_ndk.git' + '@' + '635bc380968a76f6948fee65f80a0b28db53ae81', 'url': Var('chromium_git') + '/android_ndk.git' + '@' + '635bc380968a76f6948fee65f80a0b28db53ae81',
'condition': 'checkout_android_native_support', 'condition': 'checkout_android',
}, },
'src/third_party/android_support_test_runner': { 'src/third_party/android_support_test_runner': {
...@@ -370,7 +365,7 @@ deps = { ...@@ -370,7 +365,7 @@ deps = {
'src/third_party/android_tools': { 'src/third_party/android_tools': {
'url': Var('chromium_git') + '/android_tools.git' + '@' + 'c22a664c39af72dd8f89200220713dcad811300a', 'url': Var('chromium_git') + '/android_tools.git' + '@' + 'c22a664c39af72dd8f89200220713dcad811300a',
'condition': 'checkout_android_native_support', 'condition': 'checkout_android',
}, },
'src/third_party/android_sdk/public': { 'src/third_party/android_sdk/public': {
...@@ -529,7 +524,7 @@ deps = { ...@@ -529,7 +524,7 @@ deps = {
'src/third_party/elfutils/src': { 'src/third_party/elfutils/src': {
'url': Var('chromium_git') + '/external/elfutils.git' + '@' + '249673729a7e5dbd5de4f3760bdcaa3d23d154d7', 'url': Var('chromium_git') + '/external/elfutils.git' + '@' + '249673729a7e5dbd5de4f3760bdcaa3d23d154d7',
'condition': 'checkout_android_native_support', 'condition': 'checkout_android',
}, },
'src/third_party/errorprone/lib': { 'src/third_party/errorprone/lib': {
......
...@@ -78,13 +78,7 @@ config("feature_flags") { ...@@ -78,13 +78,7 @@ config("feature_flags") {
if (use_nss_certs) { if (use_nss_certs) {
defines += [ "USE_NSS_CERTS=1" ] defines += [ "USE_NSS_CERTS=1" ]
} }
if (use_ozone && !is_android) { if (use_ozone) {
# Note that some Chrome OS builds unconditionally set |use_ozone| to true,
# but they also build some targets with the Android toolchain. This ensures
# that Android targets still build with USE_OZONE=0 in such cases.
#
# TODO(crbug.com/837032): Maybe this can be cleaned up if we can avoid
# setting use_ozone globally.
defines += [ "USE_OZONE=1" ] defines += [ "USE_OZONE=1" ]
} }
if (use_x11) { if (use_x11) {
......
...@@ -5,10 +5,7 @@ ...@@ -5,10 +5,7 @@
# Logic separated out from config.gni so that it can be used by compiler.gni # Logic separated out from config.gni so that it can be used by compiler.gni
# without introducing a circular dependency. # without introducing a circular dependency.
# NOTE: Because Chrome OS builds may depend on targets built with the Android assert(is_android)
# toolchain, this GNI file may be read and processed from within Chrome OS
# toolchains. Checking |is_android| here would therefore be too restrictive.
assert(is_android || is_chromeos)
declare_args() { declare_args() {
# Adds intrumentation to each function. Writes a file with the order that # Adds intrumentation to each function. Writes a file with the order that
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
# This file contains common system config stuff for the Android build. # This file contains common system config stuff for the Android build.
# NOTE: Because Chrome OS builds may depend on targets built with the Android if (is_android) {
# toolchain, this GNI file may be read and processed from within Chrome OS
# toolchains. Checking |is_android| here would therefore be too restrictive.
if (is_android || is_chromeos) {
import("//build_overrides/build.gni") import("//build_overrides/build.gni")
import("abi.gni") import("abi.gni")
...@@ -16,11 +13,9 @@ if (is_android || is_chromeos) { ...@@ -16,11 +13,9 @@ if (is_android || is_chromeos) {
# heavily but don't write gclient args files. # heavily but don't write gclient args files.
import("//build/config/gclient_args.gni") import("//build/config/gclient_args.gni")
if (defined(checkout_android_native_support)) { if (defined(checkout_android)) {
assert(checkout_android_native_support, assert(checkout_android,
"Missing native Android toolchain support. |target_os| in your " + "target_os in your .gclient configuration must include android.")
".gclient configuration must include \"android\" and/or " +
"\"chromeos\".")
} }
} }
......
...@@ -416,14 +416,7 @@ config("compiler") { ...@@ -416,14 +416,7 @@ config("compiler") {
ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ] ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ]
} }
if (((is_posix || is_fuchsia) && use_lld && !is_nacl) || if ((is_posix || is_fuchsia) && use_lld && !is_nacl) {
(target_os == "chromeos" && is_android)) {
# NOTE: Some Chrome OS builds globally disable LLD, but they also build some
# targets against Android toolchains which should use LLD. Therefore we
# explicitly select LLD in these cases.
#
# TODO(https://crbug.com/837095): This should be cleaned up if/when LLD can
# work properly for Chrome OS builds.
ldflags += [ "-fuse-ld=lld" ] ldflags += [ "-fuse-ld=lld" ]
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
# Reduce the page size from 65536 in order to reduce binary size slightly # Reduce the page size from 65536 in order to reduce binary size slightly
...@@ -2123,13 +2116,7 @@ config("symbols") { ...@@ -2123,13 +2116,7 @@ config("symbols") {
} }
cflags += [ "-g2" ] cflags += [ "-g2" ]
} }
if (use_debug_fission && !is_nacl && !is_android) { if (use_debug_fission && !is_nacl) {
# NOTE: Some Chrome OS builds globally set |use_debug_fission| to true,
# but they also build some targets against Android toolchains which aren't
# compatible with it.
#
# TODO(https://crbug.com/837032): See if we can clean this up by e.g. not
# setting use_debug_fission globally.
cflags += [ "-gsplit-dwarf" ] cflags += [ "-gsplit-dwarf" ]
} }
asmflags = cflags asmflags = cflags
......
...@@ -225,9 +225,7 @@ if (symbol_level == -1) { ...@@ -225,9 +225,7 @@ if (symbol_level == -1) {
} }
# Assert that the configuration isn't going to hit https://crbug.com/648948. # Assert that the configuration isn't going to hit https://crbug.com/648948.
# An exception is made when target_os == "chromeos" as we only use the Android assert(ignore_elf32_limitations || !is_android ||
# toolchain there to build relatively small binaries.
assert(ignore_elf32_limitations || !is_android || target_os == "chromeos" ||
(android_64bit_target_cpu && !build_apk_secondary_abi) || (android_64bit_target_cpu && !build_apk_secondary_abi) ||
is_component_build || symbol_level < 2, is_component_build || symbol_level < 2,
"Android 32-bit non-component builds cannot have symbol_level=2 " + "Android 32-bit non-component builds cannot have symbol_level=2 " +
......
...@@ -36,7 +36,7 @@ if (generate_linker_map) { ...@@ -36,7 +36,7 @@ if (generate_linker_map) {
assert( assert(
is_official_build, is_official_build,
"Linker map files should only be generated when is_official_build = true") "Linker map files should only be generated when is_official_build = true")
assert(current_os == "android" || current_os == "linux", assert(target_os == "android" || target_os == "linux",
"Linker map files should only be generated for Android and Linux") "Linker map files should only be generated for Android and Linux")
} }
......
...@@ -299,10 +299,7 @@ if (!is_android && !is_mac) { ...@@ -299,10 +299,7 @@ if (!is_android && !is_mac) {
} }
if (is_chromeos) { if (is_chromeos) {
data_deps += [ data_deps += [ "//mojo/edk:mojo_core" ]
"//mojo/edk:mojo_core",
"//mojo/edk:mojo_core_for_arc",
]
} }
# These files are used by the installer so we need a public dep. # These files are used by the installer so we need a public dep.
......
...@@ -206,7 +206,7 @@ core_impl_source_set("impl_for_edk") { ...@@ -206,7 +206,7 @@ core_impl_source_set("impl_for_edk") {
for_mojo_core = false for_mojo_core = false
} }
if (is_chromeos || is_linux || is_android) { if (is_chromeos || is_linux) {
core_impl_source_set("impl_for_mojo_core") { core_impl_source_set("impl_for_mojo_core") {
for_mojo_core = true for_mojo_core = true
} }
...@@ -223,69 +223,26 @@ if (is_chromeos || is_linux || is_android) { ...@@ -223,69 +223,26 @@ if (is_chromeos || is_linux || is_android) {
configs += [ ":export_only_thunks_api" ] configs += [ ":export_only_thunks_api" ]
} }
if (is_chromeos) {
if (target_cpu == "arm" || target_cpu == "arm64") {
android32_toolchain = "android_clang_arm"
android64_toolchain = "android_clang_arm64"
} else {
android32_toolchain = "android_clang_x86"
android64_toolchain = "android_clang_x64"
}
group("mojo_core_for_arc") {
deps = [
":mojo_core_arc32",
":mojo_core_arc64",
]
}
copy("mojo_core_arc32") {
sources = [
"${root_out_dir}/${android32_toolchain}/libmojo_core.so",
]
outputs = [
"${root_out_dir}/libmojo_core_arc32.so",
]
deps = [
":mojo_core(//build/toolchain/android:${android32_toolchain})",
]
}
copy("mojo_core_arc64") {
sources = [
"${root_out_dir}/${android64_toolchain}/libmojo_core.so",
]
outputs = [
"${root_out_dir}/libmojo_core_arc64.so",
]
deps = [
":mojo_core(//build/toolchain/android:${android64_toolchain})",
]
}
}
config("export_only_thunks_api") { config("export_only_thunks_api") {
ldflags = [ "-Wl,--version-script=" + ldflags = [ "-Wl,--version-script=" +
rebase_path("//mojo/edk/export_only_thunks_api.lst") ] rebase_path("//mojo/edk/export_only_thunks_api.lst") ]
} }
if (is_chromeos || is_linux) { test("mojo_core_unittests") {
test("mojo_core_unittests") { sources = [
sources = [ "mojo_core_unittest.cc",
"mojo_core_unittest.cc", "run_all_core_unittests.cc",
"run_all_core_unittests.cc", ]
]
deps = [ deps = [
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//mojo/public/c/system", "//mojo/public/c/system",
"//testing/gtest", "//testing/gtest",
] ]
data_deps = [ data_deps = [
":mojo_core", ":mojo_core",
] ]
}
} }
} }
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