From 5f66927222f4edb2566c2be32e043da088289e81 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Fri, 11 Jul 2025 21:12:43 +0200 Subject: [PATCH] Fixed build failed for aarch64 (es: rpi) --- docs/changes.txt | 1 + src/Makefile | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 1bee8f03e..cd9d7db03 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -106,6 +106,7 @@ - Fixed build failed for 18400 with Apple Metal - Fixed build failed for 18600 with Apple Metal - Fixed build failed for 4410 with vector width > 1 +- Fixed build failed for aarch64 (es: rpi) - Fixed clang identification in src/Makefile - Fixed build failure for almost all hash modes that make use of hc_swap64 and/or hc_swap64_S with Apple Metal / Apple Silicon - Fixed debug mode 5 by adding the missing colon between original-word and finding-rule diff --git a/src/Makefile b/src/Makefile index 575c23589..deefec4dd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -88,6 +88,9 @@ DARWIN_VERSION := $(shell uname -r | cut -d. -f1) IS_APPLE_SILICON := $(shell [ "$$(sysctl -in hw.optional.arm64 2>/dev/null)" = "1" ] && echo 1 || echo 0) endif +IS_AARCH64 := $(shell [ "$$(arch 2>/dev/null)" = "aarch64" ] && echo 1 || echo 0) +IS_ARM := $(or $(filter 1,$(IS_APPLE_SILICON)),$(filter 1,$(IS_AARCH64))) + ifneq (,$(filter $(UNAME),FreeBSD NetBSD)) CC := cc CXX := c++ @@ -380,8 +383,6 @@ LFLAGS_NATIVE += -lpthread LFLAGS_NATIVE += -liconv ifeq ($(IS_APPLE_SILICON),1) -CFLAGS_NATIVE += -DSSE2NEON_SUPPRESS_WARNINGS -CFLAGS_NATIVE += -I$(DEPS_SSE2NEON) CFLAGS_NATIVE += -arch arm64 CFLAGS_NATIVE += -arch x86_64 ifeq ($(SHARED),1) @@ -392,6 +393,11 @@ endif endif # Darwin +ifeq ($(IS_ARM),1) +CFLAGS_NATIVE += -DSSE2NEON_SUPPRESS_WARNINGS +CFLAGS_NATIVE += -I$(DEPS_SSE2NEON) +endif + ifeq ($(UNAME),CYGWIN) CFLAGS_NATIVE := $(CFLAGS) CFLAGS_NATIVE += -DWITH_HWMON @@ -838,12 +844,12 @@ CFLAGS_LZMA_WIN += -Wno-misleading-indentation CFLAGS_UNRAR_WIN += -Wno-misleading-indentation CFLAGS_UNRAR_WIN += -Wno-class-memaccess +endif -ifeq ($(IS_APPLE_SILICON),1) +ifeq ($(IS_ARM),1) CFLAGS_CROSS_LINUX += -DSSE2NEON_SUPPRESS_WARNINGS CFLAGS_CROSS_LINUX += -I$(DEPS_SSE2NEON) endif -endif ## ## Targets