Skip to contentSkip to conversation

mariadb: Align atomic ops to help clang on x86

PATCH Superseded Khem Raj 1 participant 1 message Mar 23, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 mariadb: Align atomic ops to help clang on x86

clang complains about alignments on 64bit atomics and falls back to using these functions from libatomic. And the configure part does not detect this condition and thinks that system can support 64bit atomics just fine.

clang needs this patch to fix

| pfs_instr.cc:(.text+0x10a5): undefined reference to `__atomic_fetch_add_8'

---
 meta-oe/recipes-dbs/mysql/mariadb.inc         |   4 +
 .../mysql/mariadb/clang-64bit-atomics.patch   | 178 ++++++++++++++++++
 2 files changed, 182 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/clang-64bit-atomics.patch
meta-oe/recipes-dbs/mysql/mariadb.inc +4 -0
index 02ca5f96f2..7139ba08a4 100644
@@ -20,6 +20,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
            file://mm_malloc.patch \
            file://sys_futex.patch \
            file://mariadb-openssl3.patch \
+           file://clang-64bit-atomics.patch \
           "
 SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
 
@@ -73,6 +74,7 @@ PACKAGECONFIG[openssl] = "-DWITH_SSL='system',-DWITH_SSL='bundled',openssl"
 # https://mariadb.atlassian.net/browse/MDEV-5982
 TARGET_CFLAGS += "-fuse-ld=bfd"
 LDFLAGS += " -pthread"
+
 BUILD_CFLAGS += "-fuse-ld=bfd"
 BUILD_CXXFLAGS += "-fuse-ld=bfd"
 
@@ -332,3 +334,5 @@ FILES:${PN}-server = "\
 
 DESCRIPTION:${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
 FILES:${PN}-leftovers = "/"
+
+CMAKE_VERBOSE = "VERBOSE=1"
meta-oe/recipes-dbs/mysql/mariadb/clang-64bit-atomics.patch new file +178 -0

178 lines not on this page · raw message

Signature · 1 line
2.35.1