[clang][arm64] Disable -Wasm-operand-widths warning

Clang incorrectly diagnoses msr operations as need a 64-bit operand even
if the underlying register is actually 32 bits. Silence this warning.
There are quite a few occurrences of this warning so I opted to add the
-Wno-flag instead of wrapping all callsites in
`#pragma clang diagnostic ignored -Wasm-operand-widths`.
This commit is contained in:
Alex Richardson
2023-05-04 13:53:48 -07:00
committed by Travis Geiselbrecht
parent 231f58903b
commit 923541d4c2

View File

@@ -197,6 +197,15 @@ STRIP := $(TOOLCHAIN_PREFIX)strip
ifeq ($(call is_warning_flag_supported,-Wnonnull-compare),yes)
GLOBAL_COMPILEFLAGS += -Wno-nonnull-compare
endif
# Ideally we would move this check to arm64/rules.mk, but we can only check
# for supported warning flags once CC is defined.
ifeq ($(ARCH),arm64)
# Clang incorrectly diagnoses msr operations as need a 64-bit operand even if
# the underlying register is actually 32 bits. Silence this common warning.
ifeq ($(call is_warning_flag_supported,-Wasm-operand-widths),yes)
ARCH_COMPILEFLAGS += -Wno-asm-operand-widths
endif
endif
$(info PROJECT = $(PROJECT))
$(info PLATFORM = $(PLATFORM))