Commit 2b08317c authored by Mark Mentovai's avatar Mark Mentovai Committed by Commit Bot

mac/arm64: Compile with -mcpu=apple-a12

The baseline CPU for macOS on arm64 is the Apple A12 (Vortex/Tempest),
and clang should default to this when building for this OS/CPU
combination. Apple clang embedded in Xcode 12 does, but trunk clang does
not, instead targeting the Apple A7 (Cyclone), the proper baseline CPU
for iOS on arm64. https://reviews.llvm.org/D82699 would fix it, but it
hasn't gained any traction. Specify the baseline CPU explicitly here.

Bug: 1107587, 1119249
Change-Id: I2a132b00ef9b5c8262aa24f27a7519d83a3df41a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363772
Auto-Submit: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799582}
parent fffb23ca
...@@ -28,6 +28,17 @@ config("compiler") { ...@@ -28,6 +28,17 @@ config("compiler") {
common_mac_flags += [ common_mac_flags += [
"-arch", "-arch",
current_cpu, current_cpu,
# The baseline CPU for macOS on arm64 is the Apple A12 (Vortex/Tempest),
# and clang should default to this when building for this OS/CPU
# combination. Apple clang embedded in Xcode 12 does, but trunk clang does
# not, instead targeting the Apple A7 (Cyclone), the proper baseline CPU
# for iOS on arm64. https://reviews.llvm.org/D82699 would fix it, but it
# hasn't gained any traction. Specify the baseline CPU explicitly here.
#
# TODO(https://crbug.com/1119249): Remove this when trunk clang has a
# better default.
"-mcpu=apple-a12",
] ]
} else { } else {
assert(false, "unknown current_cpu $current_cpu") assert(false, "unknown current_cpu $current_cpu")
......
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