Compare commits
5 Commits
25b5ecfb3b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
593f0e34f7
|
|||
|
64a7098112
|
|||
|
7a4bf17670
|
|||
|
ad8a908506
|
|||
|
eb5b895b00
|
5
Makefile
5
Makefile
@ -1,5 +1,5 @@
|
|||||||
docker:
|
docker:
|
||||||
docker build -t gitea.vps.chriphost.de/christoph/wasm-base:latest -f wasm-base.dockerfile . --build-arg CACHE_DATE="$(shell date)"
|
docker build --progress=plain -t gitea.vps.chriphost.de/christoph/wasm-base:latest -f wasm-base.dockerfile . --build-arg CACHE_DATE="$(shell date)"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
docker run --rm -it gitea.vps.chriphost.de/christoph/wasm-base:latest /usr/bin/fish
|
docker run --rm -it gitea.vps.chriphost.de/christoph/wasm-base:latest /usr/bin/fish
|
||||||
@ -15,3 +15,6 @@ qemu-host:
|
|||||||
|
|
||||||
gdb-host:
|
gdb-host:
|
||||||
nix shell nixpkgs#gdb --command gdb ./examples/build-bochs/sum/system.elf -ex "set substitute-path build-bochs ./examples/build-bochs" -ex "target remote localhost:1234" -ex "break os_main"
|
nix shell nixpkgs#gdb --command gdb ./examples/build-bochs/sum/system.elf -ex "set substitute-path build-bochs ./examples/build-bochs" -ex "target remote localhost:1234" -ex "break os_main"
|
||||||
|
|
||||||
|
radare:
|
||||||
|
radare2 -AA -c "s dbg.os_main; pdf" ./examples/build-bochs/sum/system.elf
|
||||||
|
|||||||
@ -73,9 +73,6 @@ import-%: import-arch-%
|
|||||||
* $ make result-$(subst import-,,$@)\n \
|
* $ make result-$(subst import-,,$@)\n \
|
||||||
****************************************************************"
|
****************************************************************"
|
||||||
|
|
||||||
server-%:
|
|
||||||
${FAIL_SERVER} -v ${ARCH}/$(subst server-,,$@) -b %
|
|
||||||
|
|
||||||
result-%:
|
result-%:
|
||||||
@echo "select variant, benchmark, resulttype, sum(t.time2 - t.time1 + 1) as faults\
|
@echo "select variant, benchmark, resulttype, sum(t.time2 - t.time1 + 1) as faults\
|
||||||
FROM variant v \
|
FROM variant v \
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
WASI_ROOT := /opt/wasi-sdk
|
WASI_ROOT := /opt/wasi-sdk
|
||||||
WAMR := /opt/wamr
|
WAMR := /opt/wamr
|
||||||
|
|
||||||
|
# -O3 generates more code than -O2 (unrolling/inlining etc.)
|
||||||
|
OPT := -O2
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# C -> WASM
|
# C -> WASM
|
||||||
|
|
||||||
@ -34,12 +37,13 @@ ${BUILD_DIR}/%/module.wasm: %.c
|
|||||||
# ${CC} ${LDFLAGS} -o $@
|
# ${CC} ${LDFLAGS} -o $@
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# WASM -> AOT -> Loaded by Runtime (FAIL)
|
# WASM -> AOT
|
||||||
|
|
||||||
WAMRC := /opt/wamr-wamrc/wamrc
|
WAMRC := /opt/wamr-wamrc/wamrc
|
||||||
WAMRCFLAGS := \
|
WAMRCFLAGS := \
|
||||||
--target=i386 \
|
--target=i386 \
|
||||||
--cpu=generic
|
--cpu=generic \
|
||||||
|
--opt-level=0
|
||||||
|
|
||||||
${BUILD_DIR}/%/module.aot: ${BUILD_DIR}/%/module.wasm
|
${BUILD_DIR}/%/module.aot: ${BUILD_DIR}/%/module.wasm
|
||||||
${WAMRC} ${WAMRCFLAGS} -o $@ $<
|
${WAMRC} ${WAMRCFLAGS} -o $@ $<
|
||||||
@ -49,19 +53,23 @@ XXD := busybox xxd
|
|||||||
${BUILD_DIR}/%/module_wasm.c: ${BUILD_DIR}/%/module.aot
|
${BUILD_DIR}/%/module_wasm.c: ${BUILD_DIR}/%/module.aot
|
||||||
${XXD} -i $< > $@
|
${XXD} -i $< > $@
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
# AOT loaded by Runtime (FAIL+Baremetal platform)
|
||||||
|
|
||||||
# NOTE: make build-sum: "error: bp cannot be used in ‘asm’ here"
|
# NOTE: make build-sum: "error: bp cannot be used in ‘asm’ here"
|
||||||
# could remove "ebp" from the clobber list (ARCH_ASM_CLOBBER_ALL) or
|
# could remove "ebp" from the clobber list (ARCH_ASM_CLOBBER_ALL) or
|
||||||
# use the -fomit-frame-pointer flag to tell gcc it shouldn't rely on ebp for enter/leave...
|
# use the -fomit-frame-pointer flag to tell gcc it shouldn't rely on ebp for enter/leave...
|
||||||
CC := /opt/crosscompiler/bin/i386-elf-gcc
|
CC := /opt/crosscompiler/bin/i386-elf-gcc
|
||||||
CFLAGS := \
|
CFLAGS := \
|
||||||
-I. \
|
-I. \
|
||||||
-O0 \
|
${OPT} \
|
||||||
-m32 \
|
-m32 \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-ffreestanding \
|
-ffreestanding \
|
||||||
-fomit-frame-pointer \
|
-fomit-frame-pointer \
|
||||||
-ggdb
|
-ggdb
|
||||||
IWASM_LIB := /opt/wamr-libiwasm # Baremetal
|
IWASM_LIB_DEBUG := /opt/wamr-libiwasm-baremetal-debug
|
||||||
|
IWASM_LIB_RELEASE := /opt/wamr-libiwasm-baremetal-release
|
||||||
LDFLAGS = \
|
LDFLAGS = \
|
||||||
-Wl,-T linker.ld \
|
-Wl,-T linker.ld \
|
||||||
$^ \
|
$^ \
|
||||||
@ -69,7 +77,7 @@ LDFLAGS = \
|
|||||||
-static \
|
-static \
|
||||||
-nostdlib \
|
-nostdlib \
|
||||||
-m32 \
|
-m32 \
|
||||||
-L${IWASM_LIB} \
|
-L${IWASM_LIB_RELEASE} \
|
||||||
-liwasm \
|
-liwasm \
|
||||||
-lc \
|
-lc \
|
||||||
-lgcc \
|
-lgcc \
|
||||||
@ -98,23 +106,24 @@ ${BUILD_DIR}/%/system.elf: ${BUILD_DIR}/%/system.o ${BUILD_DIR}/syscalls.o ${BUI
|
|||||||
${CC} ${LDFLAGS} -o $@
|
${CC} ${LDFLAGS} -o $@
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# WASM -> AOT -> Loaded by Runtime (Host/Linux platform)
|
# AOT loaded by Runtime (Host+Linux platform)
|
||||||
|
|
||||||
CC_LINUX := gcc
|
CC_LINUX := gcc
|
||||||
CFLAGS_LINUX := \
|
CFLAGS_LINUX := \
|
||||||
-I. \
|
-I. \
|
||||||
-O0 \
|
${OPT} \
|
||||||
-m32 \
|
-m32 \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-ggdb
|
-ggdb
|
||||||
IWASM_LIB_LINUX := /opt/wamr-libiwasm-linux
|
IWASM_LIB_LINUX_DEBUG := /opt/wamr-libiwasm-linux-debug
|
||||||
|
IWASM_LIB_LINUX_RELEASE := /opt/wamr-libiwasm-linux-release
|
||||||
LDFLAGS_LINUX = \
|
LDFLAGS_LINUX = \
|
||||||
$^ \
|
$^ \
|
||||||
-Wl,--build-id=none \
|
-Wl,--build-id=none \
|
||||||
-static \
|
-static \
|
||||||
-m32 \
|
-m32 \
|
||||||
-Wl,-rpath,${IWASM_LIB_LINUX} \
|
-Wl,-rpath,${IWASM_LIB_LINUX_RELEASE} \
|
||||||
-L${IWASM_LIB_LINUX} \
|
-L${IWASM_LIB_LINUX_RELEASE} \
|
||||||
-liwasm \
|
-liwasm \
|
||||||
-lm
|
-lm
|
||||||
INCL_LINUX := \
|
INCL_LINUX := \
|
||||||
@ -135,12 +144,12 @@ ${BUILD_DIR}/%/system-linux.elf: ${BUILD_DIR}/%/system-linux.o
|
|||||||
${CC_LINUX} ${LDFLAGS_LINUX} -o $@
|
${CC_LINUX} ${LDFLAGS_LINUX} -o $@
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# WASM -> AOT -> Loaded by Runtime (Host/Baremetal platform)
|
# AOT loaded by Runtime (Host+Baremetal platform)
|
||||||
|
|
||||||
CC_BAREMETAL := /opt/crosscompiler/bin/i386-elf-gcc
|
CC_BAREMETAL := /opt/crosscompiler/bin/i386-elf-gcc
|
||||||
CFLAGS_BAREMETAL := \
|
CFLAGS_BAREMETAL := \
|
||||||
-I. \
|
-I. \
|
||||||
-O0 \
|
${OPT} \
|
||||||
-m32 \
|
-m32 \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-ffreestanding \
|
-ffreestanding \
|
||||||
@ -180,15 +189,25 @@ ${BUILD_DIR}/%/system-baremetal.elf: ${BUILD_DIR}/%/system-baremetal.o ${BUILD_D
|
|||||||
################################################################
|
################################################################
|
||||||
# Fail/Bochs
|
# Fail/Bochs
|
||||||
|
|
||||||
FAIL_BIN ?= /home/fail/bin
|
# FAIL_BIN ?= /home/fail/bin
|
||||||
|
# FAIL_SERVER ?= ${FAIL_BIN}/generic-experiment-server
|
||||||
|
# FAIL_TRACE ?= ${FAIL_BIN}/generic-tracing-client
|
||||||
|
# FAIL_INJECT ?= ${FAIL_BIN}/generic-experiment-client
|
||||||
|
# FAIL_DUMP ?= ${FAIL_BIN}/dump-trace
|
||||||
|
# FAIL_IMPORT ?= ${FAIL_BIN}/import-trace --enable-sanitychecks
|
||||||
|
# FAIL_PRUNE ?= ${FAIL_BIN}/prune-trace
|
||||||
|
# BOCHS_RUNNER ?= ${FAIL_BIN}/bochs-experiment-runner.py
|
||||||
|
# RESULT_BROWSER ?= ${FAIL_BIN}/resultbrowser.py
|
||||||
|
|
||||||
|
FAIL_BIN ?= /home/fail/mars
|
||||||
FAIL_SERVER ?= ${FAIL_BIN}/generic-experiment-server
|
FAIL_SERVER ?= ${FAIL_BIN}/generic-experiment-server
|
||||||
FAIL_TRACE ?= ${FAIL_BIN}/generic-tracing-client
|
FAIL_TRACE ?= ${FAIL_BIN}/fail-x86-tracing
|
||||||
FAIL_INJECT ?= ${FAIL_BIN}/generic-experiment-client
|
FAIL_INJECT ?= ${FAIL_BIN}/generic-experiment-client
|
||||||
FAIL_DUMP ?= ${FAIL_BIN}/dump-trace
|
FAIL_DUMP ?= ${FAIL_BIN}/dump-trace
|
||||||
FAIL_IMPORT ?= ${FAIL_BIN}/import-trace --enable-sanitychecks
|
FAIL_IMPORT ?= ${FAIL_BIN}/import-trace --enable-sanitychecks
|
||||||
FAIL_PRUNE ?= ${FAIL_BIN}/prune-trace
|
FAIL_PRUNE ?= ${FAIL_BIN}/prune-trace
|
||||||
BOCHS_RUNNER ?= ${FAIL_BIN}/bochs-experiment-runner.py
|
BOCHS_RUNNER ?= ${FAIL_BIN}/bochs-experiment-runner.py
|
||||||
RESULT_BROWSER ?= ${FAIL_BIN}/resultbrowser.py
|
RESULT_BROWSER ?= ${FAIL_BIN}/resultbrowser
|
||||||
|
|
||||||
${BUILD_DIR}/%/system.iso: ${BUILD_DIR}/%/system.elf
|
${BUILD_DIR}/%/system.iso: ${BUILD_DIR}/%/system.elf
|
||||||
rm -rf $(shell dirname $<)/grub
|
rm -rf $(shell dirname $<)/grub
|
||||||
@ -209,11 +228,16 @@ ${BUILD_DIR}/%/trace.pb:
|
|||||||
-e ${BUILD_DIR}/$*/system.elf \
|
-e ${BUILD_DIR}/$*/system.elf \
|
||||||
-i ${BUILD_DIR}/$*/system.iso \
|
-i ${BUILD_DIR}/$*/system.iso \
|
||||||
-- \
|
-- \
|
||||||
-Wf,--state-file=${BUILD_DIR}/state \
|
|
||||||
-Wf,--trace-file=${BUILD_DIR}/trace.pb \
|
|
||||||
-Wf,--start-symbol=start_trace \
|
-Wf,--start-symbol=start_trace \
|
||||||
|
-Wf,--save-symbol=start_trace \
|
||||||
-Wf,--end-symbol=stop_trace \
|
-Wf,--end-symbol=stop_trace \
|
||||||
-Wf,--check-bounds
|
-Wf,--state-file=${BUILD_DIR}/$*/state \
|
||||||
|
-Wf,--trace-file=${BUILD_DIR}/$*/trace.pb \
|
||||||
|
-Wf,--elf-file=${BUILD_DIR}/$*/system.elf
|
||||||
|
# -Wf,--check-bounds
|
||||||
|
|
||||||
|
server-%:
|
||||||
|
${FAIL_SERVER} -v ${ARCH}/$(subst server-,,$@) -b % --inject-single-bit --inject-registers
|
||||||
|
|
||||||
client-%:
|
client-%:
|
||||||
${BOCHS_RUNNER} ${BOCHS_RUNNER_ARGS} \
|
${BOCHS_RUNNER} ${BOCHS_RUNNER_ARGS} \
|
||||||
@ -224,13 +248,14 @@ client-%:
|
|||||||
-- \
|
-- \
|
||||||
-Wf,--state-dir=${BUILD_DIR}/$(subst client-,,$@)/state \
|
-Wf,--state-dir=${BUILD_DIR}/$(subst client-,,$@)/state \
|
||||||
-Wf,--trap \
|
-Wf,--trap \
|
||||||
-Wf,--timeout=10 \
|
-Wf,--timeout=500000 \
|
||||||
-Wf,--ok-marker=ok_marker \
|
-Wf,--ok-marker=ok_marker \
|
||||||
-Wf,--fail-marker=fail_marker \
|
-Wf,--fail-marker=fail_marker \
|
||||||
-Wf,--catch-write-textsegment \
|
|
||||||
-Wf,--catch-outerspace \
|
|
||||||
2>/dev/null | grep -B 2 -A 8 'INJECT'
|
2>/dev/null | grep -B 2 -A 8 'INJECT'
|
||||||
|
|
||||||
|
# -Wf,--catch-write-textsegment \
|
||||||
|
# -Wf,--catch-outerspace \
|
||||||
|
|
||||||
inject-%:
|
inject-%:
|
||||||
${BOCHS_RUNNER} ${BOCHS_RUNNER_ARGS} -1 \
|
${BOCHS_RUNNER} ${BOCHS_RUNNER_ARGS} -1 \
|
||||||
-f ${FAIL_INJECT} \
|
-f ${FAIL_INJECT} \
|
||||||
@ -245,18 +270,29 @@ inject-%:
|
|||||||
-Wf,--catch-write-textsegment \
|
-Wf,--catch-write-textsegment \
|
||||||
-Wf,--catch-outerspace
|
-Wf,--catch-outerspace
|
||||||
|
|
||||||
# TODO: Command line interface changed
|
# NOTE: Command line interface changed?
|
||||||
import-arch-%: ${BUILD_DIR}/%/trace.pb ${HOME}/.my.cnf
|
import-arch-%: ${BUILD_DIR}/%/trace.pb ${HOME}/.my.cnf
|
||||||
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem -t $< -e $(shell dirname $<)/system.elf -i mem --memory-type ram
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem -t $< -e $(shell dirname $<)/system.elf -i mem --memory-type ram
|
||||||
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs-trace -t $< -e $(shell dirname $<)/system.elf -i mem --memory-type register
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs-trace -t $< -e $(shell dirname $<)/system.elf -i mem --memory-type register
|
||||||
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs -t $< -e $(shell dirname $<)/system.elf -i regs
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs -t $< -e $(shell dirname $<)/system.elf -i regs
|
||||||
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip -t $< -e $(shell dirname $<)/system.elf -i regs --no-gp --ip
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip -t $< -e $(shell dirname $<)/system.elf -i regs --no-gp --ip
|
||||||
# ${FAIL_PRUNE} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b %% --overwrite
|
|
||||||
${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem -t $< -e $(shell dirname $<)/system.elf -i MemoryImporter
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem -t $< -e $(shell dirname $<)/system.elf -i MemoryImporter
|
||||||
${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs-trace -t $< -e $(shell dirname $<)/system.elf -i MemoryImporter
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs-trace -t $< -e $(shell dirname $<)/system.elf -i MemoryImporter
|
||||||
${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs -t $< -e $(shell dirname $<)/system.elf -i RegisterImporter
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs -t $< -e $(shell dirname $<)/system.elf -i RegisterImporter
|
||||||
${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip -t $< -e $(shell dirname $<)/system.elf -i RegisterImporter --no-gp --ip
|
# ${FAIL_IMPORT} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip -t $< -e $(shell dirname $<)/system.elf -i RegisterImporter --no-gp --ip
|
||||||
${FAIL_PRUNE} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b %% --overwrite
|
|
||||||
|
${FAIL_IMPORT} -t $< -i MemoryImporter -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem
|
||||||
|
${FAIL_IMPORT} -t $< -i RegisterImporter -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs --flags
|
||||||
|
${FAIL_IMPORT} -t $< -i RegisterImporter -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip --no-gp --ip
|
||||||
|
${FAIL_IMPORT} -t $< -i ElfImporter --objdump /usr/bin/objdump -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip
|
||||||
|
${FAIL_IMPORT} -t $< -i ElfImporter --objdump /usr/bin/objdump -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem
|
||||||
|
${FAIL_IMPORT} -t $< -i ElfImporter --objdump /usr/bin/objdump -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs
|
||||||
|
${FAIL_IMPORT} -t $< -i ElfImporter --objdump /usr/bin/objdump -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b ip --sources
|
||||||
|
${FAIL_IMPORT} -t $< -i ElfImporter --objdump /usr/bin/objdump -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b mem --sources
|
||||||
|
${FAIL_IMPORT} -t $< -i ElfImporter --objdump /usr/bin/objdump -e $(shell dirname $<)/system.elf -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b regs --sources
|
||||||
|
|
||||||
|
${FAIL_PRUNE} -v ${ARCH}/$(patsubst import-arch-%,%,$@) -b %% --overwrite
|
||||||
|
|
||||||
define arch-make-targets
|
define arch-make-targets
|
||||||
|
|
||||||
|
|||||||
@ -165,7 +165,35 @@ RUN git clone https://gitea.vps.chriphost.de/christoph/wamr wamrlib \
|
|||||||
# TODO: Should probably put the cross-compilation definitions in a toolchain file
|
# TODO: Should probably put the cross-compilation definitions in a toolchain file
|
||||||
COPY --from=compiler-builder /opt/crosscompiler /opt/crosscompiler
|
COPY --from=compiler-builder /opt/crosscompiler /opt/crosscompiler
|
||||||
WORKDIR /wamrlib
|
WORKDIR /wamrlib
|
||||||
RUN mkdir build_libiwasm && cd build_libiwasm \
|
RUN mkdir build_libiwasm_baremetal_release && cd build_libiwasm_baremetal_release \
|
||||||
|
&& cmake \
|
||||||
|
-DCMAKE_SYSTEM_NAME=Generic \
|
||||||
|
-DCMAKE_SYSTEM_PROCESSOR=i386 \
|
||||||
|
-DCMAKE_C_COMPILER=/opt/crosscompiler/bin/i386-elf-gcc \
|
||||||
|
-DCMAKE_CXX_COMPILER=/opt/crosscompiler/bin/i386-elf-g++ \
|
||||||
|
-DCMAKE_ASM_COMPILER=/opt/crosscompiler/bin/i386-elf-gcc \
|
||||||
|
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_C_FLAGS_RELEASE="-O2 -DNDEBUG" \
|
||||||
|
-DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" \
|
||||||
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||||
|
-DWAMR_BUILD_PLATFORM=baremetal \
|
||||||
|
-DWAMR_BUILD_TARGET=X86_32 \
|
||||||
|
-DWAMR_BUILD_AOT=1 \
|
||||||
|
-DWAMR_BUILD_WAMR_COMPILER=0 \
|
||||||
|
-DWAMR_BUILD_INTERP=1 \
|
||||||
|
-DWAMR_BUILD_FAST_INTERP=0 \
|
||||||
|
-DWAMR_BUILD_JIT=0 \
|
||||||
|
-DWAMR_BUILD_FAST_JIT=0 \
|
||||||
|
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||||
|
-DWAMR_BUILD_LIBC_WASI=0 \
|
||||||
|
-DWAMR_BUILD_SIMD=0 \
|
||||||
|
-DCMAKE_COLOR_DIAGNOSTICS=ON \
|
||||||
|
.. \
|
||||||
|
&& make -j$(nproc)
|
||||||
|
|
||||||
|
WORKDIR /wamrlib
|
||||||
|
RUN mkdir build_libiwasm_baremetal_debug && cd build_libiwasm_baremetal_debug \
|
||||||
&& cmake \
|
&& cmake \
|
||||||
-DCMAKE_SYSTEM_NAME=Generic \
|
-DCMAKE_SYSTEM_NAME=Generic \
|
||||||
-DCMAKE_SYSTEM_PROCESSOR=i386 \
|
-DCMAKE_SYSTEM_PROCESSOR=i386 \
|
||||||
@ -174,6 +202,8 @@ RUN mkdir build_libiwasm && cd build_libiwasm \
|
|||||||
-DCMAKE_ASM_COMPILER=/opt/crosscompiler/bin/i386-elf-gcc \
|
-DCMAKE_ASM_COMPILER=/opt/crosscompiler/bin/i386-elf-gcc \
|
||||||
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
|
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
|
||||||
-DCMAKE_BUILD_TYPE=Debug \
|
-DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DCMAKE_C_FLAGS_DEBUG="-O0 -ggdb" \
|
||||||
|
-DCMAKE_CXX_FLAGS_DEBUG="-O0 -ggdb" \
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||||
-DWAMR_BUILD_PLATFORM=baremetal \
|
-DWAMR_BUILD_PLATFORM=baremetal \
|
||||||
-DWAMR_BUILD_TARGET=X86_32 \
|
-DWAMR_BUILD_TARGET=X86_32 \
|
||||||
@ -192,8 +222,32 @@ RUN mkdir build_libiwasm && cd build_libiwasm \
|
|||||||
|
|
||||||
# Build WAMR libiwasm for the host system
|
# Build WAMR libiwasm for the host system
|
||||||
WORKDIR /wamrlib
|
WORKDIR /wamrlib
|
||||||
RUN mkdir build_libiwasm_linux && cd build_libiwasm_linux \
|
RUN mkdir build_libiwasm_linux_release && cd build_libiwasm_linux_release \
|
||||||
&& cmake \
|
&& cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_C_FLAGS_RELEASE="-O2 -DNDEBUG" \
|
||||||
|
-DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" \
|
||||||
|
-DWAMR_BUILD_PLATFORM=linux \
|
||||||
|
-DWAMR_BUILD_TARGET=X86_32 \
|
||||||
|
-DWAMR_BUILD_AOT=1 \
|
||||||
|
-DWAMR_BUILD_WAMR_COMPILER=0 \
|
||||||
|
-DWAMR_BUILD_INTERP=1 \
|
||||||
|
-DWAMR_BUILD_FAST_INTERP=0 \
|
||||||
|
-DWAMR_BUILD_JIT=0 \
|
||||||
|
-DWAMR_BUILD_FAST_JIT=0 \
|
||||||
|
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||||
|
-DWAMR_BUILD_LIBC_WASI=0 \
|
||||||
|
-DWAMR_BUILD_SIMD=0 \
|
||||||
|
-DCMAKE_COLOR_DIAGNOSTICS=ON \
|
||||||
|
.. \
|
||||||
|
&& make -j$(nproc)
|
||||||
|
|
||||||
|
WORKDIR /wamrlib
|
||||||
|
RUN mkdir build_libiwasm_linux_debug && cd build_libiwasm_linux_debug \
|
||||||
|
&& cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DCMAKE_C_FLAGS_DEBUG="-O0 -ggdb" \
|
||||||
|
-DCMAKE_CXX_FLAGS_DEBUG="-O0 -ggdb" \
|
||||||
-DWAMR_BUILD_PLATFORM=linux \
|
-DWAMR_BUILD_PLATFORM=linux \
|
||||||
-DWAMR_BUILD_TARGET=X86_32 \
|
-DWAMR_BUILD_TARGET=X86_32 \
|
||||||
-DWAMR_BUILD_AOT=1 \
|
-DWAMR_BUILD_AOT=1 \
|
||||||
@ -241,15 +295,12 @@ COPY --from=wamr-builder /wamr/product-mini/platforms/linux/build_iwasm /opt/wam
|
|||||||
RUN ln -sf /opt/wamr/product-mini/platforms/linux/build_iwasm /opt/wamr-iwasm \
|
RUN ln -sf /opt/wamr/product-mini/platforms/linux/build_iwasm /opt/wamr-iwasm \
|
||||||
&& ln -sf /opt/wamr/wamr-compiler/build_wamrc /opt/wamr-wamrc \
|
&& ln -sf /opt/wamr/wamr-compiler/build_wamrc /opt/wamr-wamrc \
|
||||||
&& ln -sf /opt/wamr/wamr-compiler/build_libvmlib /opt/wamr-libvmlib \
|
&& ln -sf /opt/wamr/wamr-compiler/build_libvmlib /opt/wamr-libvmlib \
|
||||||
&& ln -sf /opt/wamr/build_libiwasm /opt/wamr-libiwasm \
|
&& ln -sf /opt/wamr/build_libiwasm_baremetal_release /opt/wamr-libiwasm-baremetal-release \
|
||||||
&& ln -sf /opt/wamr/build_libiwasm_linux /opt/wamr-libiwasm-linux
|
&& ln -sf /opt/wamr/build_libiwasm_baremetal_debug /opt/wamr-libiwasm-baremetal-debug \
|
||||||
|
&& ln -sf /opt/wamr/build_libiwasm_linux_release /opt/wamr-libiwasm-linux-release \
|
||||||
|
&& ln -sf /opt/wamr/build_libiwasm_linux_debug /opt/wamr-libiwasm-linux-debug
|
||||||
|
|
||||||
RUN useradd fail \
|
COPY ./examples /home/ubuntu/examples
|
||||||
&& mkdir /home/fail && chown fail /home/fail \
|
WORKDIR /home/ubuntu/examples
|
||||||
&& echo 'fail:fail' | chpasswd && chsh fail --shell /usr/bin/fish \
|
|
||||||
&& adduser fail sudo
|
|
||||||
|
|
||||||
COPY ./examples /home/fail/examples
|
|
||||||
WORKDIR /home/fail/examples
|
|
||||||
|
|
||||||
ENV PATH="$PATH:/opt/wasi-sdk/bin:/opt/wamr-iwasm:/opt/wamr-wamrc"
|
ENV PATH="$PATH:/opt/wasi-sdk/bin:/opt/wamr-iwasm:/opt/wamr-wamrc"
|
||||||
|
|||||||
Reference in New Issue
Block a user