Patchwork nettle: fix ARM NEON build breakage

login
register
mail settings
Submitter Gustavo Zacarias
Date May 4, 2013, 12:22 p.m.
Message ID <1367670147-3436-1-git-send-email-gustavo@zacarias.com.ar>
Download mbox | patch
Permalink /patch/241456/
State Superseded
Headers show

Comments

Gustavo Zacarias - May 4, 2013, 12:22 p.m.
Nettle's ARM NEON optimizations use some assembly constructs that aren't
friendly with binutils < 2.21 and since we can't know for sure which
binutils version we've got when using an external toolchain just disable
NEON optimizations for now. Fixes:
http://autobuild.buildroot.net/results/3c6f91379f90d438b4da3dd330cf89e1dd746aaf/

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/nettle/nettle.mk | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
Peter Korsgaard - May 4, 2013, 1:02 p.m.
>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 Gustavo> Nettle's ARM NEON optimizations use some assembly constructs that aren't
 Gustavo> friendly with binutils < 2.21 and since we can't know for sure which
 Gustavo> binutils version we've got when using an external toolchain just disable
 Gustavo> NEON optimizations for now. Fixes:
 Gustavo> http://autobuild.buildroot.net/results/3c6f91379f90d438b4da3dd330cf89e1dd746aaf/

 Gustavo> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 Gustavo> ---
 Gustavo>  package/nettle/nettle.mk | 9 ++-------
 Gustavo>  1 file changed, 2 insertions(+), 7 deletions(-)

 Gustavo> diff --git a/package/nettle/nettle.mk b/package/nettle/nettle.mk
 Gustavo> index b3d2730..9405ff7 100644
 Gustavo> --- a/package/nettle/nettle.mk
 Gustavo> +++ b/package/nettle/nettle.mk
 Gustavo> @@ -4,19 +4,14 @@ NETTLE_DEPENDENCIES = gmp
 Gustavo>  NETTLE_INSTALL_STAGING = YES
 Gustavo>  NETTLE_LICENSE = LGPLv2.1+
 Gustavo>  NETTLE_LICENSE_FILES = COPYING.LIB
 Gustavo> +# NEON support breaks with binutils < 2.21
 Gustavo> +NETTLE_CONF_OPT = --disable-arm-neon
 
 Gustavo>  # ARM assembly requires v6+ ISA
 Gustavo>  ifeq ($(BR2_arm7tdmi)$(BR2_arm720t)$(BR2_arm920t)$(BR2_arm922t)$(BR2_arm926t)$(BR2_arm10t)$(BR2_fa526)$(BR2_strongarm)$(BR2_xscale)$(BR2_iwmmxt),y)
 Gustavo>  NETTLE_CONF_OPT += --disable-assembler
 Gustavo>  endif
 
 Gustavo> -# ARM NEON
 Gustavo> -ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
 Gustavo> -NETTLE_CONF_OPT += --enable-arm-neon
 Gustavo> -else
 Gustavo> -NETTLE_CONF_OPT += --disable-arm-neon
 Gustavo> -endif

It's a pity we have to disable it for setups where we know it works
(E.G. internal toolchain with all other binutils versions than
2.20.1). Why not just change it to:

# NEON supports needs binutils 2.21+
ifeq ($(BR2_ARM_CPU_HAS_NEON)$(BR2_TOOLCHAIN_BUILDROOT)$(BR2_BINUTILS_VERSION_2_20_1),yy)
NETTLE_CONF_OPT += --enable-arm-neon
..

Patch

diff --git a/package/nettle/nettle.mk b/package/nettle/nettle.mk
index b3d2730..9405ff7 100644
--- a/package/nettle/nettle.mk
+++ b/package/nettle/nettle.mk
@@ -4,19 +4,14 @@  NETTLE_DEPENDENCIES = gmp
 NETTLE_INSTALL_STAGING = YES
 NETTLE_LICENSE = LGPLv2.1+
 NETTLE_LICENSE_FILES = COPYING.LIB
+# NEON support breaks with binutils < 2.21
+NETTLE_CONF_OPT = --disable-arm-neon
 
 # ARM assembly requires v6+ ISA
 ifeq ($(BR2_arm7tdmi)$(BR2_arm720t)$(BR2_arm920t)$(BR2_arm922t)$(BR2_arm926t)$(BR2_arm10t)$(BR2_fa526)$(BR2_strongarm)$(BR2_xscale)$(BR2_iwmmxt),y)
 NETTLE_CONF_OPT += --disable-assembler
 endif
 
-# ARM NEON
-ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
-NETTLE_CONF_OPT += --enable-arm-neon
-else
-NETTLE_CONF_OPT += --disable-arm-neon
-endif
-
 define NETTLE_DITCH_DEBUGGING_CFLAGS
 	$(SED) '/CFLAGS/ s/ -ggdb3//' $(@D)/configure
 endef