[hardknott 07/15] mariadb: Fix build with clang/musl


Armin Kuster
 

From: Khem Raj <raj.khem@...>

Signed-off-by: Khem Raj <raj.khem@...>
(cherry picked from commit abbca30bd61c0ff856785900aac899ab33ead08b)
Signed-off-by: Armin Kuster <akuster808@...>
---
meta-oe/recipes-dbs/mysql/mariadb.inc | 1 +
meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch | 11 +++++++++++
2 files changed, 12 insertions(+)
create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch

diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index 25e630a16a..18b025070b 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -23,6 +23,7 @@ SRC_URI = "https://downloads.mariadb.org/interstitial/${BP}/source/${BP}.tar.gz
file://sys_futex.patch \
file://cross-compiling.patch \
file://ssize_t.patch \
+ file://mm_malloc.patch \
"
SRC_URI_append_libc-musl = " file://ppc-remove-glibc-dep.patch"

diff --git a/meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch b/meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch
new file mode 100644
index 0000000000..347fcd8516
--- /dev/null
+++ b/meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch
@@ -0,0 +1,11 @@
+--- a/storage/rocksdb/rocksdb/port/jemalloc_helper.h
++++ b/storage/rocksdb/rocksdb/port/jemalloc_helper.h
+@@ -5,7 +5,7 @@
+
+ #pragma once
+
+-#if defined(__clang__)
++#if defined(__clang__) && defined(__GLIBC__)
+ // glibc's `posix_memalign()` declaration specifies `throw()` while clang's
+ // declaration does not. There is a hack in clang to make its re-declaration
+ // compatible with glibc's if they are declared consecutively. That hack breaks
--
2.25.1

Join openembedded-devel@lists.openembedded.org to automatically receive all group messages.