[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Does ARMEL toolchain include NEON support?



On Wed, Feb 27, 2019 at 4:01 PM Steve McIntyre <steve@einval.com> wrote:
>
> On Wed, Feb 27, 2019 at 02:16:46PM -0500, Jeffrey Walton wrote:
> >
> >I'm investigating a failed build for ARMEL. I don't have access to the
> >build machine so I have to study the logs or ask our package
> >maintainer to run commands for us.
> >
> >The build log is at
> >https://buildd.debian.org/status/package.php?p=libcrypto%2B%2B&suite=experimental
> >(package) and https://buildd.debian.org/status/fetch.php?pkg=libcrypto%2B%2B&arch=armel&ver=8.1.0-1&stamp=1551251751&raw=0
> >(ARMEL).
> > ...
>
> OK. In your build log I can see
>
> n file included from aria_simd.cpp:19:
> /usr/lib/gcc/arm-linux-gnueabi/8/include/arm_neon.h:31:2: error: #error "NEON intrinsics not available with the soft-float ABI.  Please use -mfloat-abi=softfp or -mfloat-abi=hard"
>  #error "NEON intrinsics not available with the soft-float ABI.  Please use -mfloat-abi=softfp or -mfloat-abi=hard"
>
> What errors do you get if you try -mfloat-abi=softfp (etc.)?

I seem to recall László Böszörményi, who is our package maintainer,
ran that test for us. It also failed. I believe it was roughly the
same error for both hard and soft floats.

> To be able to use NEON support you may also have to specify a CPU/FPU
> combination that includes it - the default armel setup it for ARMv5
> which is not going to help you.

Yeah, the problem is centered around this. When we test for NEON we
include -march=armv7-a. The GNUmakefile does this
(https://github.com/weidai11/cryptopp/blob/master/GNUmakefile):

HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
IS_ARM32 := $(shell echo "$(HOSTX)" | $(GREP) -i -c -E 'arm|armhf|arm7l|eabihf')
IS_NEON := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null |
$(GREP) -i -c -E 'armv7|armhf|arm7l|eabihf|armv8|aarch32|aarch64')

Then, it does this:

ifeq ($(IS_ARM32)$(IS_NEON),11)

  TPROG = TestPrograms/test_arm_neon.cxx
  TOPT = -march=armv7-a -mfloat-abi=$(FP_ABI) -mfpu=neon
  HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o
$(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
  ifeq ($(strip $(HAVE_OPT)),0)
    NEON_FLAG = -march=armv7-a -mfloat-abi=$(FP_ABI) -mfpu=neon
    ....
endif

When we detect ARM32 and NEON is available using a test compile, then
we enable IS_NEON . I'm thinking IS_ARM32 or IS_NEON is misdetecting.
The feature test works well elsewhere, including x86, x86_64, Aarch32,
Aarch64, MIPS, MIPS64, PPC, PPC64, etc.

The problem is, I don't know what the output of or 'g++ -dumpmachine'
or 'uname -m' are, so I am not sure if we are misdetecting IS_ARM32 or
IS_NEON .

I wrote to the guys who maintain the build system and asked them to
provide the explicit output of the commands with the logs. They told
me the information was there without the need for providing the output
g++ -dumpmachine' or 'uname -m'.

(My hunch is 'g++ -dumpmachine' is returning something other than what
we expect. Maybe something like 'armel'. I won't know for certain
until I see the output of the commands, but which Debian refuses to
provide).

Jeff


Reply to: