Bug#594093: NEON pass failure on ffmpeg

Loïc Minier lool at dooz.org
Wed Aug 25 19:49:54 UTC 2010


tags 594093 + patch confirmed
stop

On Wed, Aug 25, 2010, Riku Voipio wrote:
> Neither is it a toolchain bug nor do we have any NEON capable buildds.

 It's ok, we don't need NEON capable buildds; this builds an alternate
 set of ffmpeg libs for NEON (available via hwcaps).

> And, btw ubfx is not even a NEON instruction. It is a ARMv7 instruction.

 It actually seems to have been added in armv6t2+ (even in ARM mode).

> The error is caused by debians toolchain default flags. you need to pass
> -march=armv7-a for the debian-neon pass to get armv7 instructions accepted.

 Now the NEON flavor implies armv7-a, so that's what we should turn on.


 Riku, Reinhard, I only checked the gcc tests in the attached debdiff,
 but didn't do a full build under Debian; would you mind trying it out?


 Now one thing which this patch does NOT do is turn on armv7-a for the
 NEON flavour if the toolchain defaults to armv6t2, so we might be
 missing some small optimizations, but I didn't check how to test for
 armv7-a versus armv6t2.  If ffmpeg relies on the some armv7-a-only
 assembly, then we will quickly find out  :-)

   Thanks,
-- 
Loïc Minier
-------------- next part --------------
diff -u ffmpeg-0.6~svn20100505/debian/confflags ffmpeg-0.6~svn20100505/debian/confflags
--- ffmpeg-0.6~svn20100505/debian/confflags
+++ ffmpeg-0.6~svn20100505/debian/confflags
@@ -33,11 +33,14 @@
     has_vfp := $(call check_asm, $(vfp_asm))
     neon_asm := vadd.i16 q0, q0, q0
     has_neon := $(call check_asm, $(neon_asm))
+    v6t2_asm := ubfx r0, r0, 0, 1
+    has_v6t2 := $(call check_asm, $(v6t2_asm))
 
-    # only build 
+    # only build a VFP flavour if the toolchain doesn't enable VFP by default
     ifneq ($(has_vfp),1)
     FLAVORS += vfp
     endif
+    # only build a NEON flavour if the toolchain doesn't enable NEON by default
     ifneq ($(has_neon),1)
     FLAVORS += neon
     endif
@@ -161,6 +164,12 @@
 # NB: NEON always implies v7+ and ffmpeg's NEON implementation requires VFP
 neon_build_confflags += $(confflags)
 neon_build_confflags += --shlibdir=/usr/lib/neon/vfp
+# the NEON pass now requires ubfx which was introduced in armv6t2; we need to
+# enable at least armv6t2 for the NEON pass to build, but NEON implies armv7-a
+# so pass armv7-a
+ifneq ($(has_v6t2),1)
+neon_build_confflags += --extra-cflags="-marmv7-a"
+endif
 neon_build_confflags += --extra-cflags="-mfpu=neon -mfloat-abi=softfp -fPIC -DPIC"
 neon_build_confflags += --enable-shared
 neon_build_confflags += --disable-static
diff -u ffmpeg-0.6~svn20100505/debian/changelog ffmpeg-0.6~svn20100505/debian/changelog
--- ffmpeg-0.6~svn20100505/debian/changelog
+++ ffmpeg-0.6~svn20100505/debian/changelog
@@ -1,3 +1,12 @@
+ffmpeg (4:0.6~svn20100505-2) UNRELEASED; urgency=low
+
+  * debian/confflags: detect whether the toolchain supports armv6t2 ("ubfx")
+    by default as that's now needed for the NEON pass; if it's not enabled by
+    default, pass -marmv7-a in extra-cflags for the NEON pass since NEON
+    implies ARMv7; closes: #594093.
+
+ -- Loïc Minier <loic.minier at linaro.org>  Wed, 25 Aug 2010 21:42:57 +0200
+
 ffmpeg (4:0.6~svn20100505-1) experimental; urgency=low
 
   * update to new upstream. Closes: #569727


More information about the pkg-multimedia-maintainers mailing list