Skip to content

Commit

Permalink
Fix system calls of WASI for fs_mark.
Browse files Browse the repository at this point in the history
  • Loading branch information
yomaytk committed Nov 26, 2024
1 parent d9a579f commit cb6e08f
Show file tree
Hide file tree
Showing 13 changed files with 1,666 additions and 155 deletions.
14 changes: 11 additions & 3 deletions examples/benchmarks/fs_mark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@ COBJS= fs_mark.o lib_timing.o

CC ?= gcc
EMCC ?= emcc
WASISDKCC ?= ${WASI_SDK_PATH}/bin/clang
CFLAGS ?= -O3
LDFLAGS ?=
CFLAGS += -Wall -D_FILE_OFFSET_BITS=64

all: fs_mark

fs_mark: fs_mark.c lib_timing.c
$(CC) $(CFLAGS) -static -o fs_mark fs_mark.c lib_timing.c $(LDFLAGS)
$(CC) $(CFLAGS) -static -o fs_mark.aarch64 fs_mark.c lib_timing.c $(LDFLAGS)

fs_mark_wasm: fs_mark.c lib_timing.c
$(EMCC) -O3 -static -o fs_mark.html fs_mark.wasm.c lib_timing.wasm.c
fs_mark_tmp: wasi_fs_mark.c lib_timing.c
$(CC) $(CFLAGS) -static -o tmp_fs_mark.aarch64 wasi_fs_mark.c lib_timing.c $(LDFLAGS)

fs_mark_emcc: fs_mark.c lib_timing.c
$(EMCC) -O3 -o fs_mark.html fs_mark.wasm.c lib_timing.wasm.c

fs_mark_wasi: fs_mark.c lib_timing.c
$(WASISDKCC) -O3 wasi_fs_mark.c lib_timing.c -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_GETPID \
-lwasi-emulated-process-clocks -lwasi-emulated-getpid -o fs_mark_wasi.wasm

test: fs_mark
./fs_mark -d ${DIR1} -d ${DIR2} -s 51200 -n 4096
Expand Down
Binary file modified examples/benchmarks/fs_mark/fs_mark.aarch64
Binary file not shown.
Loading

0 comments on commit cb6e08f

Please sign in to comment.