Skip to contentSkip to conversation

nettle: disable assembly optimizations for ARMv7M

PATCH New Gustavo Zacarias 3 participants 7 messages Jul 25, 2016 – Jul 27, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

It's thumb2-only and it requires ARM instructions. Since V4 and V5 aren't enough either use the V7M knob to avoid over-complicating the conditional. Fixes:
http://autobuild.buildroot.net/results/354/35418d33efa902d3a1a82b2cd58d8db1b1172e49/

---
 package/nettle/nettle.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nettle/nettle.mk +1 -1
index c133839..a94a7fc 100644
@@ -15,7 +15,7 @@ NETTLE_LICENSE_FILES = COPYING.LESSERv3 COPYINGv2
 NETTLE_CONF_OPTS = --disable-openssl
 
 # ARM assembly requires v6+ ISA
-ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5),y)
+ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5)$(BR2_ARM_CPU_ARMV7M),y)
 NETTLE_CONF_OPTS += --disable-assembler
 endif
 
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

Hello,

Quoted 15 lines · Gustavo Zacarias

It's thumb2-only and it requires ARM instructions. Since V4 and V5 aren't enough either use the V7M knob to avoid over-complicating the conditional. Fixes:
http://autobuild.buildroot.net/results/354/35418d33efa902d3a1a82b2cd58d8db1b1172e49/

---
 package/nettle/nettle.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nettle/nettle.mk +0 -0
index c133839..a94a7fc 100644

package/nettle/nettle.mk NETTLE_LICENSE_FILES = COPYING.LESSERv3 COPYINGv2 · line 18

Quoted 5 lines
package/nettle/nettle.mk +1 -1
@@ -15,7 +15,7 @@ NETTLE_LICENSE_FILES = COPYING.LESSERv3 COPYINGv2
 NETTLE_CONF_OPTS = --disable-openssl
 
 # ARM assembly requires v6+ ISA
-ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5),y)
+ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5)$(BR2_ARM_CPU_ARMV7M),y)

I've applied, but in the end, I'm wondering if the condition wouldn't be simpler as:

ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV6),)
NETTLE_CONF_OPTS += --disable-assembler
endif

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 17 lines · Gustavo Zacarias

It's thumb2-only and it requires ARM instructions. Since V4 and V5 aren't enough either use the V7M knob to avoid over-complicating the conditional. Fixes:
http://autobuild.buildroot.net/results/354/35418d33efa902d3a1a82b2cd58d8db1b1172e49/

---
package/nettle/nettle.mk | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
package/nettle/nettle.mk +0 -0
index c133839..a94a7fc 100644
@@ -15,7 +15,7 @@ NETTLE_LICENSE_FILES = COPYING.LESSERv3 COPYINGv2

NETTLE_CONF_OPTS = --disable-openssl

Quoted 8 lines

package/nettle/nettle.mk NETTLE_LICENSE_FILES = COPYING.LESSERv3 COPYINGv2 · line 18

Quoted 3 lines

# ARM assembly requires v6+ ISA

package/nettle/nettle.mk +1 -1
-ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5),y)
+ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5)$(BR2_ARM_CPU_ARMV7M),y)

I've applied, but in the end, I'm wondering if the condition wouldn't be simpler as:

ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV6),)

I take it that you mean:

ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),)

We could also simply check for ARM and THUMB2 instructions, E.G.:

# needs thumb2 and arm instructions support
ifneq ($(BR2_ARM_CPU_HAS_ARM)$(BR2_ARM_CPU_HAS_THUMB2),yy)
Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

Hello,

Quoted 5 lines · Peter Korsgaard
Quoted 1 line

ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV6),)

I take it that you mean:

ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),)

Indeed, bad copy/paste.

Quoted 4 lines

We could also simply check for ARM and THUMB2 instructions, E.G.:

# needs thumb2 and arm instructions support
ifneq ($(BR2_ARM_CPU_HAS_ARM)$(BR2_ARM_CPU_HAS_THUMB2),yy)

I don't think this is equivalent. Indeed, ARMv6 doesn't have Thumb2 (at least from Buildroot point of view), while the assembly code in Nettle is OK for ARMv6.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 8 lines
Quoted 4 lines

We could also simply check for ARM and THUMB2 instructions, E.G.:

# needs thumb2 and arm instructions support
ifneq ($(BR2_ARM_CPU_HAS_ARM)$(BR2_ARM_CPU_HAS_THUMB2),yy)

I don't think this is equivalent. Indeed, ARMv6 doesn't have Thumb2 (at least from Buildroot point of view), while the assembly code in Nettle is OK for ARMv6.

True, but then the commit message doesn't make any sense as it said it required thumb2 and classic in structions.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#5 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

Hello,

Quoted 6 lines · Peter Korsgaard
Quoted 3 lines

I don't think this is equivalent. Indeed, ARMv6 doesn't have Thumb2 (at least from Buildroot point of view), while the assembly code in Nettle is OK for ARMv6.

True, but then the commit message doesn't make any sense as it said it required thumb2 and classic in structions.

That's not what the commit message said. The commit message said:

"""
nettle: disable assembly optimizations for ARMv7M

It's thumb2-only and it requires ARM instructions.
"""

So it did not say at all that nettle requires Thumb-2 *and* classic. It said that ARMv7M provides only thumb2, and that nettle requires ARM instructions.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 1/1 nettle: disable assembly optimizations for ARMv7M

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 11 lines

That's not what the commit message said. The commit message said:

"""
nettle: disable assembly optimizations for ARMv7M

It's thumb2-only and it requires ARM instructions.
"""

So it did not say at all that nettle requires Thumb-2 *and* classic. It said that ARMv7M provides only thumb2, and that nettle requires ARM instructions.

Ahh, I read "It" as referring to the nettle code, not ARMv7M cores.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard