aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-03-13 10:37:23 -0800
committerArmin Kuster <akuster808@gmail.com>2021-04-18 14:28:54 -0700
commita21c185df98e47599a53e3e2f66598e6d52f0075 (patch)
treeaa3c71f4ff2caa0871b3d867881710fd0e46f33c
parent730de4763a508234d09c755c838cdc4c8dd49493 (diff)
downloadmeta-openembedded-a21c185df98e47599a53e3e2f66598e6d52f0075.tar.gz
meta-openembedded-a21c185df98e47599a53e3e2f66598e6d52f0075.tar.bz2
meta-openembedded-a21c185df98e47599a53e3e2f66598e6d52f0075.zip
mariadb: Fix build on musl/ppc
Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit e68935ce287e2b0abd819180ebd86364c853d055) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb.inc2
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch50
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index 27eede6c3..1fbcb7142 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -22,6 +22,8 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${BP}/source/${BP}.tar.gz
file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \
file://0001-stacktrace-t.c-make-the-test-conditional.patch \
"
+SRC_URI_append_libc-musl = " file://ppc-remove-glibc-dep.patch"
+
SRC_URI[sha256sum] = "eb4824f6f2c532cd3fc6a6bce7bf78ea7c6b949f8bdd07656b2c84344e757be8"
UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch b/meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch
new file mode 100644
index 000000000..1ca86bcca
--- /dev/null
+++ b/meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch
@@ -0,0 +1,50 @@
+Remove glibc specific function dependencies
+
+Sourced from: https://git.alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/include/my_cpu.h
++++ b/include/my_cpu.h
+@@ -24,17 +24,16 @@
+ */
+
+ #ifdef _ARCH_PWR8
+-#include <sys/platform/ppc.h>
+ /* Very low priority */
+-#define HMT_very_low() __ppc_set_ppr_very_low()
++#define HMT_very_low() asm volatile("or 31,31,31")
+ /* Low priority */
+-#define HMT_low() __ppc_set_ppr_low()
++#define HMT_low() asm volatile ("or 1,1,1")
+ /* Medium low priority */
+-#define HMT_medium_low() __ppc_set_ppr_med_low()
++#define HMT_medium_low() asm volatile ("or 6,6,6")
+ /* Medium priority */
+-#define HMT_medium() __ppc_set_ppr_med()
++#define HMT_medium() asm volatile ("or 2,2,2")
+ /* Medium high priority */
+-#define HMT_medium_high() __ppc_set_ppr_med_high()
++#define HMT_medium_high() asm volatile("or 5,5,5")
+ /* High priority */
+ #define HMT_high() asm volatile("or 3,3,3")
+ #else
+@@ -81,7 +80,7 @@ static inline void MY_RELAX_CPU(void)
+ __asm__ __volatile__ ("pause");
+ #endif
+ #elif defined(_ARCH_PWR8)
+- __ppc_get_timebase();
++ __builtin_ppc_get_timebase();
+ #elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
+ /* Mainly, prevent the compiler from optimizing away delay loops */
+ __asm__ __volatile__ ("":::"memory");
+--- a/storage/tokudb/PerconaFT/portability/toku_time.h
++++ b/storage/tokudb/PerconaFT/portability/toku_time.h
+@@ -124,7 +124,7 @@ static inline tokutime_t toku_time_now(v
+ __asm __volatile__ ("mrs %[rt], cntvct_el0" : [rt] "=r" (result));
+ return result;
+ #elif defined(__powerpc__)
+- return __ppc_get_timebase();
++ return __builtin_ppc_get_timebase();
+ #else
+ #error No timer implementation for this platform
+ #endif