From 3b8711b95c10bc5f3782710926cd7bf935311f8c Mon Sep 17 00:00:00 2001 From: Phani Date: Fri, 3 Apr 2020 18:27:10 -0400 Subject: [PATCH] fix standalone compilation --- runtime/tests/Makefile | 4 ++-- runtime/tests/Makefile.inc | 2 ++ silverfish | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/tests/Makefile b/runtime/tests/Makefile index 487c057..3854cd3 100644 --- a/runtime/tests/Makefile +++ b/runtime/tests/Makefile @@ -37,7 +37,7 @@ clean: @echo "Compiling $(@:%_sf=%)" ${WASMCC} ${$(@:%_sf=%)_CFLAGS} ${WASMCFLAGS} ${OPTFLAGS} ${BENCH_DIR}/$(@:%_sf=%)/*.c $(DUMMY) -o ${TMP_DIR}/$(@:%_sf=%).wasm ${SFCC} ${TMP_DIR}/$(@:%_sf=%).wasm -o ${TMP_DIR}/$(@:%_sf=%).bc - ${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} ${TMP_DIR}/$(@:%_sf=%).bc ${MEMC} ${RT_LIBC} ${RT_RT} -lm -o ${TMP_DIR}/$(@:%_sf=%)_wasm.out + ${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} -D${ARCH} ${TMP_DIR}/$(@:%_sf=%).bc ${MEMC} ${RT_LIBC} ${RT_ENV} ${RT_RT} -lm -o ${TMP_DIR}/$(@:%_sf=%)_wasm.out ${SFCC} --inline-constant-globals --runtime-globals ${TMP_DIR}/$(@:%_sf=%).wasm -o ${TMP_DIR}/$(@:%_sf=%).bc ${CC} --shared -fPIC ${OPTFLAGS} -I${ART_INC} -D${USE_MEM} ${TMP_DIR}/$(@:%_sf=%).bc ${AMEMC} ${WASMISA} -lm -o ${TMP_DIR}/$(@:%_sf=%)_wasm.so @cp ${TMP_DIR}/$(@:%_sf=%)_wasm.so ${ABIN_DIR} @@ -48,7 +48,7 @@ clean: @echo "Compiling $(@:%_rt=%)" ${WASMCC} ${$(@:%_rt=%)_CFLAGS} ${WASMCFLAGS} ${OPTFLAGS} $(@:%_rt=%)/*.c $(DUMMY) -o ${TMP_DIR}/$(@:%_rt=%).wasm ${SFCC} ${TMP_DIR}/$(@:%_rt=%).wasm -o ${TMP_DIR}/$(@:%_rt=%).bc - ${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} ${TMP_DIR}/$(@:%_rt=%).bc ${MEMC} ${RT_LIBC} ${RT_RT} -o ${TMP_DIR}/$(@:%_rt=%)_wasm.out + ${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} -D${ARCH} ${TMP_DIR}/$(@:%_rt=%).bc ${MEMC} ${RT_LIBC} ${RT_ENV} ${RT_RT} -lm -o ${TMP_DIR}/$(@:%_rt=%)_wasm.out ${SFCC} --inline-constant-globals --runtime-globals ${TMP_DIR}/$(@:%_rt=%).wasm -o ${TMP_DIR}/$(@:%_rt=%).bc ${CC} --shared -fPIC ${OPTFLAGS} -I${ART_INC} -D${USE_MEM} ${TMP_DIR}/$(@:%_rt=%).bc ${AMEMC} ${WASMISA} -o ${TMP_DIR}/$(@:%_rt=%)_wasm.so @cp ${TMP_DIR}/$(@:%_rt=%)_wasm.so ${ABIN_DIR} diff --git a/runtime/tests/Makefile.inc b/runtime/tests/Makefile.inc index eaad215..4c9e451 100644 --- a/runtime/tests/Makefile.inc +++ b/runtime/tests/Makefile.inc @@ -2,6 +2,7 @@ BASE=awsm SFCC=silverfish CC=clang WASMCC=wasm32-unknown-unknown-wasm-clang +ARCH := $(shell uname -m) OPTFLAGS=-O3 -flto #same stack-size for all @@ -19,6 +20,7 @@ RT_DIR=${BASE_DIR}/runtime/ RT_MEM=${RT_DIR}/memory/ RT_LIBC=${RT_DIR}/libc/libc_backing.c RT_RT=${RT_DIR}/runtime.c +RT_ENV=${RT_DIR}/libc/env_${ARCH}.c MEMC=${RT_MEM}/${MEMC_64} DUMMY=${BASE_DIR}/code_benches/dummy.c diff --git a/silverfish b/silverfish index a44fe45..116c51d 160000 --- a/silverfish +++ b/silverfish @@ -1 +1 @@ -Subproject commit a44fe4566e1cca6fba95852e077311e5d3e21226 +Subproject commit 116c51dddcd56d15b82a96fb05e2e58ba00c93fe