[vm] Support assembly output for Windows.

The resulting DLL lacks debugging information / PDB.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/60812
Bug: https://github.com/dart-lang/sdk/issues/60813
Cq-Include-Trybots: luci.dart.try:vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-release-arm64-try,vm-aot-win-release-x64-try
Change-Id: I305bad0081ec24f27249ad9b75ff8d32fa9c4893
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428200
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2025-06-02 12:12:04 -07:00
committed by Commit Queue
parent bd9ab13a38
commit 03301c9bfb
21 changed files with 168 additions and 46 deletions
+7 -7
View File
@@ -6451,7 +6451,13 @@ static void CreateAppAOTSnapshot(
FullSnapshotWriter::kInitialSize);
ZoneWriteStream isolate_snapshot_instructions(T->zone(), kInitialSize);
const bool generate_debug = debug_callback_data != nullptr;
bool generate_debug = debug_callback_data != nullptr;
#if defined(DART_TARGET_OS_WINDOWS)
if (format == Dart_AotBinaryFormat_Assembly) {
// TODO(https://github.com/dart-lang/sdk/issues/60812): Support PDB.
generate_debug = false; // PDB unimplemented, no DWARF in PE.
}
#endif
auto* const deobfuscation_trie =
(strip && !generate_debug) ? nullptr
@@ -6574,8 +6580,6 @@ Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* debug_callback_data) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(DART_TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
"This VM was built without support for AOT compilation.");
@@ -6603,8 +6607,6 @@ DART_EXPORT Dart_Handle Dart_CreateAppAOTSnapshotAsAssemblies(
Dart_StreamingCloseCallback close_callback) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(DART_TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
"This VM was built without support for AOT compilation.");
@@ -6627,8 +6629,6 @@ Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(DART_TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
"This VM was built without support for AOT compilation.");