Skip to content

Commit

Permalink
feat: Add support for *.a files linking
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Mar 24, 2020
1 parent b270071 commit cea619a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ Support for [Emscripten's dynamic linking](https://github.com/emscripten-core/em
Instead, use Static Linking below.
#### Static Linking
Statically linking Emscripten LLVM Bitcode (`.bc` files) files to mono is supported on both Windows 10 and Linux. To build on Windows please refer to the AOT environment setup instructions.
Statically linking Emscripten LLVM Bitcode (`.bc` and `.a` files) files to mono is supported on both Windows 10 and Linux. To build on Windows please refer to the AOT environment setup instructions.
This linking type embeds the `.bc` files with the rest of the WebAssembly modules, and uses _normal_
This linking type embeds the `.bc` or `.a` files with the rest of the WebAssembly modules, and uses _normal_
webassembly function invocations that are faster than with dynamic linking.
Any `.bc` file placed as content in the built project will be statically linked to
Any `.bc` or `.a` file placed as content in the built project will be statically linked to
the currently running application, allowing for p/invoke to be functional when resolving methods
from the loaded module.
Expand Down Expand Up @@ -503,7 +503,7 @@ The integration with WSL provides a way for using AOT, Mixed mode or external bi
This feature is active only if one of those condition is true:
- The `WasmShellMonoRuntimeExecutionMode` property is `FullAOT` or `InterpreterAndAOT
- There is a `*.bc` file in the `Content` item group
- There is a `*.bc` or `*.a` file in the `Content` item group
- The `WasmShellForceUseWSL` is set to `true`
Otherwise, the WSL integration is not used and the mono runtime present in the SDK is used as-is.
Expand Down
8 changes: 7 additions & 1 deletion src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ private void CleanupDist()
var unusedFiles = new[] {
"*.wast",
"*.bc",
"*.a",
};

foreach (var unusedFile in unusedFiles)
Expand Down Expand Up @@ -774,7 +775,12 @@ private IEnumerable<string> GetDynamicLibrariesParams() =>

private IEnumerable<string> GetBitcodeFilesParams()
{
_bitcodeFilesCache = _bitcodeFilesCache ?? Directory.EnumerateFiles(_distPath, "*.bc", SearchOption.TopDirectoryOnly).ToArray();
var bitcodeFiles = new[] { "*.bc", "*.a" };

_bitcodeFilesCache = _bitcodeFilesCache ?? bitcodeFiles
.SelectMany(b => Directory.EnumerateFiles(_distPath, b, SearchOption.TopDirectoryOnly))
.ToArray();

return _bitcodeFilesCache;
}

Expand Down

0 comments on commit cea619a

Please sign in to comment.