Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: components/cronet/android/BUILD.gn

Issue 2060333002: [Cronet] Enforce ARMv7 Cronet doesn't inadvertently use ARM Neon instructions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/cronet/tools/check_no_neon.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/BUILD.gn
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn
index 99485b52af894a15928f64f36a3706c6e68f2de4..f93a0b037c5236dc244f9982ff08ed13d035b729 100644
--- a/components/cronet/android/BUILD.gn
+++ b/components/cronet/android/BUILD.gn
@@ -934,16 +934,45 @@ copy("cronet_package_copy_native_lib_unstripped") {
]
}
+# Enforce that ARM Neon is not used when building for ARMv7
+if (target_cpu == "arm" && arm_version == 7 && !arm_use_neon) {
+ action("enforce_no_neon") {
+ script = "//components/cronet/tools/check_no_neon.py"
+ args = [
+ rebase_path("${android_tool_prefix}objdump", root_build_dir),
+
+ # libcronet.so may contain ARM Neon instructions from BoringSSL, but these
+ # are only used after checking whether the CPU supports NEON at runtime,
+ # so instead check base/ as it represents a large swath of code that only
+ # contains Neon instructions when Neon is enabled by default.
+ rebase_path("$root_out_dir/obj/base/base/*.o", root_build_dir),
+ ]
+ outputs = [
+ "$root_out_dir/cronet_$target_name.d",
+ ]
+ deps = [
+ "//base:base",
+ ]
+ }
+}
+
group("cronet_package") {
- deps = [
- ":cronet_package_copy",
- ":cronet_package_copy_native_lib",
- ":cronet_package_copy_native_lib_unstripped",
- ":generate_javadoc",
- ":generate_licenses",
- ":jar_cronet_api_source",
- ":jar_cronet_other_source",
- ":jar_cronet_sample_source",
- ":repackage_extracted_jars",
- ]
+ # Enforce that arm_use_neon==false when building for ARMv7 by
+ # not including any deps in cronet_package target otherwise.
+ if (!(target_cpu == "arm" && arm_version == 7) || !arm_use_neon) {
+ deps = [
+ ":cronet_package_copy",
+ ":cronet_package_copy_native_lib",
+ ":cronet_package_copy_native_lib_unstripped",
+ ":generate_javadoc",
+ ":generate_licenses",
+ ":jar_cronet_api_source",
+ ":jar_cronet_other_source",
+ ":jar_cronet_sample_source",
+ ":repackage_extracted_jars",
+ ]
+ if (current_cpu == "arm" && arm_version == 7) {
+ deps += [ ":enforce_no_neon" ]
+ }
+ }
}
« no previous file with comments | « no previous file | components/cronet/tools/check_no_neon.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698