diff --git a/utils/webassembly/sdkroot/README.md b/utils/webassembly/sdkroot/README.md deleted file mode 100644 index db8048d2a504d..0000000000000 --- a/utils/webassembly/sdkroot/README.md +++ /dev/null @@ -1,87 +0,0 @@ -SwiftWasm: Getting started -========================== - -Thank you for trying SwiftWasm! Here's how to get started. - -Please visit our website at https://swiftwasm.org for the latest updates. - - -Install dependencies -==================== - -Before running SwiftWasm, you will need to install some dependencies. - -Ubuntu: - -``` -sudo apt-get install libatomic1 -``` - -macOS: - -(No dependencies needed.) - -Windows: - -Install Windows Subsystem for Linux, then follow the Ubuntu instructions. - - - - -Compile SwiftWasm -================= - -Run - -``` -./swiftwasm example/hello.swift hello.wasm -``` - -To compile example/hello.swift to hello.wasm. - - - - -Running Wasm files -================== - -To run the resulting hello.wasm file: - -- Visit https://swiftwasm.org/polyfill/ -- select "Browse", and choose the hello.wasm file -- you should get output in the textbox. - -This polyfill should work in Firefox 66, Chrome 74, and Safari 12.1. - -You can also run the file outside a browser with: - -- Wasmtime https://github.com/CraneStation/wasmtime -- Lucet https://github.com/swiftwasm/lucet/tree/swiftwasm -- or any other WASI-compatible WebAssembly runtime. - - - - -Questions and support -===================== - -If you have any questions, please open an issue on - -https://github.com/swiftwasm/swift - - - -Third-party licenses -==================== - -This package contains components with their own license requirements. - -Swift compiler: https://github.com/apple/swift/blob/master/LICENSE.txt - -LLVM/Clang: https://github.com/llvm/llvm-project/blob/master/lld/LICENSE.TXT - -WASI sysroot: https://github.com/CraneStation/wasi-sysroot/blob/master/LICENSE - -ICU: https://github.com/unicode-org/icu/blob/master/icu4c/LICENSE - -WASI polyfill: https://github.com/CraneStation/wasmtime/blob/master/wasmtime-wasi/LICENSE diff --git a/utils/webassembly/sdkroot/example/hello.swift b/utils/webassembly/sdkroot/example/hello.swift deleted file mode 100644 index e61506705879c..0000000000000 --- a/utils/webassembly/sdkroot/example/hello.swift +++ /dev/null @@ -1 +0,0 @@ -print("Hello, 🌐!") diff --git a/utils/webassembly/sdkroot/extra_utils/generateModulemap.sh b/utils/webassembly/sdkroot/extra_utils/generateModulemap.sh deleted file mode 100755 index 940e5a413339b..0000000000000 --- a/utils/webassembly/sdkroot/extra_utils/generateModulemap.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec sed -e "s@\"/include@\"$1/include@g" "$(dirname $0)/glibc.modulemap" diff --git a/utils/webassembly/sdkroot/swiftwasm b/utils/webassembly/sdkroot/swiftwasm deleted file mode 100755 index 278ce7dbc256a..0000000000000 --- a/utils/webassembly/sdkroot/swiftwasm +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -e - -if [ "$#" -lt 2 ] -then - echo "usage: swiftwasm file1.swift file2.swift.... output.wasm" - exit 1 -fi -sdk="$(dirname $0)" -tmpobj="$(mktemp -t swiftwasm-XXXXXXXX)" -outputfile="${@: -1}" -if [[ "$outputfile" != *.wasm ]] -then - echo "output should end in .wasm" - exit 1 -fi -sysroot="$(dirname $0)/wasi-sdk/share/sysroot" -abssysroot="$(cd "$(dirname "$sysroot")" && pwd)/$(basename "$sysroot")" - -"$sdk/extra_utils/generateModulemap.sh" "$abssysroot" >"$sdk/opt/swiftwasm-sdk/lib/swift/wasi/wasm32/glibc.modulemap" - -"$sdk/opt/swiftwasm-sdk/bin/swiftc" -target wasm32-unknown-unknown-wasi \ - -sdk "$sysroot" -O -c \ - -o "$tmpobj" \ - "${@:1:$#-1}" -"$sdk/wasi-sdk/bin/wasm-ld" --error-limit=0 -o "$outputfile" \ - "$sysroot/lib/wasm32-wasi/crt1.o" \ - "$sdk/opt/swiftwasm-sdk/lib/swift_static/wasi/wasm32/swiftrt.o" \ - "$tmpobj" \ - "-L$sdk/opt/swiftwasm-sdk/lib/swift_static/wasi" \ - "-L$sysroot/lib/wasm32-wasi" \ - "-L$sdk/icu_out/lib" \ - -lswiftCore \ - -lc -lc++ -lc++abi -lswiftImageInspectionShared \ - -licuuc -licudata \ - "$sdk/wasi-sdk/lib/clang/9.0.0/lib/wasi/libclang_rt.builtins-wasm32.a" \ - "$sdk/extra_objs/fakepthread.o" \ - --no-gc-sections \ - --no-threads -rm "$tmpobj"