Skip to content
Permalink
Browse files

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.
  • Loading branch information...
noloader committed Feb 28, 2019
1 parent 8624a91 commit 84ab1f3c66a579e317c9da440b347c6a47858a2e
Showing with 5 additions and 7 deletions.
  1. +4 −6 GNUmakefile
  2. +1 −1 GNUmakefile-cross
@@ -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

###########################################################
@@ -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

0 comments on commit 84ab1f3

Please sign in to comment.
You can’t perform that action at this time.