Skip to content

Commit 923541d

Browse files
arichardsontravisg
authored andcommitted
[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`.
1 parent 231f589 commit 923541d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

engine.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ STRIP := $(TOOLCHAIN_PREFIX)strip
197197
ifeq ($(call is_warning_flag_supported,-Wnonnull-compare),yes)
198198
GLOBAL_COMPILEFLAGS += -Wno-nonnull-compare
199199
endif
200+
# Ideally we would move this check to arm64/rules.mk, but we can only check
201+
# for supported warning flags once CC is defined.
202+
ifeq ($(ARCH),arm64)
203+
# Clang incorrectly diagnoses msr operations as need a 64-bit operand even if
204+
# the underlying register is actually 32 bits. Silence this common warning.
205+
ifeq ($(call is_warning_flag_supported,-Wasm-operand-widths),yes)
206+
ARCH_COMPILEFLAGS += -Wno-asm-operand-widths
207+
endif
208+
endif
200209

201210
$(info PROJECT = $(PROJECT))
202211
$(info PLATFORM = $(PLATFORM))

0 commit comments

Comments
 (0)