From 2dc82440572f4264aca5794c959d348c34129980 Mon Sep 17 00:00:00 2001 From: Owen Rummage Date: Sun, 19 Jul 2026 16:58:46 -0500 Subject: [PATCH] Fix macOS ARM64 release detection --- .github/workflows/release.yml | 12 +++++++++--- src/app/benchmark.c | 2 +- src/app/hw_detect.c | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bd763f..403b39d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,9 +143,15 @@ jobs: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target == 'macos-amd64' && '10.5' || '' }} run: | OPENSSL_LIBDIR="$(find "$GITHUB_WORKSPACE/openssl-static" -type f -name libssl.a -exec dirname {} \;)" - make "${{ matrix.target }}" \ - TLS_CFLAGS="-I$GITHUB_WORKSPACE/openssl-static/include" \ - TLS_LDLIBS="$OPENSSL_LIBDIR/libssl.a $OPENSSL_LIBDIR/libcrypto.a" + build_log="$(mktemp)" + if ! make "${{ matrix.target }}" \ + TLS_CFLAGS="-I$GITHUB_WORKSPACE/openssl-static/include" \ + TLS_LDLIBS="$OPENSSL_LIBDIR/libssl.a $OPENSSL_LIBDIR/libcrypto.a" \ + 2>&1 | tee "$build_log"; then + message="$(tail -40 "$build_log" | tr '\n' ' ')" + echo "::error title=macOS build failed::$message" + exit 1 + fi if otool -L "dist/fossbench-${{ matrix.target }}" | grep -E 'lib(ssl|crypto)'; then echo 'macOS release uses dynamic OpenSSL' >&2 exit 1 diff --git a/src/app/benchmark.c b/src/app/benchmark.c index 7f9806b..cd7f43d 100644 --- a/src/app/benchmark.c +++ b/src/app/benchmark.c @@ -35,7 +35,7 @@ #endif #define FB_VERSION "0.2.1" -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) # define D_INT "64-bit ALU: madd, umulh, udiv, bitops" # define D_FP "double: fmadd, fdiv, fsqrt" # define D_SIMD "NEON ASIMD: 128-bit integer + float" diff --git a/src/app/hw_detect.c b/src/app/hw_detect.c index e376191..b52c6e3 100644 --- a/src/app/hw_detect.c +++ b/src/app/hw_detect.c @@ -33,7 +33,7 @@ # define HW_OS "POSIX" #endif -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) # define HW_ARCH "ARM64" #elif defined(__x86_64__) || defined(_M_X64) # define HW_ARCH "x86-64" @@ -445,7 +445,7 @@ void hw_detect_system(struct system_info *info) case 0x17d5b93au: name = "Apple M4"; break; } } -#if defined(__aarch64__) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) if (name == NULL) name = "Apple M-series"; #endif if (name != NULL) snprintf(info->cpu, sizeof info->cpu, "%s", name);