From afa282ca4f32888b47704f3776882273cbdde31b Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Fri, 15 Dec 2023 16:24:50 +0800 Subject: [PATCH] WASI-SDK.defs: Simplify CFLAGS filters Signed-off-by: Huang Qi --- tools/WASI-SDK.defs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/WASI-SDK.defs b/tools/WASI-SDK.defs index e6da857cf5..55a258e7b6 100644 --- a/tools/WASI-SDK.defs +++ b/tools/WASI-SDK.defs @@ -61,9 +61,14 @@ ifneq ($(CONFIG_LTO_FULL)$(CONFIG_LTO_THIN),) endif # Build other compiler flags from native compiler - -CFLAGS_STRIP = -fsanitize=kernel-address -fsanitize=address -fsanitize=undefined -CFLAGS_STRIP += $(ARCHCPUFLAGS) $(ARCHCFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(ARCHOPTIMIZATION) $(EXTRAFLAGS) +# Filter out some flags that wasm-clang does not support, +# -m%: Machine flags, -mcpu=, -mfpu=, -mfloat-abi= etc. +# -Wl,%: Extra linker flags, wasm-ld don't support many of them. +# -fsanitize%: -fsanitize=address, -fsanitize=thread etc. +# -fno-sanitize%: -fno-sanitize=address, -fno-sanitize=thread etc. +# -W%: Warning flags, clang is more strict than gcc + +CFLAGS_STRIP = -m% -Wl,% -fsanitize% -fno-sanitize% -W% WCFLAGS += $(filter-out $(CFLAGS_STRIP),$(CFLAGS)) WCFLAGS += --sysroot=$(WSYSROOT) -nostdlib -D__NuttX__