diff --git a/src/backend/storage/page/checksum.c b/src/backend/storage/page/checksum.c
index 030c44f7308..db8544bca01 100644
--- a/src/backend/storage/page/checksum.c
+++ b/src/backend/storage/page/checksum.c
@@ -26,6 +26,12 @@
 #define PG_CHECKSUM_INTERNAL
 #include "storage/checksum_impl.h"	/* IWYU pragma: keep */
 
+/* In universal macOS builds, don't try to compile AVX code on the ARM side */
+#if defined(__i386__) || defined(__x86_64__)
+#else
+#undef USE_AVX2_WITH_RUNTIME_CHECK
+#endif
+
 
 static uint32
 pg_checksum_block_fallback(const PGChecksummablePage *page)
diff --git a/src/include/port/pg_cpu.h b/src/include/port/pg_cpu.h
index 566ed7a16e3..b276d7f1a4e 100644
--- a/src/include/port/pg_cpu.h
+++ b/src/include/port/pg_cpu.h
@@ -13,7 +13,7 @@
 #ifndef PG_CPU_H
 #define PG_CPU_H
 
-#if defined(USE_SSE2) || defined(__i386__)
+#if defined(USE_SSE2) || defined(__i386__) || defined(__x86_64__)
 
 typedef enum X86FeatureId
 {
