From 6f15fdf9658ebc8442ce911ec2d2494df28d7aa3 Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 4 Sep 2025 08:25:16 +0000 Subject: [PATCH] perf(build): update ARM optimization flags for better compatibility Replace -mcpu with -mtune in compiler flags to improve binary compatibility while maintaining performance for Cortex-A7 targets --- Makefile | 2 +- tools/build_audio_deps.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3c81f5ce..5470d8e7 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ ALSA_VERSION ?= 1.2.14 OPUS_VERSION ?= 1.5.2 # Optimization flags for ARM Cortex-A7 with NEON -OPTIM_CFLAGS := -O3 -mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -ffast-math -funroll-loops +OPTIM_CFLAGS := -O3 -mfpu=neon -mtune=cortex-a7 -mfloat-abi=hard -ftree-vectorize -ffast-math -funroll-loops PROMETHEUS_TAG := github.com/prometheus/common/version KVM_PKG_NAME := github.com/jetkvm/kvm diff --git a/tools/build_audio_deps.sh b/tools/build_audio_deps.sh index d50d8a1a..374d6a5f 100755 --- a/tools/build_audio_deps.sh +++ b/tools/build_audio_deps.sh @@ -24,7 +24,7 @@ cd "$AUDIO_LIBS_DIR" [ -d opus-${OPUS_VERSION} ] || tar xf opus-${OPUS_VERSION}.tar.gz # Optimization flags for ARM Cortex-A7 with NEON -OPTIM_CFLAGS="-O3 -mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -ffast-math -funroll-loops" +OPTIM_CFLAGS="-O3 -mfpu=neon -mtune=cortex-a7 -mfloat-abi=hard -ftree-vectorize -ffast-math -funroll-loops" export CC="${CROSS_PREFIX}-gcc" export CFLAGS="$OPTIM_CFLAGS"