From 804111f61fa65ea5fa93e30d9705c6cc068e04d6 Mon Sep 17 00:00:00 2001 From: yowl00 Date: Mon, 18 Nov 2024 17:02:11 -0500 Subject: [PATCH 1/6] add WasmExternalDwarf to create an external_debug_info section and place the DWARF in a separate file --- .../Microsoft.NETCore.Native.Publish.targets | 5 ++++- .../BuildIntegration/Microsoft.NETCore.Native.targets | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index 0edd9c12335c..f547cfafe4f8 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -106,7 +106,10 @@ - + + + + <_FilesToCopyToNative Include="$(NativeOutputPath)\dotnet.native.js" /> <_FilesToCopyToNative Include="$(NativeOutputPath)\dotnet.native.wasm" /> diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 6418e84d3b34..2f8d0eda230e 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -35,6 +35,7 @@ The .NET Foundation licenses this file to you under the MIT license. $(TreatWarningsAsErrors) <_IsiOSLikePlatform Condition="'$(_targetOS)' == 'maccatalyst' or $(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos'))">true <_IsApplePlatform Condition="'$(_targetOS)' == 'osx' or '$(_IsiOSLikePlatform)' == 'true'">true + true @@ -100,6 +101,7 @@ The .NET Foundation licenses this file to you under the MIT license. $(NativeIntermediateOutputPath)$(TargetName)$(NativeObjectExt) $(NativeOutputPath)$(TargetName)$(NativeBinaryExt) + $(NativeOutputPath)$(TargetName).wasm true $(NativeIntermediateOutputPath)$(TargetName)$(ExportsFileExt) @@ -390,9 +392,11 @@ The .NET Foundation licenses this file to you under the MIT license. %(RelativeDir)%(Filename)$(NativeObjectExt) + "%(RelativeDir)%(Filename).dwo" + @@ -439,12 +443,14 @@ The .NET Foundation licenses this file to you under the MIT license. "$(EmscriptenSdkToolsPath)bin/clang++" "$(EMSDK)/upstream/emscripten/emcc$(EmccScriptExt)" "$(EmscriptenSdkToolsPath)emscripten/emcc$(EmccScriptExt)" + "$(EMSDK)/upstream/bin/llvm-dwp$(ExeExt)" + "$(EmscriptenSdkToolsPath)/bin/llvm-dwp$(ExeExt)" "$(WASI_SDK_PATH)/bin/clang++" "$(WASI_SDK_PATH)/bin/clang" - + @@ -575,6 +581,8 @@ The .NET Foundation licenses this file to you under the MIT license. + + From dd84ce5650a71344000fb25f266ae769d7fd67fb Mon Sep 17 00:00:00 2001 From: yowl00 Date: Wed, 20 Nov 2024 13:46:24 -0500 Subject: [PATCH 2/6] Use StripSymbols which is true by default Change extension to just `.debug.wasm` clear up old dwp stuff --- .../Microsoft.NETCore.Native.Publish.targets | 4 ++-- .../BuildIntegration/Microsoft.NETCore.Native.targets | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index f547cfafe4f8..183d7da2d21a 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -107,8 +107,8 @@ - - + + <_FilesToCopyToNative Include="$(NativeOutputPath)\dotnet.native.js" /> diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 2f8d0eda230e..d15e0bfa523b 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -35,7 +35,6 @@ The .NET Foundation licenses this file to you under the MIT license. $(TreatWarningsAsErrors) <_IsiOSLikePlatform Condition="'$(_targetOS)' == 'maccatalyst' or $(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos'))">true <_IsApplePlatform Condition="'$(_targetOS)' == 'osx' or '$(_IsiOSLikePlatform)' == 'true'">true - true @@ -443,8 +442,6 @@ The .NET Foundation licenses this file to you under the MIT license. "$(EmscriptenSdkToolsPath)bin/clang++" "$(EMSDK)/upstream/emscripten/emcc$(EmccScriptExt)" "$(EmscriptenSdkToolsPath)emscripten/emcc$(EmccScriptExt)" - "$(EMSDK)/upstream/bin/llvm-dwp$(ExeExt)" - "$(EmscriptenSdkToolsPath)/bin/llvm-dwp$(ExeExt)" @@ -543,6 +540,7 @@ The .NET Foundation licenses this file to you under the MIT license. true + $([System.IO.Path]::ChangeExtension('$(NativeBinary)', '.debug.wasm')) @@ -581,8 +579,7 @@ The .NET Foundation licenses this file to you under the MIT license. - - + From e8fd31f54ca8164c6db89bfc160ca1af52d654a4 Mon Sep 17 00:00:00 2001 From: yowl00 Date: Wed, 20 Nov 2024 14:59:07 -0500 Subject: [PATCH 3/6] move gseparate-dwarf to browser/emcc ItemGroup --- .../nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index d15e0bfa523b..38d8c5c9939c 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -579,7 +579,6 @@ The .NET Foundation licenses this file to you under the MIT license. - @@ -592,6 +591,7 @@ The .NET Foundation licenses this file to you under the MIT license. + From 27e99ef186bcd63be7261b47e7bd1eec4b923035 Mon Sep 17 00:00:00 2001 From: yowl Date: Thu, 21 Nov 2024 18:01:47 +0000 Subject: [PATCH 4/6] Update src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> --- .../nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 38d8c5c9939c..aa1a7243f541 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -100,7 +100,6 @@ The .NET Foundation licenses this file to you under the MIT license. $(NativeIntermediateOutputPath)$(TargetName)$(NativeObjectExt) $(NativeOutputPath)$(TargetName)$(NativeBinaryExt) - $(NativeOutputPath)$(TargetName).wasm true $(NativeIntermediateOutputPath)$(TargetName)$(ExportsFileExt) From b12b969a1d7f41d35035dd6d8632e6fa0a014cc3 Mon Sep 17 00:00:00 2001 From: yowl Date: Thu, 21 Nov 2024 18:02:16 +0000 Subject: [PATCH 5/6] Update src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets Thanks Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com> --- .../nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index aa1a7243f541..d26e02924e24 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -390,11 +390,9 @@ The .NET Foundation licenses this file to you under the MIT license. %(RelativeDir)%(Filename)$(NativeObjectExt) - "%(RelativeDir)%(Filename).dwo" - From 5cffb730fa4b8b54f5718bbc4074983f66daa285 Mon Sep 17 00:00:00 2001 From: yowl00 Date: Sat, 7 Dec 2024 09:34:44 -0500 Subject: [PATCH 6/6] feedback, drop DotNetJsApi condition --- .../BuildIntegration/Microsoft.NETCore.Native.Publish.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index 183d7da2d21a..03311e67ab4e 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -107,8 +107,8 @@ - - + + <_FilesToCopyToNative Include="$(NativeOutputPath)\dotnet.native.js" />