aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2020-02-26 23:38:34 +0100
committerAriadne Conill <ariadne@dereferenced.org>2020-02-26 23:58:55 +0000
commite38989a1c42e35773588cbbb678edf30ad376451 (patch)
tree0e393d12fbc3b76b2718414d77857514672f2eb8
parent5900f998271beb5d177ef45e23ad834d33e07244 (diff)
downloadaports-e38989a1c42e35773588cbbb678edf30ad376451.tar.bz2
aports-e38989a1c42e35773588cbbb678edf30ad376451.tar.xz
main/musl: thumb2 support for arm memcpy
-rw-r--r--main/musl/0001-add-thumb2-support-to-arm-assembler-memcpy.patch68
-rw-r--r--main/musl/APKBUILD4
2 files changed, 71 insertions, 1 deletions
diff --git a/main/musl/0001-add-thumb2-support-to-arm-assembler-memcpy.patch b/main/musl/0001-add-thumb2-support-to-arm-assembler-memcpy.patch
new file mode 100644
index 0000000000..08f73d937e
--- /dev/null
+++ b/main/musl/0001-add-thumb2-support-to-arm-assembler-memcpy.patch
@@ -0,0 +1,68 @@
+From 91e662d1d941215eb024787db5e910dbfb5b169f Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 13 Sep 2019 11:44:31 -0700
+Subject: [PATCH] add thumb2 support to arm assembler memcpy
+
+For Thumb2 compatibility, replace two instances of a single
+instruction "orr with a variable shift" with the two instruction
+equivalent. Neither of the replacements are in a performance critical
+loop.
+---
+ src/string/arm/memcpy.c | 2 +-
+ src/string/arm/memcpy_le.S | 13 ++++++++-----
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/string/arm/memcpy.c b/src/string/arm/memcpy.c
+index f703c9bd..041614f4 100644
+--- a/src/string/arm/memcpy.c
++++ b/src/string/arm/memcpy.c
+@@ -1,3 +1,3 @@
+-#if __ARMEB__ || __thumb__
++#if __ARMEB__
+ #include "../memcpy.c"
+ #endif
+diff --git a/src/string/arm/memcpy_le.S b/src/string/arm/memcpy_le.S
+index 9cfbcb2a..7b35d305 100644
+--- a/src/string/arm/memcpy_le.S
++++ b/src/string/arm/memcpy_le.S
+@@ -1,4 +1,4 @@
+-#if !__ARMEB__ && !__thumb__
++#if !__ARMEB__
+
+ /*
+ * Copyright (C) 2008 The Android Open Source Project
+@@ -40,8 +40,9 @@
+ * This file has been modified from the original for use in musl libc.
+ * The main changes are: addition of .type memcpy,%function to make the
+ * code safely callable from thumb mode, adjusting the return
+- * instructions to be compatible with pre-thumb ARM cpus, and removal
+- * of prefetch code that is not compatible with older cpus.
++ * instructions to be compatible with pre-thumb ARM cpus, removal of
++ * prefetch code that is not compatible with older cpus and support for
++ * building as thumb 2.
+ */
+
+ .syntax unified
+@@ -241,7 +242,8 @@ non_congruent:
+ beq 2f
+ ldr r5, [r1], #4
+ sub r2, r2, #4
+- orr r4, r3, r5, lsl lr
++ mov r4, r5, lsl lr
++ orr r4, r4, r3
+ mov r3, r5, lsr r12
+ str r4, [r0], #4
+ cmp r2, #4
+@@ -348,7 +350,8 @@ less_than_thirtytwo:
+
+ 1: ldr r5, [r1], #4
+ sub r2, r2, #4
+- orr r4, r3, r5, lsl lr
++ mov r4, r5, lsl lr
++ orr r4, r4, r3
+ mov r3, r5, lsr r12
+ str r4, [r0], #4
+ cmp r2, #4
+--
+2.24.1
+
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 3400b5909e..7b8467d6d9 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.24
-pkgrel=0
+pkgrel=1
pkgdesc="the musl c library (libc) implementation"
url="https://musl.libc.org/"
arch="all"
@@ -19,6 +19,7 @@ nolibc) ;;
esac
source="https://musl.libc.org/releases/musl-$pkgver.tar.gz
handle-aux-at_base.patch
+ 0001-add-thumb2-support-to-arm-assembler-memcpy.patch
ldconfig
__stack_chk_fail_local.c
@@ -161,6 +162,7 @@ compat() {
sha512sums="8987f1e194ea616f34f4f21fe9def28fb7f81d7060e38619206c6349f79db3bbb76bae8b711f5f9b8ed038799c9aea1a4cbec69e0bc4131e246203e133149e77 musl-1.1.24.tar.gz
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
+2b26c20112e3984a2501bc6c2f5162c6e60d4a521d9367dc7721ec66c974986e9f98a67e9f4f4c1510e82a0ac47de783317ab254786837c2e86a54122efcc1dd 0001-add-thumb2-support-to-arm-assembler-memcpy.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c