mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Merge pull request #1649 from Doridian/fix/build-arm32
Make NEON build detection a bit more robust and work on 32-bit ARM
This commit is contained in:
commit
abcc061251
2 changed files with 31 additions and 1 deletions
|
@ -17,6 +17,7 @@ target_compile_definitions(pm3rrg_rdv4_hardnested_nosimd PRIVATE NOSIMD_BUILD)
|
||||||
## Mingw platforms: AMD64
|
## Mingw platforms: AMD64
|
||||||
set(X86_CPUS x86 x86_64 i686 AMD64)
|
set(X86_CPUS x86 x86_64 i686 AMD64)
|
||||||
set(ARM64_CPUS arm64 aarch64)
|
set(ARM64_CPUS arm64 aarch64)
|
||||||
|
set(ARM32_CPUS armel armhf)
|
||||||
|
|
||||||
message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
|
message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
|
||||||
|
@ -118,6 +119,26 @@ elseif ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST ARM64_CPUS)
|
||||||
target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3)
|
target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3)
|
||||||
set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE
|
||||||
|
../../common
|
||||||
|
../../include
|
||||||
|
../src)
|
||||||
|
|
||||||
|
set(SIMD_TARGETS
|
||||||
|
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_neon>)
|
||||||
|
elseif ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST ARM32_CPUS)
|
||||||
|
message(STATUS "Building optimised arm binaries")
|
||||||
|
|
||||||
|
## arm64 / NEON
|
||||||
|
add_library(pm3rrg_rdv4_hardnested_neon OBJECT
|
||||||
|
hardnested/hardnested_bf_core.c
|
||||||
|
hardnested/hardnested_bitarray_core.c)
|
||||||
|
|
||||||
|
target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3)
|
||||||
|
target_compile_options(pm3rrg_rdv4_hardnested_neon BEFORE PRIVATE
|
||||||
|
-mfpu=neon)
|
||||||
|
set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE
|
target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE
|
||||||
../../common
|
../../common
|
||||||
../../include
|
../../include
|
||||||
|
|
|
@ -13,6 +13,9 @@ endif
|
||||||
ifneq ($(findstring amd64, $(cpu_arch)), )
|
ifneq ($(findstring amd64, $(cpu_arch)), )
|
||||||
IS_SIMD_ARCH=x86
|
IS_SIMD_ARCH=x86
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(findstring arm, $(cpu_arch)), )
|
||||||
|
IS_SIMD_ARCH=arm
|
||||||
|
endif
|
||||||
ifneq ($(findstring arm64, $(cpu_arch)), )
|
ifneq ($(findstring arm64, $(cpu_arch)), )
|
||||||
IS_SIMD_ARCH=arm64
|
IS_SIMD_ARCH=arm64
|
||||||
endif
|
endif
|
||||||
|
@ -24,13 +27,14 @@ ifneq ($(IS_SIMD_ARCH), )
|
||||||
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
|
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
|
||||||
endif
|
endif
|
||||||
ifeq ($(MULTIARCHSRCS), )
|
ifeq ($(MULTIARCHSRCS), )
|
||||||
|
MYCFLAGS += -DNOSIMD_BUILD
|
||||||
MYSRCS += hardnested_bf_core.c hardnested_bitarray_core.c
|
MYSRCS += hardnested_bf_core.c hardnested_bitarray_core.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIB_A = libhardnested.a
|
LIB_A = libhardnested.a
|
||||||
|
|
||||||
MYOBJS = $(MYSRCS:%.c=$(OBJDIR)/%.o)
|
MYOBJS = $(MYSRCS:%.c=$(OBJDIR)/%.o)
|
||||||
ifeq ($(IS_SIMD_ARCH), arm64)
|
ifneq ($(findstring arm, $(IS_SIMD_ARCH)), )
|
||||||
MYOBJS += $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NOSIMD.o) \
|
MYOBJS += $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NOSIMD.o) \
|
||||||
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NEON.o)
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NEON.o)
|
||||||
else
|
else
|
||||||
|
@ -54,6 +58,11 @@ ifeq ($(IS_SIMD_ARCH), arm64)
|
||||||
SUPPORTS_AVX512=False
|
SUPPORTS_AVX512=False
|
||||||
HARD_SWITCH_NOSIMD = -DNOSIMD_BUILD
|
HARD_SWITCH_NOSIMD = -DNOSIMD_BUILD
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(IS_SIMD_ARCH), arm)
|
||||||
|
SUPPORTS_AVX512=False
|
||||||
|
HARD_SWITCH_NEON = -mfpu=neon
|
||||||
|
HARD_SWITCH_NOSIMD = -DNOSIMD_BUILD
|
||||||
|
endif
|
||||||
ifeq "$(SUPPORTS_AVX512)" "True"
|
ifeq "$(SUPPORTS_AVX512)" "True"
|
||||||
HARD_SWITCH_NOSIMD += -mno-avx512f
|
HARD_SWITCH_NOSIMD += -mno-avx512f
|
||||||
HARD_SWITCH_MMX += -mno-avx512f
|
HARD_SWITCH_MMX += -mno-avx512f
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue