[SCM] ffmpeg/master: Add 0005-arm-thumb2-blx.patch to fix SIGBUS on armhf

jcowgill at users.alioth.debian.org jcowgill at users.alioth.debian.org
Wed Aug 9 01:58:18 UTC 2017


The following commit has been merged in the master branch:
commit 70c6162e47dedc45943835aa899db70e0b0522a4
Author: James Cowgill <james410 at cowgill.org.uk>
Date:   Tue Aug 8 20:55:05 2017 -0400

    Add 0005-arm-thumb2-blx.patch to fix SIGBUS on armhf
    
    Closes: #870622
    Thanks: Jiong Wang

diff --git a/debian/patches/0005-arm-thumb2-blx.patch b/debian/patches/0005-arm-thumb2-blx.patch
new file mode 100644
index 0000000..07025ec
--- /dev/null
+++ b/debian/patches/0005-arm-thumb2-blx.patch
@@ -0,0 +1,80 @@
+Description: Fix SIGBUS on armhf when compiled with binutils 2.29
+ In binutils 2.29, the behavior of the ADR instruction changed so that 1 is
+ added to the address of a Thumb function (previously nothing was added). This
+ allows the loaded address to be passed to a BLX instruction and the correct
+ mode change will occur.
+ .
+ So that the behavior matches in binutils 2.29 and pre-2.29:
+ - Use .eqv to clear the function attribute from a symbol
+ - This allows us to always add 1 to the symbol when in Thumb mode and get the
+   correct result.
+ .
+ See: https://sourceware.org/bugzilla/show_bug.cgi?id=21458
+ Thanks to Jiong Wang for original idea to solve this.
+Author: James Cowgill <jcowgill at debian.org>
+Bug: https://trac.ffmpeg.org/ticket/6571
+Bug-Debian: https://bugs.debian.org/870622
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/libavcodec/arm/h264idct_neon.S
++++ b/libavcodec/arm/h264idct_neon.S
+@@ -20,6 +20,15 @@
+ 
+ #include "libavutil/arm/asm.S"
+ 
++# These .eqv clear the function attribute allowing the +CONFIG_THUMB hack to
++# work on old and new binutils.
++#
++# See: https://sourceware.org/bugzilla/show_bug.cgi?id=21458
++.eqv wfa_ff_h264_idct_add_neon,     X(ff_h264_idct_add_neon)
++.eqv wfa_ff_h264_idct_dc_add_neon,  X(ff_h264_idct_dc_add_neon)
++.eqv wfa_ff_h264_idct8_add_neon,    X(ff_h264_idct8_add_neon)
++.eqv wfa_ff_h264_idct8_dc_add_neon, X(ff_h264_idct8_dc_add_neon)
++
+ function ff_h264_idct_add_neon, export=1
+         vld1.64         {d0-d3},  [r1,:128]
+         vmov.i16        q15, #0
+@@ -113,8 +122,8 @@ function ff_h264_idct_add16_neon, export
+         movne           lr,  #0
+         cmp             lr,  #0
+         ite             ne
+-        adrne           lr,  X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
+-        adreq           lr,  X(ff_h264_idct_add_neon)    + CONFIG_THUMB
++        adrne           lr,  wfa_ff_h264_idct_dc_add_neon + CONFIG_THUMB
++        adreq           lr,  wfa_ff_h264_idct_add_neon    + CONFIG_THUMB
+         blx             lr
+ 2:      subs            ip,  ip,  #1
+         add             r1,  r1,  #32
+@@ -138,8 +147,8 @@ function ff_h264_idct_add16intra_neon, e
+         cmp             r8,  #0
+         ldrsh           r8,  [r1]
+         iteet           ne
+-        adrne           lr,  X(ff_h264_idct_add_neon)    + CONFIG_THUMB
+-        adreq           lr,  X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
++        adrne           lr,  wfa_ff_h264_idct_add_neon    + CONFIG_THUMB
++        adreq           lr,  wfa_ff_h264_idct_dc_add_neon + CONFIG_THUMB
+         cmpeq           r8,  #0
+         blxne           lr
+         subs            ip,  ip,  #1
+@@ -166,8 +175,8 @@ function ff_h264_idct_add8_neon, export=
+         cmp             r8,  #0
+         ldrsh           r8,  [r1]
+         iteet           ne
+-        adrne           lr,  X(ff_h264_idct_add_neon)    + CONFIG_THUMB
+-        adreq           lr,  X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
++        adrne           lr,  wfa_ff_h264_idct_add_neon    + CONFIG_THUMB
++        adreq           lr,  wfa_ff_h264_idct_dc_add_neon + CONFIG_THUMB
+         cmpeq           r8,  #0
+         blxne           lr
+         add             r12, r12, #1
+@@ -388,8 +397,8 @@ function ff_h264_idct8_add4_neon, export
+         movne           lr,  #0
+         cmp             lr,  #0
+         ite             ne
+-        adrne           lr,  X(ff_h264_idct8_dc_add_neon) + CONFIG_THUMB
+-        adreq           lr,  X(ff_h264_idct8_add_neon)    + CONFIG_THUMB
++        adrne           lr,  wfa_ff_h264_idct8_dc_add_neon + CONFIG_THUMB
++        adreq           lr,  wfa_ff_h264_idct8_add_neon    + CONFIG_THUMB
+         blx             lr
+ 2:      subs            r12, r12, #4
+         add             r1,  r1,  #128
diff --git a/debian/patches/series b/debian/patches/series
index e5ef058..812c215 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-sws-tests-pixdesc_query-sort-pixel-formats.patch
 0003-sws-tests-pixdesc_query-replace-rgb-based-pix-fmts-w.patch
 0004-swscale-fix-gbrap16-alpha-channel-issues.patch
+0005-arm-thumb2-blx.patch

-- 
ffmpeg packaging



More information about the pkg-multimedia-commits mailing list