Skip to content

Commit

Permalink
[clang][arm64] Disable -Wasm-operand-widths warning
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
arichardson committed May 4, 2023
1 parent ea6823c commit dcd7131
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions engine.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit dcd7131

Please sign in to comment.