Browse Source

Only apply -mbulk-memory to specific files

sunfishcode/bulk-memory
Cheng Shao 3 years ago
committed by Dan Gohman
parent
commit
0a0b85bf0a
  1. 12
      Makefile
  2. 1
      expected/wasm32-wasi/predefined-macros.txt
  3. 1
      expected/wasm32-wasi/undefined-symbols.txt

12
Makefile

@ -3,7 +3,7 @@
CC ?= clang
NM ?= $(patsubst %clang,%llvm-nm,$(filter-out ccache sccache,$(CC)))
AR ?= $(patsubst %clang,%llvm-ar,$(filter-out ccache sccache,$(CC)))
EXTRA_CFLAGS ?= -mbulk-memory -O2 -DNDEBUG
EXTRA_CFLAGS ?= -O2 -DNDEBUG
# The directory where we build the sysroot.
SYSROOT ?= $(CURDIR)/sysroot
# A directory to install to for "make install".
@ -178,6 +178,10 @@ MUSL_PRINTSCAN_SOURCES = \
$(LIBC_TOP_HALF_MUSL_SRC_DIR)/stdio/vfscanf.c \
$(LIBC_TOP_HALF_MUSL_SRC_DIR)/stdlib/strtod.c \
$(LIBC_TOP_HALF_MUSL_SRC_DIR)/stdlib/wcstod.c
BULK_MEMORY_SOURCES = \
$(LIBC_TOP_HALF_MUSL_SRC_DIR)/string/memcpy.c \
$(LIBC_TOP_HALF_MUSL_SRC_DIR)/string/memmove.c \
$(LIBC_TOP_HALF_MUSL_SRC_DIR)/string/memset.c
LIBC_TOP_HALF_HEADERS_PRIVATE = $(LIBC_TOP_HALF_DIR)/headers/private
LIBC_TOP_HALF_SOURCES = $(LIBC_TOP_HALF_DIR)/sources
LIBC_TOP_HALF_ALL_SOURCES = \
@ -206,7 +210,7 @@ CFLAGS += -Wall -Wextra -Werror \
# Configure support for threads.
ifeq ($(THREAD_MODEL), single)
CFLAGS += -mthread-model single -ftls-model=local-exec
CFLAGS += -mthread-model single
endif
ifeq ($(THREAD_MODEL), posix)
CFLAGS += -mthread-model posix -pthread
@ -248,6 +252,7 @@ endif
MUSL_PRINTSCAN_OBJS = $(call objs,$(MUSL_PRINTSCAN_SOURCES))
MUSL_PRINTSCAN_LONG_DOUBLE_OBJS = $(patsubst %.o,%.long-double.o,$(MUSL_PRINTSCAN_OBJS))
MUSL_PRINTSCAN_NO_FLOATING_POINT_OBJS = $(patsubst %.o,%.no-floating-point.o,$(MUSL_PRINTSCAN_OBJS))
BULK_MEMORY_OBJS = $(call objs,$(BULK_MEMORY_SOURCES))
LIBWASI_EMULATED_MMAN_OBJS = $(call objs,$(LIBWASI_EMULATED_MMAN_SOURCES))
LIBWASI_EMULATED_PROCESS_CLOCKS_OBJS = $(call objs,$(LIBWASI_EMULATED_PROCESS_CLOCKS_SOURCES))
LIBWASI_EMULATED_GETPID_OBJS = $(call objs,$(LIBWASI_EMULATED_GETPID_SOURCES))
@ -379,6 +384,9 @@ $(MUSL_PRINTSCAN_NO_FLOATING_POINT_OBJS): CFLAGS += \
-D__wasilibc_printscan_no_floating_point \
-D__wasilibc_printscan_floating_point_support_option="\"remove -lc-printscan-no-floating-point from the link command\""
$(BULK_MEMORY_OBJS): CFLAGS += \
-mbulk-memory
$(LIBWASI_EMULATED_SIGNAL_MUSL_OBJS): CFLAGS += \
-D_WASI_EMULATED_SIGNAL

1
expected/wasm32-wasi/predefined-macros.txt

@ -3061,7 +3061,6 @@
#define __wasm32 1
#define __wasm32__ 1
#define __wasm__ 1
#define __wasm_bulk_memory__ 1
#define _tolower(a) ((a)|0x20)
#define _toupper(a) ((a)&0x5f)
#define acos(x) __tg_real_complex(acos, (x))

1
expected/wasm32-wasi/undefined-symbols.txt

@ -60,7 +60,6 @@ __lttf2
__netf2
__stack_pointer
__subtf3
__tls_base
__trunctfdf2
__trunctfsf2
__unordtf2

Loading…
Cancel
Save