Skip to content

Commit bd950eb

Browse files
authored
Use -fno-strict-aliasing for emmalloc (#424)
1 parent 43e7123 commit bd950eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ $(LIBC_TOP_HALF_ALL_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_OBJS) $(MUSL_PRINTSCAN_NO
561561
$(LIBWASI_EMULATED_PROCESS_CLOCKS_OBJS): CFLAGS += \
562562
-I$(LIBC_BOTTOM_HALF_CLOUDLIBC_SRC)
563563

564+
# emmalloc uses a lot of pointer type-punning, which is UB under strict aliasing,
565+
# and this was found to have real miscompilations in wasi-libc#421.
566+
$(EMMALLOC_OBJS): CFLAGS += \
567+
-fno-strict-aliasing
568+
564569
include_dirs:
565570
#
566571
# Install the include files.

0 commit comments

Comments
 (0)