Skip to contentSkip to conversation

mjpegtools: fix build on powerpc without altivec

PATCH New Fabrice Fontaine 3 participants 3 messages Aug 22, 2018 – Aug 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mjpegtools: fix build on powerpc without altivec

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

---
 package/mjpegtools/Config.in     | 5 +++++
 package/mjpegtools/mjpegtools.mk | 6 ++++++
 2 files changed, 11 insertions(+)
package/mjpegtools/Config.in +5 -0
index c486361a87..968f9e7d65 100644
@@ -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
package/mjpegtools/mjpegtools.mk +6 -0
index c7392fa2b3..14713c868e 100644
@@ -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
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 mjpegtools: fix build on powerpc without altivec

Fabrice, All,

On 2018-08-22 22:30 +0200, Fabrice Fontaine spake thusly:

Quoted 10 lines

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
Quoted 7 lines

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

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

But see a little comment below...

Quoted 10 lines
---
 package/mjpegtools/Config.in     | 5 +++++
 package/mjpegtools/mjpegtools.mk | 6 ++++++
 2 files changed, 11 insertions(+)
package/mjpegtools/Config.in +0 -0
index c486361a87..968f9e7d65 100644

package/mjpegtools/Config.in config BR2_PACKAGE_MJPEGTOOLS · line 18

Quoted 7 lines
package/mjpegtools/Config.in +4 -0
@@ -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

The commit log should have said that mjpegtools will use --enable-simd-accel only to enable x86's MMX or ppc's altivec, and that it had no use for other archs.

Regards,
Yann E. MORIN.

Quoted 27 lines
package/mjpegtools/Config.in +0 -0
 comment "mjpegtools needs a toolchain w/ C++, threads"
 	depends on BR2_USE_MMU
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/mjpegtools/mjpegtools.mk +6 -0
index c7392fa2b3..14713c868e 100644
@@ -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
Signature · 6 lines
2.14.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 mjpegtools: fix build on powerpc without altivec

In reply to Fabrice Fontaine

Hello,

Quoted 10 lines · Fabrice Fontaine

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
Quoted 7 lines

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

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

I've applied to master, but it would have be nicer to figure out why the Altivec detection doesn't work properly. But OK, that's good enough for Buildroot with --enable/disable-simd-accel.

Thanks!

Thomas

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