build.sh 891 B

1234567891011121314151617181920212223242526272829303132
  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=fib2 \
  10. -Wl,--export=test1 \
  11. -Wl,--export=test2 \
  12. -Wl,--export=test3 \
  13. -Wl,--export=test4 \
  14. -Wl,--export=__data_end -Wl,--export=__heap_base \
  15. -Wl,--strip-all,--no-entry \
  16. -Wl,--allow-undefined \
  17. -nostdlib \
  18. echo "Build binarydump tool .."
  19. rm -fr build && mkdir build && cd build
  20. cmake ../../../../../test-tools/binarydump-tool
  21. make
  22. cd ..
  23. echo "Generate test_wasm.h .."
  24. ./build/binarydump -o test_wasm.h -n wasm_test_file test.wasm
  25. rm -fr build
  26. echo "Done"