Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Update mono to a14f41c #566

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62,579 changes: 31,613 additions & 30,966 deletions src/mono/dist/unoptimized/asmjs/mono.asm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/mono/dist/unoptimized/asmjs/mono.js

Large diffs are not rendered by default.

Binary file modified src/mono/dist/unoptimized/asmjs/mono.js.mem
Binary file not shown.
2 changes: 1 addition & 1 deletion src/mono/dist/unoptimized/wasm/mono.js

Large diffs are not rendered by default.

Binary file modified src/mono/dist/unoptimized/wasm/mono.wasm
Binary file not shown.
45 changes: 35 additions & 10 deletions src/mono/incoming/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Contents
- bcl Directory. Core libraries to be used with the runtime.
- driver.c, libmonosgen-2.0.a, library_mono.js: Source / Binaries for custom building the runtime. See compilation instructions down.
- debug, release: Pre-compiled runtimes using the above driver in release and debug configurations.
- sample.html / sample.cs: Sample code, see sample details down there.
- **bcl** directory: Core libraries to be used with the runtime.
- **driver.c**, **libmonosgen-2.0.a**, **library_mono.js**: Source / Binaries for custom building the runtime. See compilation instructions down.
- **debug**, **release** directories: Pre-compiled runtimes using the above driver in release and debug configurations.
- **sample.html**, **sample.cs**: Sample code, see sample details below.


# Compiling mono

Mono requires the latest emscripten installed and built[1]. The pre-built binaries are compiled using the following command line for the debug build:
Mono requires the latest emscripten installed and built[1]. Emscripten is *not* required if simply using the sample.
The pre-built binaries are compiled using the following command line for the debug build:

```
emcc -g4 -Os -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN=1 -s "BINARYEN_TRAP_MODE='clamp'" -s TOTAL_MEMORY=134217728 -s ALIASING_FUNCTION_POINTERS=0 -s ASSERTIONS=2 --js-library library_mono.js driver.o $(TOP)/sdks/out/wasm-interp/lib/libmonosgen-2.0.a -o debug/mono.js -s NO_EXIT_RUNTIME=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'FS_createPath', 'FS_createDataFile', 'cwrap', 'setValue', 'getValue', 'UTF8ToString']"
Expand All @@ -16,29 +17,53 @@ Mono requires the latest emscripten installed and built[1]. The pre-built binari

# Sample

## Step 1
To setup the sample, first you need to compile & setup a directory to serve binaries:

**Linux / Mac**
```
mkdir managed
cp bcl/mscorlib.dll managed/
csc /nostdlib /target:library /r:managed/mscorlib.dll /out:managed/sample.dll sample.cs
```
**Windows**

Second, pick a pre-built runtime from one of the directories and copy all files to the the root SDK directory:
The **csc** executable is a build tool that is installed with Visual Studio. For the commands below, using a command window opened using a *Developer Command Prompt for Visual Studio* is convenient.
```
md managed
copy bcl\mscorlib.dll managed
csc /nostdlib /target:library /r:managed/mscorlib.dll /out:managed/sample.dll sample.cs
```

## Step 2
Pick a pre-built runtime from one of the directories and copy all files to the root SDK directory. Allow file overwrites if necessary:

**Linux / Mac**
```
cp debug/* .
```
**Windows**
```
copy debug\* .
```

Once that's done, Start a web server from the SDK directory (where sample.html is):
## Step 3
Start a web server from the SDK directory (where sample.html is):

```
python -m SimpleHTTPServer
```

Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation.
The included server.py script solves this and can be used instead.
Unfortunately, the above http server does not give wasm binaries the right mime type, which disables WebAssembly stream compilation.
The included server.py script solves this and can be used instead:
```
python server.py
```

## Step 4
From within a browser, go to `locahost:8000/sample.html` to see the sample app, which will show a text box (allowing C# code to be entered) and **Run** button when successfully built.

Go to `locahost:8000/sample.html` and it should work.

[1] https://github.com/kripken/emscripten

[2] https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs
Binary file modified src/mono/incoming/bcl/Facades/System.Collections.Concurrent.dll
Binary file not shown.
Binary file not shown.
Binary file modified src/mono/incoming/bcl/Facades/System.Memory.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/Facades/System.Net.WebSockets.Client.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/Facades/System.Text.RegularExpressions.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/Facades/netstandard.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/Microsoft.CSharp.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/Mono.CSharp.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Core.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Data.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Drawing.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.IO.Compression.FileSystem.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Numerics.Vectors.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Numerics.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Runtime.CompilerServices.Unsafe.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.Security.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/System.dll
Binary file not shown.
Binary file modified src/mono/incoming/bcl/mscorlib.dll
Binary file not shown.
Binary file modified src/mono/incoming/libmonosgen-2.0.a
Binary file not shown.