Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ public async Task ExtraEmccFlagsSetButNoRealChange(Configuration config, bool ao
ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "rebuild_flags");
BuildPaths paths = await FirstNativeBuildAndRun(info, config, aot, requestNativeRelink: true, invariant: false);
var pathsDict = GetFilesTable(info.ProjectName, aot, paths, unchanged: true);
bool dotnetNativeFilesUnchanged = extraLDFlags.Length == 0 && extraCFlags.Length == 0;
bool dotnetNativeFilesUnchanged = extraLDFlags.Length == 0;
if (!dotnetNativeFilesUnchanged)
pathsDict.UpdateTo(unchanged: false, "dotnet.native.wasm", "dotnet.native.js");

if (extraCFlags.Length != 0)
pathsDict.UpdateTo(unchanged: false, "driver.o", "runtime.o", "corebindings.o", "pinvoke.o");

var originalStat = StatFiles(pathsDict);

// Rebuild
Expand All @@ -56,9 +53,8 @@ public async Task ExtraEmccFlagsSetButNoRealChange(Configuration config, bool ao
// and thus doesn't cause relinking
TestUtils.AssertSubstring("pinvoke.c -> pinvoke.o", output, contains: extraCFlags.Length > 0);

// ldflags or cflags: link step args change, so it should trigger relink
// ldflags: link step args change, so it should trigger relink
TestUtils.AssertSubstring("Linking with emcc", output, contains: !dotnetNativeFilesUnchanged);

if (aot)
{
// ExtraEmccLDFlags does not affect .bc files
Expand Down
6 changes: 3 additions & 3 deletions src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void WasmNativeStripDefaultWithBuild(Configuration config, string extraPr
CheckPropertyValues(line,
wasmBuildNative: expectedWasmBuildNativeValue,
wasmNativeStrip: expectedWasmNativeStripValue,
wasmNativeDebugSymbols: config == Configuration.Debug && !expectedWasmNativeStripValue,
wasmNativeDebugSymbols: true,
wasmBuildingForNestedPublish: null);
}

Expand All @@ -158,7 +158,7 @@ public void WasmNativeStripDefaultWithPublish(Configuration config, string extra
CheckPropertyValues(line,
wasmBuildNative: expectedWasmBuildNativeValue,
wasmNativeStrip: expectedWasmNativeStripValue,
wasmNativeDebugSymbols: false,
wasmNativeDebugSymbols: true,
wasmBuildingForNestedPublish: true);
}

Expand Down Expand Up @@ -233,7 +233,7 @@ private void InferAndCheckPropertyValues(string? line, bool isPublish, bool wasm
}
else
{
expectedWasmNativeDebugSymbols = false;
expectedWasmNativeDebugSymbols = true;
expectedWasmNativeStripValue = true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/mono/wasm/build/WasmApp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
</PropertyGroup>

<PropertyGroup>
<WasmNativeDebugSymbols Condition="'$(WasmNativeDebugSymbols)' == ''">false</WasmNativeDebugSymbols>
<WasmNativeDebugSymbols Condition="'$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == ''">true</WasmNativeStrip>
</PropertyGroup>
</Target>
Expand Down Expand Up @@ -911,8 +911,8 @@
<Target Name="_RunWasmOptPostLink" Condition="'$(WasmRunWasmOpt)' == 'true'">
<Error Condition="'$(_WasmOutputFileName)' == ''" Text="Could not determine %24(_WasmOutputFileName)" />

<Message Text="Running wasm-opt with --strip-target-features --post-emscripten -O2 --low-memory-unused --zero-filled-memory --pass-arg=directize-initial-contents-immutable --mvp-features --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-sign-ext --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ')" Importance="High" />
<Exec Command="wasm-opt$(_ExeExt) --strip-target-features --post-emscripten -O2 --low-memory-unused --zero-filled-memory --pass-arg=directize-initial-contents-immutable --mvp-features --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-sign-ext --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ') &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot; -o &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot;"
<Message Text="Running wasm-opt with --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ')" Importance="High" />
<Exec Command="wasm-opt$(_ExeExt) --enable-simd --enable-exception-handling --enable-bulk-memory @(WasmOptConfigurationFlags, ' ') &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot; -o &quot;$(_WasmIntermediateOutputPath)$(_WasmOutputFileName)&quot;"
IgnoreStandardErrorWarningFormat="true"
EnvironmentVariables="@(WasmToolchainEnvVars)" />
</Target>
Expand Down