Fix capture_context_win_arm64 in standalone clang build

clang-cl does not understand armasm64 assembler syntax. The existing
workaround for crashpad_is_in_chromium, which has used clang-cl
exclusively for quite some time, was to use a checked-in prebuilt .obj
produced by armasm64, rather than assembling the .asm during the build.
This same .obj can be used to support the standalone clang build.

As Crashpad on Windows is now clang-primary (with an eye toward becoming
clang-only), this is not a long-term solution. The existing armasm64
source will need to be translated to an assembler dialect that clang-cl
understands.

Bug: 399587142, 384682775
Change-Id: Ieeb3c1c54c954997514a3fecb5c362b7d4d7d13d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6309923
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2025-02-27 14:30:21 -05:00 committed by Crashpad LUCI CQ
parent 32a2c250a3
commit 8eb8015544

View File

@ -528,13 +528,12 @@ crashpad_static_library("util") {
"win/safe_terminate_process.asm",
]
} else {
# Most Crashpad builds use Microsoft's armasm64.exe macro assembler for
# .asm source files. When building in Chromium, clang-cl is used as the
# assembler instead. Since the two assemblers recognize different
# assembly dialects, the same .asm file can't be used for each. As a
# workaround, use a prebuilt .obj file when the Microsoft-dialect
# assembler isn't available.
if (crashpad_is_in_chromium) {
# When building with clang, clang-cl is used as the assembler. Since
# clang-cl recognizes a different assembly dialect than Microsofts
# armasm64 macro assembler, the same .asm file cant be used for each. As
# a workaround, use a prebuilt .obj file when the Microsoft-dialect
# assembler isnt available.
if (crashpad_is_clang) {
sources += [ "misc/capture_context_win_arm64.obj" ]
} else {
sources += [ "misc/capture_context_win_arm64.asm" ]