Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Scheuer <info@creatix.dk>2018-02-04 03:47:18 +0300
committerMorgan Brown <morganbr@users.noreply.github.com>2018-02-04 03:47:18 +0300
commitf19daaae780f2b0b2675792a8b0ef071dc1e58ff (patch)
tree638ec60b9f3f2c538b9288a1f8ab32f8dc8f0048 /Documentation
parent2aaccdfc08dc2217bbc1777d4c98dda2a4867fb7 (diff)
Add support for building wasm on OSX and Ubuntu 16 (#5297)
* Enable wasm building on OSX. Upgrade libLLVM to 4.0.0 and LLVMSharp to 5.0.0 LLVM upgrade: Fix 'Use still stuck around after Def is destroyed' of the deleted basic blocks Add wasm support in runtest.sh Remove HelloWasm.csproj reference to .ilproj on non-windows OS because of dependency on ilasm Fix LinkNative target to execute correct commands for Unix wasm builds. Added support for building on Ubuntu 16.04.3 Update documentation on how to build WebAssembly.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/how-to-build-WebAssembly.md29
1 files changed, 24 insertions, 5 deletions
diff --git a/Documentation/how-to-build-WebAssembly.md b/Documentation/how-to-build-WebAssembly.md
index 72fb034b2..84e6ed6df 100644
--- a/Documentation/how-to-build-WebAssembly.md
+++ b/Documentation/how-to-build-WebAssembly.md
@@ -1,5 +1,6 @@
# Build WebAssembly #
-Currently, building WebAssembly is only possible on Windows.
+
+## Build WebAssembly on Windows ##
1. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
2. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to the latest version.
@@ -7,15 +8,33 @@ Currently, building WebAssembly is only possible on Windows.
4. Build the WebAssembly runtime by running ```build.cmd wasm``` from the repo root.
5. Run the WebAssembly "Hello World" test by running ```C:\corert\tests\runtest.cmd wasm```.
-To debug compiling WebAssembly:
+## Build WebAssembly on OSX ##
+
+1. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
+2. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to the latest version.
+3. Get CoreRT set up by installing [Prerequisites](prerequisites-for-building.md).
+4. Build the WebAssembly runtime by running ```./build.sh wasm``` from the repo root.
+5. Run the WebAssembly "Hello World" test by opening it in [Firefox](https://www.getfirefox.com).
+
+## Build WebAssembly on Ubuntu 16.04.3 ##
+
+1. Get CoreRT set up by installing [Prerequisites](prerequisites-for-building.md), except install ```libicu55``` for Ubuntu 16 instead of ```libicu52```.
+2. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
+3. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to the latest version.
+4. Build the WebAssembly runtime by running ```./build.sh wasm``` from the repo root.
+5. Run the WebAssembly "Hello World" test by opening it in [Firefox](https://www.getfirefox.com).
+
+
+# How to debug the IL->WebAssembly compilation #
+This is Windows only for now.
1. Set the ILCompiler startup command line to ```@C:\corert\tests\src\Simple\HelloWasm\obj\Debug\wasm\native\HelloWasm.ilc.rsp```. That will generate HelloWasm.bc, an LLVM bitcode file.
2. To compile that to WebAssembly, run ```emcc HelloWasm.bc -s ALLOW_MEMORY_GROWTH=1 C:\corert\bin\WebAssembly.wasm.Debug\sdk\libPortableRuntime.bc C:\corert\bin\WebAssembly.wasm.Debug\sdk\libbootstrappercpp.bc -s WASM=1 -o HelloWasm.html``` (if emcc isn't on your path, you'll need to launch an Emscripten command prompt to do this). That will generate a .wasm file with your code as well as html and js files to run it.
-To run a WebAssembly application
-1. Ensure you have Edge 41 or above or [Firefox](https://www.getfirefox.com).
+# How to run a WebAssembly application #
+1. Ensure you have Edge 41 (Windows only) or above or [Firefox](https://www.getfirefox.com).
2. Open the generated html file in Edge or Firefox and look at the on-screen console for output.
-Useful tips:
+# Useful tips #
* To manually make ILC compile to WebAssembly, add ```--wasm``` to the command line.
* Add ```-g3``` to the emcc command line to generate more debuggable output and a .wast file with the text form of the WebAssembly.
* Omit ```-s WASM=1``` from the emcc command line to generate asm.js. Browser debuggers currently work better with asm.js and it's often a bit more readable than wast.