This commit is contained in:
Jerome Laban 2023-05-11 14:41:42 -04:00
Родитель 0e767fca06
Коммит fe9692c195
8 изменённых файлов: 8 добавлений и 48 удалений

Просмотреть файл

@ -43,17 +43,15 @@ If the bitcode file to be added is named `libTest.bc` or `libTest.a`, the follow
| `libTest.bc/2.0.9/st/libTest.bc` | Emscripten 2.0.9 and later, single threaded |
| `libTest.bc/2.0.6/mt/libTest.bc` | Emscripten 2.0.6 and later, multi threaded |
| `libTest.bc/2.0.9/mt/libTest.bc` | Emscripten 2.0.9 and later, multi threaded |
| `libTest.bc/2.0.6/st,simd/libTest.bc` | Emscripten 2.0.6 and later, single threaded with SIMD |
| `libTest.bc/2.0.9/st,simd/libTest.bc` | Emscripten 2.0.9 and later, single threaded with SIMD |
| `libTest.bc/2.0.6/mt,simd/libTest.bc` | Emscripten 2.0.6 and later, multi threaded with SIMD |
| `libTest.bc/2.0.9/mt,simd/libTest.bc` | Emscripten 2.0.9 and later, multi threaded with SIMD |
Based on the emscripten version used by the .NET runtime and the enabled runtime features, the bootstrapper will choose the closest matching version.
As of bootstrapper 7.0, the following runtime features are supported:
As of bootstrapper 8.0, the following runtime features are supported:
- `st` for Single Threaded runtime
- `mt` for Multi Threaded runtime
- `simd` for SIMD enabled runtime
## Deprecated features
`simd` is deprecated for .NET 8 and is always enabled
#### Static Linking additional emcc flags
Static linking may also require some additional emscripten flags, for instance when using libpng. In such a case, add the following to your project:

Просмотреть файл

@ -199,9 +199,6 @@ namespace Uno.Wasm.Bootstrap
public int PThreadsPoolSize { get; set; } = 4;
[Microsoft.Build.Framework.Required]
public bool EnableSimd { get; set; }
[Microsoft.Build.Framework.Required]
public bool RuntimeDebuggerEnabled { get; set; }
@ -791,7 +788,6 @@ namespace Uno.Wasm.Bootstrap
var runtimeConfigurationParam = $"--runtime-config={RuntimeConfiguration.ToLowerInvariant()}"
+ (EnableThreads ? "-threads" : "") + " "
+ (EnableSimd ? "-simd" : "") + " "
+ (EnableJiterpreter ? "-jiterpreter" : "") + " "
+ (string.IsNullOrWhiteSpace(RuntimeOptions) ? "" : $"--runtime-options \"{RuntimeOptions}\" ");
@ -1389,11 +1385,6 @@ namespace Uno.Wasm.Bootstrap
EnableThreads ? "mt" : "st"
};
if (EnableSimd)
{
features.Add("simd");
}
Log.LogMessage(MessageImportance.Low, $"Bitcode files features lookup filter: {string.Join(",", features)}");
_bitcodeFilesCache = BitcodeFilesSelector.Filter(CurrentEmscriptenVersion, features.ToArray(), _bitcodeFilesCache);

Просмотреть файл

@ -50,9 +50,6 @@ namespace Uno.Wasm.Bootstrap
[Microsoft.Build.Framework.Required]
public bool EnableThreads { get; set; }
[Microsoft.Build.Framework.Required]
public bool EnableSimd { get; set; }
public bool EnableEmscriptenWindows { get; set; } = true;
[Microsoft.Build.Framework.Required]
@ -113,11 +110,6 @@ namespace Uno.Wasm.Bootstrap
sdkUri = sdkUri.Replace(".zip", "-threads.zip");
}
if (EnableSimd)
{
sdkUri = sdkUri.Replace(".zip", "-simd.zip");
}
var sdkName = Path.GetFileNameWithoutExtension(new Uri(sdkUri).AbsolutePath.Replace('/', Path.DirectorySeparatorChar));
Log.LogMessage("NetCore-Wasm SDK: " + sdkName);
SdkPath = Path.Combine(GetMonoTempPath(), sdkName);

Просмотреть файл

@ -24,7 +24,6 @@
<WasmShellBrotliCompressionQuality Condition="'$(WasmShellBrotliCompressionQuality)'==''">7</WasmShellBrotliCompressionQuality>
<WasmShellEmccLinkOptimization Condition="'$(WasmShellEmccLinkOptimization)'=='' and '$(Configuration)'=='Release'">true</WasmShellEmccLinkOptimization>
<WasmShellEnableThreads Condition="'$(WasmShellEnableThreads)'==''">false</WasmShellEnableThreads>
<WasmShellEnableSimd Condition="'$(WasmShellEnableSimd)'==''">false</WasmShellEnableSimd>
<!--
Force all applicable references to be present in the ReferenceCopyLocalPaths property.
@ -185,7 +184,6 @@
CilStripOverrideFolderPath="$(MSBuildThisFileDirectory)/cilstrip"
DisableSDKCheckSumValidation="$(WasmShellDisableSDKCheckSumValidation)"
EnableEmscriptenWindows="$(WasmShellEnableEmscriptenWindows)"
EnableSimd="$(WasmShellEnableSimd)"
EnableThreads="$(WasmShellEnableThreads)"
GenerateAOTProfile="$(WasmShellGenerateAOTProfile)"
IsOSUnixLike="$([MSBuild]::IsOsUnixLike())"
@ -231,7 +229,6 @@
EnableLogProfiler="$(WasmShellEnableLogProfiler)"
EnableLongPathSupport="$(WasmShellEnableLongPathSupport)"
EnableNetCoreICU="$(WasmShellEnableNetCoreICU)"
EnableSimd="$(WasmShellEnableSimd)"
EnableThreads="$(WasmShellEnableThreads)"
ExtraEmccFlags="@(WasmShellExtraEmccFlags)"
ForceDisableWSL="$(WasmShellForceDisableWSL)"

Просмотреть файл

@ -442,7 +442,6 @@ class Driver {
public bool EnableFS;
public bool EnableThreads;
public bool EnableJiterpreter;
public bool Simd;
public bool EnableDynamicRuntime;
public bool LinkerExcludeDeserialization;
public bool EnableCollation;
@ -480,7 +479,6 @@ class Driver {
bool enable_dynamic_runtime = false;
bool is_netcore = false;
bool is_windows = Environment.OSVersion.Platform == PlatformID.Win32NT;
bool enable_simd = false;
var il_strip = false;
var linker_verbose = false;
var runtimeTemplate = "runtime.js";
@ -525,7 +523,6 @@ class Driver {
LinkerVerbose = false,
EnableZLib = false,
EnableFS = false,
Simd = false,
EnableDynamicRuntime = false,
LinkerExcludeDeserialization = true,
EnableCollation = false,
@ -590,7 +587,6 @@ class Driver {
AddFlag (p, new BoolFlag ("jiterpreter", "enable jiterpreter", opts.EnableJiterpreter, b => opts.EnableJiterpreter = b));
AddFlag (p, new BoolFlag ("dedup", "enable dedup pass", opts.EnableDedup, b => opts.EnableDedup = b));
AddFlag (p, new BoolFlag ("dynamic-runtime", "enable dynamic runtime (support for Emscripten's dlopen)", opts.EnableDynamicRuntime, b => opts.EnableDynamicRuntime = b));
AddFlag (p, new BoolFlag ("simd", "enable SIMD support", opts.Simd, b => opts.Simd = b));
AddFlag (p, new BoolFlag ("wasm-exceptions", "enable exceptions", opts.EnableWasmExceptions, b => opts.EnableWasmExceptions = b));
AddFlag (p, new BoolFlag ("linker-exclude-deserialization", "Link out .NET deserialization support", opts.LinkerExcludeDeserialization, b => opts.LinkerExcludeDeserialization = b));
AddFlag (p, new BoolFlag ("collation", "enable unicode collation support", opts.EnableCollation, b => opts.EnableCollation = b));
@ -636,7 +632,6 @@ class Driver {
enable_fs = opts.EnableFS;
enable_threads = opts.EnableThreads;
enable_dynamic_runtime = opts.EnableDynamicRuntime;
enable_simd = opts.Simd;
invariant_globalization = opts.InvariantGlobalization;
// Dedup is disabled by default https://github.com/dotnet/runtime/issues/48814
@ -743,11 +738,6 @@ class Driver {
return 1;
}
if (enable_simd && !is_netcore) {
Console.Error.WriteLine ("--simd is only supported with netcore.");
return 1;
}
//are we working from the tree?
if (sdkdir != null) {
framework_prefix = Path.Combine (tool_prefix, "framework"); //all framework assemblies are currently side built to packager.exe
@ -1330,10 +1320,9 @@ class Driver {
? "; if ($$LastExitCode -ne 0) { exit 1; }"
: "";
if (enable_simd) {
aot_args += "mattr=simd,";
emcc_flags += "-msimd128 ";
}
aot_args += "mattr=simd,";
emcc_flags += "-msimd128 ";
if (is_netcore) {
emcc_flags += $"-DGEN_PINVOKE -I{src_prefix} ";
emcc_flags += $"-emit-llvm ";
@ -1525,7 +1514,7 @@ class Driver {
var exitCommand = is_windows ? failOnError : "|| exit 1";
linker_args.Add($"-out ./linker-out --deterministic --disable-opt unreachablebodies");
linker_args.Add($"-out ./linker-out --deterministic --disable-opt unreachablebodies");\
linker_args.Add($"--strip-link-attributes");
linker_args.Add(extra_linkerflags);
linker_args.AddRange(linkerSearchPaths);

Просмотреть файл

@ -8,17 +8,13 @@ buildSideModule(){
}
buildSideModule "mysideModule.cpp" "../native/side.bc/1.2/side.bc" "1.2" "side" ""
buildSideModule "mysideModule.cpp" "../native/side.bc/1.2/st,simd/side.bc" "1.2" "side" "-msimd128"
buildSideModule "version_test.cpp" "../native/side2.bc/1.3/side2.bc" "1.3" "side2" ""
buildSideModule "version_test.cpp" "../native/side2.bc/1.2/st,simd/side2.bc" "1.2" "side2" "-msimd128"
buildSideModule "version_test.cpp" "../native/side3.bc/1.3/side3.bc" "1.3" "side3" ""
buildSideModule "version_test.cpp" "../native/side3.bc/1.4/side3.bc" "1.4" "side3" ""
buildSideModule "version_test.cpp" "../native/side3.bc/1.4/st,simd/side3.bc" "1.4" "side3" "-msimd128"
buildSideModule "version_test.cpp" "../native/side4.bc/1.3/side4.bc" "1.3" "side4" ""
buildSideModule "version_test.cpp" "../native/side4.bc/2.0/side4.bc" "2.0" "side4" ""
buildSideModule "version_test.cpp" "../native/side4.bc/3.1/side4.bc" "3.1" "side4" ""
buildSideModule "version_test.cpp" "../native/side4.bc/3.1/st,simd/side4.bc" "3.1" "side4" "-msimd128"
buildSideModule "version_test.cpp" "../native/side4.bc/5.0/side4.bc" "5.0" "side4" ""

Просмотреть файл

@ -10,7 +10,6 @@
<UseAOT>true</UseAOT>
<WasmShellMonoRuntimeExecutionMode Condition="'$(UseAOT)'=='true'">InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WasmShellEnableSimd>true</WasmShellEnableSimd>
<!--<WasmShellDisableSDKCheckSumValidation>true</WasmShellDisableSDKCheckSumValidation>-->
</PropertyGroup>

Просмотреть файл

@ -10,8 +10,6 @@
<UseAOT>true</UseAOT>
<WasmShellMonoRuntimeExecutionMode Condition="'$(UseAOT)'=='true'">InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!--<WasmShellDisableSDKCheckSumValidation>true</WasmShellDisableSDKCheckSumValidation>-->
<WasmShellEnableSimd>true</WasmShellEnableSimd>
</PropertyGroup>
<ItemGroup>