Commit fe9e7e1c authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

android: Reorganize how arm_float_abi is set.

https://chromium-review.googlesource.com/c/chromium/src/+/2510772 tried
to force the arm_float_abi gn arg to softfp on Android. But since
arm_float_abi was declared only in arm toolchains, it broke builds
that declared the android_clang_arm toolchain but didn't actually
instantiate it. To work around this,
https://chromium-review.googlesource.com/c/chromium/src/+/2512899
made arm_float_abi available unconditionally, even in non-arm builds.

Instead, make arm_float_abi a declare_arg only on non-android arm,
and set it to a fixed value in arm.gni for android builds.
I tested this in chromium and webrtc builds.

No real behavior change, except that arm_float_abi is exposed as
gn arg in fewer cases (which seems like a good thing).

Bug: 1144188
Change-Id: I2260f2abb9bbb91ab8b87760014cf1a553264dad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517423
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarMirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823704}
parent 52aa895f
...@@ -4,13 +4,6 @@ ...@@ -4,13 +4,6 @@
import("//build/config/v8_target_cpu.gni") import("//build/config/v8_target_cpu.gni")
declare_args() {
# The ARM floating point mode. This is either the string "hard", "soft", or
# "softfp". An empty string means to use the default one for the
# arm_version.
arm_float_abi = ""
}
# These are primarily relevant in current_cpu == "arm" contexts, where # These are primarily relevant in current_cpu == "arm" contexts, where
# ARM code is being compiled. But they can also be relevant in the # ARM code is being compiled. But they can also be relevant in the
# other contexts when the code will change its behavior based on the # other contexts when the code will change its behavior based on the
...@@ -45,6 +38,16 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { ...@@ -45,6 +38,16 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
arm_use_thumb = true arm_use_thumb = true
} }
if (current_os == "android" || target_os == "android") {
arm_float_abi = "softfp"
} else {
declare_args() {
# The ARM floating point mode. This is either the string "hard", "soft",
# or "softfp". An empty string means to use the default one for the
# arm_version.
arm_float_abi = ""
}
}
assert(arm_float_abi == "" || arm_float_abi == "hard" || assert(arm_float_abi == "" || arm_float_abi == "hard" ||
arm_float_abi == "soft" || arm_float_abi == "softfp") arm_float_abi == "soft" || arm_float_abi == "softfp")
...@@ -81,20 +84,12 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { ...@@ -81,20 +84,12 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
} }
if (arm_float_abi == "") { if (arm_float_abi == "") {
if (current_os == "android" || target_os == "android") { if (current_os == "linux" && target_cpu != v8_target_cpu) {
arm_float_abi = "softfp"
} else if (current_os == "linux" && target_cpu != v8_target_cpu) {
# Default to the same as Android for V8 simulator builds. # Default to the same as Android for V8 simulator builds.
arm_float_abi = "softfp" arm_float_abi = "softfp"
} else { } else {
arm_float_abi = "hard" arm_float_abi = "hard"
} }
} else if (current_os == "android") {
# The build/toolchain/android:android_clang_arm toolchain explicitly
# enforces this, so that chromeos builds can customize arm_float_abi
# for the outer chromeos build without affecting the android portion of
# a chromeos build.
assert(arm_float_abi == "softfp")
} }
if (arm_fpu == "") { if (arm_fpu == "") {
...@@ -113,11 +108,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { ...@@ -113,11 +108,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") {
} }
if (arm_float_abi == "") { if (arm_float_abi == "") {
if (current_os == "android" || target_os == "android") { arm_float_abi = "hard"
arm_float_abi = "softfp"
} else {
arm_float_abi = "hard"
}
} }
if (arm_fpu == "") { if (arm_fpu == "") {
......
...@@ -96,7 +96,6 @@ android_clang_toolchain("android_clang_arm") { ...@@ -96,7 +96,6 @@ android_clang_toolchain("android_clang_arm") {
binary_prefix = "arm-linux-androideabi" binary_prefix = "arm-linux-androideabi"
toolchain_args = { toolchain_args = {
current_cpu = "arm" current_cpu = "arm"
arm_float_abi = "softfp"
} }
} }
......
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