aboutsummaryrefslogtreecommitdiffstats
path: root/community/rethinkdb
diff options
context:
space:
mode:
authorossdev <ossdev@puresoftware.com>2019-08-07 11:37:46 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2019-08-14 13:33:50 +0000
commitda4ea7010152dc36fb1eb52b9824534c74d9f59d (patch)
tree983e959964c813e8d43cf4af3da824098641d6d7 /community/rethinkdb
parent196466b3a6a2f483897cba5f073db8962bc1117d (diff)
downloadaports-da4ea7010152dc36fb1eb52b9824534c74d9f59d.tar.bz2
aports-da4ea7010152dc36fb1eb52b9824534c74d9f59d.tar.xz
community/rethinkdb: Enable aarch64 support Provided support for aarch64
Signed-off-by: ossdev <ossdev@puresoftware.com>
Diffstat (limited to 'community/rethinkdb')
-rw-r--r--community/rethinkdb/APKBUILD4
-rw-r--r--community/rethinkdb/support-aarch64.patch133
2 files changed, 136 insertions, 1 deletions
diff --git a/community/rethinkdb/APKBUILD b/community/rethinkdb/APKBUILD
index 5f825b7ea0..bf423007a1 100644
--- a/community/rethinkdb/APKBUILD
+++ b/community/rethinkdb/APKBUILD
@@ -5,7 +5,7 @@ pkgver=2.3.6
pkgrel=11
pkgdesc="Distributed powerful and scalable NoSQL database"
url="https://www.rethinkdb.com"
-arch="x86_64 ppc64le s390x"
+arch="x86_64 ppc64le s390x aarch64"
license="Apache-2.0"
options="!check" # needs coffeescript
makedepends="bash python2 linux-headers bsd-compat-headers m4 paxmark
@@ -21,6 +21,7 @@ source="https://download.rethinkdb.com/dist/$pkgname-$pkgver.tgz
enable-build-ppc64le.patch
enable-build-s390x.patch
paxmark-x86_64.patch
+ support-aarch64.patch
rethinkdb.initd
rethinkdb.confd
"
@@ -89,5 +90,6 @@ sha512sums="653177750f7439fa1d61a121e488d578be1eab90f87c7d17ad52b9793d8543f22bbe
63e9b4c145617a91d00c78c980937c4f4dc010c7bc4a8db8d7ecaad47dbecd0333fcaadbfe0251dee50f44494e802db5322d8cc0096cf614f44fd4069e82f8ac enable-build-ppc64le.patch
04f6e00242ce025ba116e3dae1bf9ccd887901d9d0700faa006b72c4a1c5bd94996a9062db32b11ed0cd6a96af1f11786746ba446d288f6d921f6d93c2158cae enable-build-s390x.patch
c5a7905c116a2bf7af5ce5f8e6536c61e06ee9ac7cbead0358396e0989141890908eab694f4a88f0dcaf9f4ddcefe751dc7a949cbb4c870d87f61e720ef3b45a paxmark-x86_64.patch
+c392b409da5a2daf1fcf0868a070d9a12d9ce9cf2fc668e3171ed7b2185b57a1c90d6efe14a6da24a04ed98e0db5a945431d3df4b4aa1153b2a6ec4b95c0a24b support-aarch64.patch
c27e21073048bd5e8e2ec91303b43ce873748573e2b44ba28ee57ca1b3080afb67e56880b6a6da7a0abf4f2967dce45aa27fe8d6dd44b70d874d776e876ef132 rethinkdb.initd
3a07f9c78ef96b2ca37fca508ee14a644d3c08612f662ba5260182fbfcceba064d20253f1261f56dc0a2c28d1a4d5e2320872c3c4e7595cb7ab4e202eb28ad42 rethinkdb.confd"
diff --git a/community/rethinkdb/support-aarch64.patch b/community/rethinkdb/support-aarch64.patch
new file mode 100644
index 0000000000..0e36d6969a
--- /dev/null
+++ b/community/rethinkdb/support-aarch64.patch
@@ -0,0 +1,133 @@
+--- a/configure
++++ b/configure
+@@ -81,7 +81,7 @@
+ case "${MACHINE%%-*}" in
+ x86_64|i?86)
+ true ;;
+- arm*)
++ arm* | aarch64)
+ var_append LDFLAGS -ldl
+ final_warning="ARM support is still experimental" ;;
+ *)
+--- a/src/rpc/connectivity/cluster.cc
++++ b/src/rpc/connectivity/cluster.cc
+@@ -103,7 +103,7 @@
+ return false;
+ }
+
+-#if defined (__x86_64__) || defined (_WIN64)
++#if defined (__x86_64__) || defined (_WIN64) || defined (__aarch64__)
+ const std::string connectivity_cluster_t::cluster_arch_bitsize("64bit");
+ #elif defined (__i386__) || defined(__arm__)
+ const std::string connectivity_cluster_t::cluster_arch_bitsize("32bit");
+--- a/mk/support/pkg/v8.sh
++++ b/mk/support/pkg/v8.sh
+@@ -39,11 +39,13 @@
+ fi
+ arch_gypflags=
+ raspberry_pi_gypflags='-Darm_version=6 -Darm_fpu=vfpv2'
++ v8_gypflags='-Darm_version=8 -Darm_fpu=vfpv4'
+ host=$($CXX -dumpmachine)
+ case ${host%%-*} in
+ i?86) arch=ia32 ;;
+ x86_64) arch=x64 ;;
+ arm*) arch=arm; arch_gypflags=$raspberry_pi_gypflags ;;
++ aarch64) arch=arm64; arch_gypflags=$v8_gypflags ;;
+ *) arch=native ;;
+ esac
+ mode=release
+--- a/src/arch/runtime/context_switching.cc
++++ b/src/arch/runtime/context_switching.cc
+@@ -98,7 +98,7 @@
+ the stack by swapcontext; they're callee-saved, so whatever happens to be in
+ them will be ignored. */
+ sp -= 6;
+-#elif defined(__arm__)
++#elif defined(__arm__) || defined(__aarch64__)
+ /* We must preserve r4, r5, r6, r7, r8, r9, r10, and r11. Because we have to store the LR (r14) in swapcontext as well, we also store r12 in swapcontext to keep the stack double-word-aligned. However, we already accounted for both of those by decrementing sp twice above (once for r14 and once for r12, say). */
+ sp -= 8;
+ #else
+@@ -262,7 +262,7 @@
+ }
+
+ asm(
+-#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
+ // We keep the i386, x86_64, and ARM stuff interleaved in order to enforce commonality.
+ #if defined(__x86_64__)
+ #if defined(__LP64__) || defined(__LLP64__)
+@@ -279,7 +279,7 @@
+ /* `current_pointer_out` is in `4(%ebp)`. `dest_pointer` is in `8(%ebp)`. */
+ #elif defined(__x86_64__)
+ /* `current_pointer_out` is in `%rdi`. `dest_pointer` is in `%rsi`. */
+-#elif defined(__arm__)
++#elif defined(__arm__) || defined(__aarch64__)
+ /* `current_pointer_out` is in `r0`. `dest_pointer` is in `r1` */
+ #endif
+
+@@ -302,6 +302,17 @@
+ "push {r12}\n"
+ "push {r14}\n"
+ "push {r4-r11}\n"
++#elif defined(__aarch64__)
++ "str x12, [sp, #-8]!\n"
++ "str x14, [sp, #-8]!\n"
++ "str x4, [sp, #-8]!\n"
++ "str x5, [sp, #-8]!\n"
++ "str x6, [sp, #-8]!\n"
++ "str x7, [sp, #-8]!\n"
++ "str x8, [sp, #-8]!\n"
++ "str x9, [sp, #-8]!\n"
++ "str x10, [sp, #-8]!\n"
++ "str x11, [sp, #-8]!\n"
+ #endif
+
+ /* Save old stack pointer. */
+@@ -316,6 +327,9 @@
+ #elif defined(__arm__)
+ /* On ARM, the first argument is in `r0`. `r13` is the stack pointer. */
+ "str r13, [r0]\n"
++#elif defined(__aarch64__)
++ /* On aarch64, the first argument is in `x0`. `sp` is the stack pointer. */
++ "str x0, [sp, #-8]\n"
+ #endif
+
+ /* Load the new stack pointer and the preserved registers. */
+@@ -330,6 +344,9 @@
+ #elif defined(__arm__)
+ /* On ARM, the second argument is in `r1` */
+ "mov r13, r1\n"
++#elif defined(__aarch64__)
++ /* On aarch64, the second argument is in `x1` */
++ "mov x13, x1\n"
+ #endif
+
+ #if defined(__i386__)
+@@ -348,6 +365,17 @@
+ "pop {r4-r11}\n"
+ "pop {r14}\n"
+ "pop {r12}\n"
++#elif defined(__aarch64__)
++ "ldr x4, [sp], #8\n"
++ "ldr x5, [sp], #8\n"
++ "ldr x6, [sp], #8\n"
++ "ldr x7, [sp], #8\n"
++ "ldr x8, [sp], #8\n"
++ "ldr x9, [sp], #8\n"
++ "ldr x10, [sp], #8\n"
++ "ldr x11, [sp], #8\n"
++ "ldr x14, [sp], #8\n"
++ "ldr x12, [sp], #8\n"
+ #endif
+
+ #if defined(__i386__) || defined(__x86_64__)
+@@ -360,6 +388,8 @@
+ /* Above, we popped `LR` (`r14`) off the stack, so the bx instruction will
+ jump to the correct return address. */
+ "bx r14\n"
++#elif defined(__aarch64__)
++ "ret\n"
+ #endif
+
+ #else
+