mjpegtools: fix build on powerpc without altivec
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Wed, 22 Aug 2018 20:30:08 +0000 (22:30 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 23 Aug 2018 10:14:38 +0000 (12:14 +0200)
mpjegtools fails to build on powerpc without altivec:

build_sub44_mests.c: In function 'build_sub44_mests_altivec':
build_sub44_mests.c:268:9: internal compiler error: Segmentation fault
     vr1 = vec_ld(rowstride, (unsigned char*)s44blk);

It seems mpjegtools is wrongly detecting altivec support:
configure:   - PowerPC Optimizations:
configure:     - AltiVec enabled             : true

Fix this by adding BR2_PACKAGE_MJPEGTOOLS_SIMD_SUPPORT and setting
--enable-simd-accel / --disable-simd-accel

Fixes:
 - http://autobuild.buildroot.net/results/c9464712f43efb8954fd2e5460126ad193660353

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/mjpegtools/Config.in
package/mjpegtools/mjpegtools.mk

index c486361a875bb865532253240c2ae8d25be5044c..968f9e7d652149d2993c0ca8c0d70cbe91ec41f9 100644 (file)
@@ -12,6 +12,11 @@ config BR2_PACKAGE_MJPEGTOOLS
 
          http://mjpeg.sourceforge.net
 
+config BR2_PACKAGE_MJPEGTOOLS_SIMD_SUPPORT
+       bool
+       default y if BR2_X86_CPU_HAS_MMX
+       default y if BR2_POWERPC_CPU_HAS_ALTIVEC
+
 comment "mjpegtools needs a toolchain w/ C++, threads"
        depends on BR2_USE_MMU
        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
index c7392fa2b36d077d6f9eeddbd7f3ad2b6147ce96..14713c868ec37e68403c3b5da1ca2917be7bcd0c 100644 (file)
@@ -10,6 +10,12 @@ MJPEGTOOLS_DEPENDENCIES = host-pkgconf jpeg
 MJPEGTOOLS_LICENSE = GPL-2.0+
 MJPEGTOOLS_LICENSE_FILES = COPYING
 
+ifeq ($(BR2_PACKAGE_MJPEGTOOLS_SIMD_SUPPORT),y)
+MJPEGTOOLS_CONF_OPTS += --enable-simd-accel
+else
+MJPEGTOOLS_CONF_OPTS += --disable-simd-accel
+endif
+
 ifeq ($(BR2_PACKAGE_LIBPNG),y)
 MJPEGTOOLS_CONF_OPTS += --with-libpng
 MJPEGTOOLS_DEPENDENCIES += libpng