Skip to content

Commit afa282c

Browse files
no1wudixiaoxiang781216
authored andcommitted
WASI-SDK.defs: Simplify CFLAGS filters
Signed-off-by: Huang Qi <[email protected]>
1 parent 11f2d5e commit afa282c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tools/WASI-SDK.defs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,14 @@ ifneq ($(CONFIG_LTO_FULL)$(CONFIG_LTO_THIN),)
6161
endif
6262

6363
# Build other compiler flags from native compiler
64-
65-
CFLAGS_STRIP = -fsanitize=kernel-address -fsanitize=address -fsanitize=undefined
66-
CFLAGS_STRIP += $(ARCHCPUFLAGS) $(ARCHCFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(ARCHOPTIMIZATION) $(EXTRAFLAGS)
64+
# Filter out some flags that wasm-clang does not support,
65+
# -m%: Machine flags, -mcpu=, -mfpu=, -mfloat-abi= etc.
66+
# -Wl,%: Extra linker flags, wasm-ld don't support many of them.
67+
# -fsanitize%: -fsanitize=address, -fsanitize=thread etc.
68+
# -fno-sanitize%: -fno-sanitize=address, -fno-sanitize=thread etc.
69+
# -W%: Warning flags, clang is more strict than gcc
70+
71+
CFLAGS_STRIP = -m% -Wl,% -fsanitize% -fno-sanitize% -W%
6772

6873
WCFLAGS += $(filter-out $(CFLAGS_STRIP),$(CFLAGS))
6974
WCFLAGS += --sysroot=$(WSYSROOT) -nostdlib -D__NuttX__

0 commit comments

Comments
 (0)