0m.sh 946 B

1234567891011121314151617181920212223242526
  1. #/bin/sh -x
  2. echo "tested with clang-7"
  3. clang --version
  4. echo "adding memory support with -Wl,--import-memory for lenstr.c"
  5. clang --target=wasm32 --no-standard-libraries -Wl,--export-all -Wl,--import-memory -Wl,--no-entry -o lenstr.wasm lenstr.c
  6. exit 0
  7. on debian with clang version 7, lld-7 as separate package installed
  8. missing link to /usr/bin/ldd added to /usr/bin/ldd-7
  9. The options passed to clang are:
  10. --target=wasm32 Set the build target to wasm.
  11. --no-standard-libraries Do not use libc (more on this later).
  12. -Wl,--export-all Export all symbols (i.e., add) from the compiled wasm file so that they can be used from JavaScript.
  13. -Wl,--no-entry Don't check for a main function.
  14. -o Set the output destination.
  15. -Wl,--import-memory for memory usage
  16. Options preceded by -Wl, are passed from the LLVM compiler to the linker.
  17. The webserver to use is:
  18. pythom -m SimpleHTTPServer
  19. Then the page is on localhost at port 8000