From 69ccb2405ad71f22ad74ca1f4a4ce60d22021fe6 Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Tue, 31 Mar 2026 01:06:38 -0700 Subject: [PATCH] Fix Android cross-compilation failing with unsupported '-mavx' flag The Linux AVX auto-detection checked the host's /proc/cpuinfo, which passes on x86 CI runners even when cross-compiling for Android ARM targets. Skip AVX detection when CC contains 'android'. Co-Authored-By: Claude Opus 4.6 (1M context) --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 051590e..31064d2 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,12 @@ ifndef OMIT_SIMD CFLAGS += -mcpu=apple-m1 -DSQLITE_VEC_ENABLE_NEON endif ifeq ($(shell uname -s),Linux) + ifeq ($(findstring android,$(CC)),) ifneq ($(filter avx,$(shell grep -o 'avx[^ ]*' /proc/cpuinfo 2>/dev/null | head -1)),) CFLAGS += -mavx -DSQLITE_VEC_ENABLE_AVX endif endif + endif endif ifdef USE_BREW_SQLITE