Commit 89f424b8 authored by Tiancong Wang's avatar Tiancong Wang Committed by Commit Bot

Fix a problem where crc32c not built on ARM64 on Chrome OS

In crc32c BUILD.gn file, it sets -march flag to armv8-a+crc+crypto
in order to support some special instructions. However, on Chrome OS,
it also sets -march flag for ARM64 which might mask the flag set by
GN file. This CL fixes this problem by passing "crc" and "crypto"
directly to clang through "-target-feature" flag. As suggested by
the reviewers, the CL changes to flag to clang only and applies to
all platforms.

CL crrev.com/c/1489392

Bug: chromium:934016
TEST: Tested on Chrome OS with tryjobs kevin64 and arm64 with testing
Change-Id: Ifb4a50308f230a7d8198f3cd4b92301e63724e6d
Reviewed-on: https://chromium-review.googlesource.com/c/1492489
Commit-Queue: Tiancong Wang <tcwang@google.com>
Auto-Submit: Tiancong Wang <tcwang@google.com>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636948}
parent 8272ed2b
...@@ -113,7 +113,23 @@ source_set("crc32c_arm64") { ...@@ -113,7 +113,23 @@ source_set("crc32c_arm64") {
configs += [ ":crc32c_config" ] configs += [ ":crc32c_config" ]
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
cflags = [ "-march=armv8-a+crc+crypto" ] if (is_clang) {
cflags = [
"-march=armv8-a",
# Some builds set -march to a different value from the above.
# The specific feature flags below enable the instructions we need
# in these cases. See https://crbug.com/934016 for example.
"-Xclang",
"-target-feature",
"-Xclang",
"+crc",
"-Xclang",
"-target-feature",
"-Xclang",
"+crypto",
]
}
} }
deps = [ deps = [
......
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