From 61534d171fd6dd964b6f327f966a0aa1635fd21a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 23 Jun 2023 09:57:25 -0700 Subject: [PATCH] Use -fno-strict-aliasing for emmalloc --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 00d26d35b..c5eb2ff3e 100644 --- a/Makefile +++ b/Makefile @@ -561,6 +561,11 @@ $(LIBC_TOP_HALF_ALL_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_OBJS) $(MUSL_PRINTSCAN_NO $(LIBWASI_EMULATED_PROCESS_CLOCKS_OBJS): CFLAGS += \ -I$(LIBC_BOTTOM_HALF_CLOUDLIBC_SRC) +# emmalloc uses a lot of pointer type-punning, which is UB under strict aliasing, +# and this was found to have real miscompilations in wasi-libc#421. +$(EMMALLOC_OBJS): CFLAGS += \ + -fno-strict-aliasing + include_dirs: # # Install the include files.