Skip to contentSkip to conversation

mariadb: Align atomic ops to help clang on x86

PATCH New Khem Raj 1 participant 1 message Mar 24, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 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'

---
v2: Use int64/uint64 instead of int64_t/uint64_t

 meta-oe/recipes-dbs/mysql/mariadb.inc         |   2 +
 .../mysql/mariadb/clang-64bit-atomics.patch   | 178 ++++++++++++++++++
 2 files changed, 180 insertions(+)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/clang-64bit-atomics.patch
meta-oe/recipes-dbs/mysql/mariadb.inc +2 -0
index 02ca5f96f2..855f124834 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"
 
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