From 84ab1f3c66a579e317c9da440b347c6a47858a2e Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 27 Feb 2019 19:35:04 -0500 Subject: [PATCH] Remove early NEON qualification tests from Makefile (GH #812, GH #813) The makefile tries to pre-qualify NEON (for lack of a better term), and sets IS_NEON accordingly. If IS_NEON=1, then we go on to perform test compiles to see if -mfloat-abi=X -mfpu=neon (and friends) actually work. Effectively we are performing a test to see if we should perform another test. The IS_NEON flag predates our compile time feature tests. It was kind of helpful when we were trying to sort out if a platform and compiler options supported NEON without a compile test. That was an absolute mess and we quickly learned we needed a real compile time feature test (which we now have). Additionally, Debian and Fedora ARMEL builds are failing because we are misdetecting NEON availability. It looks like we fail to set IS_NEON properly, so we never get into the code paths that set either (1) -mfloat-abi=X -mfpu=neon or (2) -DCRYPTOPP_DISABLE_NEON or -DCRYPTOPP_DISABLE_ASM. Later, the makefile builds a *_simd.cpp and the result is an error that NEON needs to be activated (or disabled). This commit removes IS_NEON so we immediately move to compile time feature tests. --- GNUmakefile | 10 ++++------ GNUmakefile-cross | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 12b2edf5..f0dc5441 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -53,8 +53,6 @@ IS_SPARC64 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'sun|sparc64') IS_ARM32 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'arm|armhf|arm7l|eabihf') IS_ARMV8 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'aarch32|aarch64|arm64|armv8') -IS_NEON := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | $(GREP) -i -c -E 'armv7|armhf|arm7l|eabihf|armv8|aarch32|aarch64') - # Attempt to determine platform SYSTEMX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null) ifeq ($(SYSTEMX),) @@ -439,10 +437,10 @@ endif ##### ARM A-32, Aach64 and NEON ##### ########################################################### -ifneq ($(IS_ARM32)$(IS_ARMV8)$(IS_NEON),000) +ifneq ($(IS_ARM32)$(IS_ARMV8),00) ifeq ($(DETECT_FEATURES),1) -ifeq ($(IS_ARM32)$(IS_NEON),11) +ifneq ($(IS_ARM32),0) TPROG = TestPrograms/test_arm_neon.cxx TOPT = -march=armv7-a -mfloat-abi=$(FP_ABI) -mfpu=neon @@ -469,7 +467,7 @@ ifeq ($(IS_ARM32)$(IS_NEON),11) CXXFLAGS += -DCRYPTOPP_DISABLE_ASM endif -# IS_NEON +# IS_ARM32 endif ifeq ($(IS_ARMV8),1) @@ -567,7 +565,7 @@ endif # DETECT_FEATURES endif -# IS_ARM32, IS_ARMV8, IS_NEON +# IS_ARM32, IS_ARMV8 endif ########################################################### diff --git a/GNUmakefile-cross b/GNUmakefile-cross index c308c123..664a8447 100755 --- a/GNUmakefile-cross +++ b/GNUmakefile-cross @@ -384,7 +384,7 @@ ifeq ($(IS_ARM32),1) SM4_FLAG = $(NEON_FLAG) else NEON_FLAG = - CXXFLAGS += -DCRYPTOPP_DISABLE_NEON + CXXFLAGS += -DCRYPTOPP_DISABLE_ASM endif # IS_NEON