From c1aa671a4d2ac7bdce6891ed4ea4469e91881c76 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 13 Mar 2023 14:07:16 +0000 Subject: [PATCH] [benchmarks/ffi] `FfiCall` macos_arm64 support We're not running benchmarks on M1s, but it's useful to be able to. TEST=manually tested locally Change-Id: Ic42ed8e4e61e7590ea03734f46fbec8b955be2ff Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288203 Commit-Queue: Daco Harkes Reviewed-by: Jonas Termansen --- benchmarks/FfiCall/dart/dlopen_helper.dart | 1 + benchmarks/FfiCall/native/Makefile | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/benchmarks/FfiCall/dart/dlopen_helper.dart b/benchmarks/FfiCall/dart/dlopen_helper.dart index 7f1bbf9bc2d..05e7a30a278 100644 --- a/benchmarks/FfiCall/dart/dlopen_helper.dart +++ b/benchmarks/FfiCall/dart/dlopen_helper.dart @@ -15,6 +15,7 @@ const x64 = 'x64'; // https://stackoverflow.com/questions/45125516/possible-values-for-uname-m final _unames = { 'arm': arm, + 'arm64': arm64, 'aarch64_be': arm64, 'aarch64': arm64, 'armv8b': arm64, diff --git a/benchmarks/FfiCall/native/Makefile b/benchmarks/FfiCall/native/Makefile index eec45934c87..bb33457978d 100644 --- a/benchmarks/FfiCall/native/Makefile +++ b/benchmarks/FfiCall/native/Makefile @@ -55,3 +55,13 @@ out/linux/arm/native_functions.o: native_functions.c | out/linux/arm out/linux/arm/libnative_functions.so: out/linux/arm/native_functions.o $(CCARM) $(CFLAGS) -s -shared -o $@ out/linux/arm/native_functions.o + +# On M1 Machine. +out/mac/arm64: + mkdir -p out/mac/arm64 + +out/mac/arm64/native_functions.o: native_functions.c | out/mac/arm64 + $(CC) $(CFLAGS) -c -o $@ native_functions.c + +out/mac/arm64/libnative_functions.dylib: out/mac/arm64/native_functions.o + $(CC) $(CFLAGS) -s -shared -o $@ out/mac/arm64/native_functions.o