aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-11-06 13:27:15 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-11-06 13:27:15 +0000
commitb6cecb4c2644527777b23833b0fa6e6fdb6b1e0b (patch)
treef3b37f0673ac87d4e6ab862f08d4f6fb7ad09b8f
parent51e522b3ffa25ebd6d003679ca34d780818a30e8 (diff)
downloadaports-b6cecb4c2644527777b23833b0fa6e6fdb6b1e0b.tar.bz2
aports-b6cecb4c2644527777b23833b0fa6e6fdb6b1e0b.tar.xz
main/libmad: armv7 build fix
-rw-r--r--main/libmad/APKBUILD4
-rw-r--r--main/libmad/Provide-Thumb-2-alternative-code-for-MAD_F_MLN.patch34
-rw-r--r--main/libmad/libmad.thumb.patch12
3 files changed, 50 insertions, 0 deletions
diff --git a/main/libmad/APKBUILD b/main/libmad/APKBUILD
index abf3be6935..d552568938 100644
--- a/main/libmad/APKBUILD
+++ b/main/libmad/APKBUILD
@@ -15,6 +15,8 @@ source="https://downloads.sourceforge.net/sourceforge/mad/$pkgname-$pkgver.tar.g
libmad-0.15.1b-cflags-O2.patch
libmad-0.15.1b-cflags.patch
automake.patch
+ libmad.thumb.patch
+ Provide-Thumb-2-alternative-code-for-MAD_F_MLN.patch
mad.pc
"
@@ -46,4 +48,6 @@ sha512sums="2cad30347fb310dc605c46bacd9da117f447a5cabedd8fefdb24ab5de641429e5ec5
13a8bac30cea4861f903b4abc8673f9a35b6253aae6a02915f99b67e5e8c56460fc1fb059a0aa52143b665f888928baba098daf0ed022420e46317be4dbc6161 libmad-0.15.1b-cflags-O2.patch
01dc8421dba2b652aa8ca6d1f1a5c310645465b18190ebfdeaae516de881869957e8e7c0c373d0d09623da33719d01e028f2f6164790b54c43a71271f5b4dbba libmad-0.15.1b-cflags.patch
e73ec5ae3b14e8d45579b52bcc561a309b85e1e51d946e061e2f0a9252f515e48e2d818e8bdce1adf5a9801ec314be8c911914d0bb12f9113a7afc54cf385250 automake.patch
+82c7e89433ceee2c9e48fc8930ea591f722b48e0a928721322a15c15e5c6a018c013d45deae583c4e583591a4cb9de50d0b2bd2ff76e18da3198609e8ea5cb33 libmad.thumb.patch
+9e9af20050c922c1c2f0b55009ae0eb20c9381eaff071f0dfee8a7b3a357e58f835f69364beb99820f5672459d88ac483d2419e1f9532d763779aafad7cbf72b Provide-Thumb-2-alternative-code-for-MAD_F_MLN.patch
ec0b14bd0c6236a216107b507b92c06e295352f1657ba5e45f37fff220a73e1454b262ac36fc715d698c4ffd210d348fca71cf0198e2c49d16fe0ec5ea839f08 mad.pc"
diff --git a/main/libmad/Provide-Thumb-2-alternative-code-for-MAD_F_MLN.patch b/main/libmad/Provide-Thumb-2-alternative-code-for-MAD_F_MLN.patch
new file mode 100644
index 0000000000..46415107d2
--- /dev/null
+++ b/main/libmad/Provide-Thumb-2-alternative-code-for-MAD_F_MLN.patch
@@ -0,0 +1,34 @@
+From: Dave Martin
+Subject: "rsc" doesnt exist anymore in thumb2
+
+diff --git a/fixed.h b/fixed.h
+index 4b58abf..ba4bc26 100644
+--- a/fixed.h
++++ b/fixed.h
+@@ -275,12 +275,25 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
+ : "+r" (lo), "+r" (hi) \
+ : "%r" (x), "r" (y))
+
++#ifdef __thumb__
++/* In Thumb-2, the RSB-immediate instruction is only allowed with a zero
++ operand. If needed this code can also support Thumb-1
++ (simply append "s" to the end of the second two instructions). */
++# define MAD_F_MLN(hi, lo) \
++ asm ("rsbs %0, %0, #0\n\t" \
++ "sbc %1, %1, %1\n\t" \
++ "sub %1, %1, %2" \
++ : "+&r" (lo), "=&r" (hi) \
++ : "r" (hi) \
++ : "cc")
++#else /* ! __thumb__ */
+ # define MAD_F_MLN(hi, lo) \
+ asm ("rsbs %0, %2, #0\n\t" \
+ "rsc %1, %3, #0" \
+- : "=r" (lo), "=r" (hi) \
++ : "=&r" (lo), "=r" (hi) \
+ : "0" (lo), "1" (hi) \
+ : "cc")
++#endif /* __thumb__ */
+
+ # define mad_f_scale64(hi, lo) \
+ ({ mad_fixed_t __result; \
diff --git a/main/libmad/libmad.thumb.patch b/main/libmad/libmad.thumb.patch
new file mode 100644
index 0000000000..13edde21fc
--- /dev/null
+++ b/main/libmad/libmad.thumb.patch
@@ -0,0 +1,12 @@
+--- ./imdct_l_arm.S.orig 2010-02-25 13:25:23.000000000 +0100
++++ ./imdct_l_arm.S 2010-02-25 13:27:26.000000000 +0100
+@@ -468,7 +468,7 @@
+
+ @----
+
+- add r2, pc, #(imdct36_long_karray-.-8) @ r2 = base address of Knn array (PIC safe ?)
++ adr r2, imdct36_long_karray
+
+
+ loop:
+