Skip to content

Commit bbb847e

Browse files
mkustermannCommit Queue
authored andcommitted
[vm] Allow running analyze_snapshot tool on MacOS
This allows development of the `analyze_snapshot` tool on a MacBook. TEST=vm/dart/analyze_snapshot_binary_test Change-Id: I3b1ec108bbff5db2f1e69dc98d65ddeaf11e5230 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429941 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent e535e81 commit bbb847e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

runtime/bin/analyze_snapshot.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#include "bin/platform.h"
1111

1212
#if defined(TARGET_ARCH_IS_64_BIT) && defined(DART_PRECOMPILED_RUNTIME) && \
13-
(defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_LINUX))
13+
(defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_LINUX) || \
14+
defined(DART_TARGET_OS_MACOS))
1415
#define SUPPORT_ANALYZE_SNAPSHOT
1516
#endif
1617

runtime/runtime_args.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ declare_args() {
8989
# The analyze_snapshot tool is only supported on 64 bit AOT builds that use
9090
# ELF.
9191
build_analyze_snapshot =
92-
(target_os == "linux" || target_os == "android" ||
92+
(target_os == "linux" || target_os == "mac" || target_os == "android" ||
9393
target_os == "fuchsia") &&
9494
(dart_target_arch == "x64" || dart_target_arch == "arm64" ||
9595
dart_target_arch == "riscv64")

runtime/tests/vm/dart/analyze_snapshot_binary_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,10 @@ main() async {
561561
// Test unstripped ELF generation that is then externally stripped.
562562
await Future.wait([testAOT(aotDillPath, stripUtil: true)]);
563563

564-
// Dont test assembled snapshot for simulated platforms
565-
if (!buildDir.endsWith("SIMARM64") && !buildDir.endsWith("SIMARM64C")) {
564+
// Dont test assembled snapshot for simulated platforms or macos
565+
if (!buildDir.endsWith("SIMARM64") &&
566+
!buildDir.endsWith("SIMARM64C") &&
567+
!Platform.isMacOS) {
566568
await Future.wait([
567569
// Test unstripped assembly generation that is then externally stripped.
568570
testAOT(aotDillPath, useAsm: true),

runtime/tests/vm/vm.status

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,5 +385,5 @@ dart/thread_priority_linux_test: SkipByDesign
385385

386386
# The analyze_snapshot tool tests are only supported on 64 bit AOT builds running under
387387
# release or product runtimes for linux and android platforms
388-
[ $arch != arm64 && $arch != arm64c && $arch != simarm64 && $arch != simarm64c && $arch != x64 && $arch != x64c || $compiler != dartk && $compiler != dartkp || $mode != product && $mode != release || $runtime != dart_precompiled && $runtime != vm || $system != android && $system != linux ]
388+
[ $arch != arm64 && $arch != arm64c && $arch != simarm64 && $arch != simarm64c && $arch != x64 && $arch != x64c || $compiler != dartk && $compiler != dartkp || $mode != product && $mode != release || $runtime != dart_precompiled && $runtime != vm || $system != android && $system != linux && $system != macos ]
389389
dart/analyze_snapshot_binary_test: SkipByDesign # Only run on 64bit AOT on standard architectures

0 commit comments

Comments
 (0)