diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:29 +0000 |
commit | 82a6365993a3c6650c39a1bca3ec3ccba827b763 (patch) | |
tree | 5c5987626fe4696f54de9cdedfa95e0251e4e7b4 /debian/patches/c11_atomics.patch | |
parent | Adding upstream version 1:10.5.12. (diff) | |
download | mariadb-10.5-dbcad6a0686830235bf595bc3a2ac5211098858f.tar.xz mariadb-10.5-dbcad6a0686830235bf595bc3a2ac5211098858f.zip |
Adding debian version 1:10.5.12-1.debian/1%10.5.12-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/patches/c11_atomics.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/debian/patches/c11_atomics.patch b/debian/patches/c11_atomics.patch new file mode 100644 index 00000000..00768729 --- /dev/null +++ b/debian/patches/c11_atomics.patch @@ -0,0 +1,75 @@ +Forwarded: https://github.com/MariaDB/server/pull/1716 +Author: Vicențiu Ciorbaru <vicentiu@mariadb.org> +Date: Fri Dec 21 19:14:04 2018 +0200 + + Link with libatomic to enable C11 atomics support + + Some architectures (mips) require libatomic to support proper + atomic operations. Check first if support is available without + linking, otherwise use the library. + + Original commit: + Detect whether libatomic is needed rather than hard-coding for mips + + Fixes FTBFS on powerpc, since it needs libatomic too for C11 atomics, + and possibly m68k. + + Contributors: + James Cowgill <jcowgill@debian.org> + Jessica Clarke <jrtc27@debian.org> + +--- a/configure.cmake ++++ b/configure.cmake +@@ -866,7 +866,25 @@ int main() + long long int *ptr= &var; + return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); + }" +-HAVE_GCC_C11_ATOMICS) ++HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) ++IF (HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) ++ SET(HAVE_GCC_C11_ATOMICS True) ++ELSE() ++ SET(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) ++ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") ++ CHECK_CXX_SOURCE_COMPILES(" ++ int main() ++ { ++ long long int var= 1; ++ long long int *ptr= &var; ++ return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); ++ }" ++ HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) ++ IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) ++ SET(HAVE_GCC_C11_ATOMICS True) ++ ENDIF() ++ SET(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES}) ++ENDIF() + + IF(WITH_VALGRIND) + SET(HAVE_valgrind 1) +--- a/mysys/CMakeLists.txt ++++ b/mysys/CMakeLists.txt +@@ -168,6 +168,10 @@ TARGET_LINK_LIBRARIES(mysys dbug strings + ${LIBNSL} ${LIBM} ${LIBRT} ${CMAKE_DL_LIBS} ${LIBSOCKET} ${LIBEXECINFO}) + DTRACE_INSTRUMENT(mysys) + ++IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) ++ TARGET_LINK_LIBRARIES(mysys atomic) ++ENDIF() ++ + IF(HAVE_BFD_H) + TARGET_LINK_LIBRARIES(mysys bfd) + ENDIF(HAVE_BFD_H) +--- a/sql/CMakeLists.txt ++++ b/sql/CMakeLists.txt +@@ -320,6 +320,10 @@ IF(WITH_MYSQLD_LDFLAGS) + "${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}") + ENDIF() + ++IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) ++ TARGET_LINK_LIBRARIES(sql atomic) ++ENDIF() ++ + + FIND_PACKAGE(BISON 2.0) + |