diff options
author | Zoltan Varga <vargaz@gmail.com> | 2020-02-29 07:41:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 07:41:03 +0300 |
commit | 89902e8d22b1b48bdd87bbe85f50f682e6d09369 (patch) | |
tree | 52661c8b7de868b194c3aa7d6272b798b9eb7cf8 /sdks | |
parent | 1a6eb5a597b962bc4acf83fbfbf9c1c13076d784 (diff) |
[wasm] Pass --exclude-feature deserialization to the linker. (#19031)
* [wasm] Pass --exclude-feature deserialization to the linker.
* Add a --linker-exclude-deserialization packager option.
Diffstat (limited to 'sdks')
-rw-r--r-- | sdks/wasm/Makefile | 2 | ||||
-rw-r--r-- | sdks/wasm/packager.cs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sdks/wasm/Makefile b/sdks/wasm/Makefile index c52364d308c..e213b2cbde3 100644 --- a/sdks/wasm/Makefile +++ b/sdks/wasm/Makefile @@ -375,7 +375,7 @@ build-debug-sample: debug_sample/dotnet.js TEST_ASSEMBLIES = $(WASM_BCL_DIR)/nunitlite.dll $(WASM_BCL_DIR)/tests/wasm_corlib_test.dll $(WASM_BCL_DIR)/tests/wasm_System_test.dll $(WASM_BCL_DIR)/tests/wasm_System.Core_test.dll build-test-suite: packager.exe $(WASM_FRAMEWORK)/.stamp-framework binding_tests.dll mini_tests.dll main.exe runtime-tests.js - $(PACKAGER) --emscripten-sdkdir=$(EMSCRIPTEN_SDK_DIR) --template=runtime-tests.js --appdir=bin/test-suite --builddir=obj/test-suite --asset=tests/runtime/index.html binding_tests.dll mini_tests.dll main.exe $(TEST_ASSEMBLIES) --linker + $(PACKAGER) --emscripten-sdkdir=$(EMSCRIPTEN_SDK_DIR) --template=runtime-tests.js --appdir=bin/test-suite --builddir=obj/test-suite --asset=tests/runtime/index.html binding_tests.dll mini_tests.dll main.exe $(TEST_ASSEMBLIES) --linker --no-linker-exclude-deserialization ninja -v -C obj/test-suite XUNIT_DIR = $(TOP)/external/xunit-binaries diff --git a/sdks/wasm/packager.cs b/sdks/wasm/packager.cs index a2ce79d67b7..a9f4ae17f75 100644 --- a/sdks/wasm/packager.cs +++ b/sdks/wasm/packager.cs @@ -370,6 +370,7 @@ class Driver { public bool NativeStrip; public bool Simd; public bool EnableDynamicRuntime; + public bool LinkerExcludeDeserialization; } int Run (string[] args) { @@ -429,7 +430,8 @@ class Driver { EnableFS = false, NativeStrip = true, Simd = false, - EnableDynamicRuntime = false + EnableDynamicRuntime = false, + LinkerExcludeDeserialization = true }; var p = new OptionSet () { @@ -475,6 +477,7 @@ class Driver { AddFlag (p, new BoolFlag ("dynamic-runtime", "enable dynamic runtime (support for Emscripten's dlopen)", opts.EnableDynamicRuntime, b => opts.EnableDynamicRuntime = b)); AddFlag (p, new BoolFlag ("native-strip", "strip final executable", opts.NativeStrip, b => opts.NativeStrip = b)); AddFlag (p, new BoolFlag ("simd", "enable SIMD support", opts.Simd, b => opts.Simd = b)); + AddFlag (p, new BoolFlag ("linker-exclude-deserialization", "Link out .NET deserialization support", opts.LinkerExcludeDeserialization, b => opts.LinkerExcludeDeserialization = b)); var new_args = p.Parse (args).ToArray (); foreach (var a in new_args) { @@ -1109,6 +1112,8 @@ class Driver { linker_args += "--used-attrs-only true "; linker_args += "--substitutions linker-subs.xml "; linker_infiles += "| linker-subs.xml"; + if (opts.LinkerExcludeDeserialization) + linker_args += "--exclude-feature deserialization "; if (!string.IsNullOrEmpty (linkDescriptor)) { linker_args += $"-x {linkDescriptor} "; foreach (var assembly in root_assemblies) { |