build.sh 730 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. WAMR_DIR=${PWD}/../../..
  4. echo "Build wasm app .."
  5. /opt/wasi-sdk/bin/clang -O3 \
  6. -z stack-size=4096 -Wl,--initial-memory=65536 \
  7. -o test.wasm main.c \
  8. -Wl,--export=main -Wl,--export=__main_argc_argv \
  9. -Wl,--export=__data_end -Wl,--export=__heap_base \
  10. -Wl,--strip-all,--no-entry \
  11. -Wl,--allow-undefined \
  12. -nostdlib \
  13. echo "Build binarydump tool .."
  14. rm -fr build && mkdir build && cd build
  15. cmake ../../../../test-tools/binarydump-tool
  16. make
  17. cd ..
  18. echo "Generate test_wasm.h .."
  19. ./build/binarydump -o test_wasm.h -n wasm_test_file test.wasm
  20. echo "Done"