From 64c664e376fc65d6019e72c13a305df043a692ac Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Thu, 11 Mar 2021 23:46:35 -0600 Subject: [PATCH] improve wasm aot symbolification when striping isn't enabled --- src/mono/wasm/build/WasmApp.targets | 5 ++++- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 964b162645555a..5b02fa600a0aeb 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -143,7 +143,9 @@ UseLLVM="true" DisableParallelAot="true" DedupAssembly="$(_WasmDedupAssembly)" - LLVMPath="$(EMSDK_PATH)\upstream\bin"> + LLVMPath="$(EMSDK_PATH)\upstream\bin" + LLVMDebug="dwarfdebug"> + @@ -279,6 +281,7 @@ $(_DefaultEmccFlags) $(EmccFlags) $(EmccFlags) -s DISABLE_EXCEPTION_CATCHING=0 + $(EmccFlags) -g $(EmccFlags) -DENABLE_AOT=1 -DDRIVER_GEN=1 $(EmccFlags) -DINVARIANT_GLOBALIZATION=1 diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index fc5f9b70c43cde..0c3d31a2d132de 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -126,6 +126,11 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task /// public string? DedupAssembly { get; set; } + /// Debug option in llvm aot mode + /// defaults to "nodebug" since some targes can't generate debug info + /// + public string? LLVMDebug { get; set; } = "nodebug"; + [Output] public string[]? FileWrites { get; private set; } @@ -270,7 +275,9 @@ private bool PrecompileLibrary(ITaskItem assemblyItem, string? monoPaths) { processArgs.Add("--llvm"); - aotArgs.Add($"nodebug"); // can't use debug symbols with LLVM + if (!string.IsNullOrEmpty(LLVMDebug)) + aotArgs.Add("nodebug"); + aotArgs.Add($"llvm-path={LLVMPath}"); } else