Skip to contentSkip to conversation

package/opencv3: disable NEON and VFPv3 options

PATCH New Fabrice Fontaine 3 participants 3 messages Aug 20, 2019 – Mar 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/opencv3: disable NEON and VFPv3 options

Commit a17402e42d8c996af239cfdb536e74188d6c6245 has conditionally enabled NEON and VFPv3 optimizations. However these options are passing -mfpu=neon or -mfpu=vfpv3 to the compiler which raise issues on some targets such as Cortex-A5 with VFPv4-D16 enabled but without NEON and VFPv4.

So disable these options as buildroot is already passing -mfpu

Fixes:
- https://bugs.buildroot.org/show_bug.cgi?id=11996

---
 package/opencv3/opencv3.mk | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
package/opencv3/opencv3.mk +5 -9
index 91efa5c912..d3e795aae1 100644
@@ -109,17 +109,13 @@ OPENCV3_CONF_OPTS += \
 
 # Hardware support options.
 #
-# * PowerPC support is turned off since its only effect is altering CFLAGS,
-#   adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
+# * PowerPC, NEON and VFPv3 support are turned off since their only effects are
+#   altering CFLAGS, adding '-mcpu=G3 -mtune=G5', '-mfpu=neon' or '-mfpu=vfpv3'
+#   to them, which is already handled by Buildroot.
 OPENCV3_CONF_OPTS += \
 	-DENABLE_POWERPC=OFF \
-	-DENABLE_NEON=$(if $(BR2_ARM_CPU_HAS_NEON),ON,OFF)
-
-ifeq ($(BR2_ARCH_IS_64):$(BR2_ARM_CPU_HAS_VFPV3),:y)
-OPENCV3_CONF_OPTS += -DENABLE_VFPV3=ON
-else
-OPENCV3_CONF_OPTS += -DENABLE_VFPV3=OFF
-endif
+	-DENABLE_NEON=OFF \
+	-DENABLE_VFPV3=OFF
 
 # Cuda stuff
 OPENCV3_CONF_OPTS += \
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/opencv3: disable NEON and VFPv3 options

Hello,

Quoted 9 lines · On Tue, 20 Aug 2019 20:40:39 +0200 Fabrice Fontaine…
package/opencv3/opencv3.mk +3 -4
-# * PowerPC support is turned off since its only effect is altering CFLAGS,
-#   adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
+# * PowerPC, NEON and VFPv3 support are turned off since their only effects are
+#   altering CFLAGS, adding '-mcpu=G3 -mtune=G5', '-mfpu=neon' or '-mfpu=vfpv3'
+#   to them, which is already handled by Buildroot.
 OPENCV3_CONF_OPTS += \
 	-DENABLE_POWERPC=OFF \
-	-DENABLE_NEON=$(if $(BR2_ARM_CPU_HAS_NEON),ON,OFF)
-

package/opencv3/opencv3.mk OPENCV3_CONF_OPTS += \ · line 121

Quoted 10 lines
package/opencv3/opencv3.mk +2 -5
-ifeq ($(BR2_ARCH_IS_64):$(BR2_ARM_CPU_HAS_VFPV3),:y)
-OPENCV3_CONF_OPTS += -DENABLE_VFPV3=ON
-else
-OPENCV3_CONF_OPTS += -DENABLE_VFPV3=OFF
-endif
+	-DENABLE_NEON=OFF \
+	-DENABLE_VFPV3=OFF
 
 # Cuda stuff
 OPENCV3_CONF_OPTS += \

So, we looked into it some more with Arnout, and turns out that ENABLE_NEON=ON does more than adding options to CFLAGS, it enables some NEON specific code in the Carotene sublibrary at least.

However, for VFPv3 indeed it is true that it was only adding CFLAGS. So we reduced the patch to just do -DENABLE_VFPV3=OFF, and applied.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/opencv3: disable NEON and VFPv3 options

Quoted 30 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

Hello,

Quoted 17 lines · On Tue, 20 Aug 2019 20:40:39 +0200 Fabrice Fontaine…
package/opencv3/opencv3.mk +3 -2
-# * PowerPC support is turned off since its only effect is altering CFLAGS,
-#   adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
+# * PowerPC, NEON and VFPv3 support are turned off since their only effects are
+#   altering CFLAGS, adding '-mcpu=G3 -mtune=G5', '-mfpu=neon' or '-mfpu=vfpv3'
+#   to them, which is already handled by Buildroot.

OPENCV3_CONF_OPTS += \

package/opencv3/opencv3.mk +2 -8
-DENABLE_POWERPC=OFF \
-	-DENABLE_NEON=$(if $(BR2_ARM_CPU_HAS_NEON),ON,OFF)
-
-ifeq ($(BR2_ARCH_IS_64):$(BR2_ARM_CPU_HAS_VFPV3),:y)
-OPENCV3_CONF_OPTS += -DENABLE_VFPV3=ON
-else
-OPENCV3_CONF_OPTS += -DENABLE_VFPV3=OFF
-endif
+	-DENABLE_NEON=OFF \
+	-DENABLE_VFPV3=OFF
Quoted 2 lines

# Cuda stuff
OPENCV3_CONF_OPTS += \

So, we looked into it some more with Arnout, and turns out that ENABLE_NEON=ON does more than adding options to CFLAGS, it enables some NEON specific code in the Carotene sublibrary at least.

Quoted 4 lines

However, for VFPv3 indeed it is true that it was only adding CFLAGS. So we reduced the patch to just do -DENABLE_VFPV3=OFF, and applied.

Thanks a lot!

Committed to 2019.02.x and 2019.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard