commit e761b2fdca4a74955a03a180f2431f3e35aeccc4 Author: Jiayi Yin Date: Sun May 18 17:50:35 2025 +0000 转换LFS仓库为普通仓库 diff --git a/README.mysql-docs b/README.mysql-docs new file mode 100644 index 0000000..dd894a7 --- /dev/null +++ b/README.mysql-docs @@ -0,0 +1,4 @@ +The official MySQL documentation is not freely redistributable, so we cannot +include it in RHEL or Fedora. You can find it on-line at + +http://dev.mysql.com/doc/ diff --git a/README.mysql-license b/README.mysql-license new file mode 100644 index 0000000..ceabbcf --- /dev/null +++ b/README.mysql-license @@ -0,0 +1,9 @@ +MySQL is distributed under GPL v2, but there are some licensing exceptions +that allow the client libraries to be linked with a non-GPL application, +so long as the application is under a license approved by Oracle. +For details see + +http://www.mysql.com/about/legal/licensing/foss-exception/ + +Some innobase code from Percona and Google is under BSD license. +Some code related to test-suite is under LGPLv2. diff --git a/RPM-GPG-KEY-mysql-2023 b/RPM-GPG-KEY-mysql-2023 new file mode 100644 index 0000000..dc52c49 --- /dev/null +++ b/RPM-GPG-KEY-mysql-2023 @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGU2rNoBEACSi5t0nL6/Hj3d0PwsbdnbY+SqLUIZ3uWZQm6tsNhvTnahvPPZ +BGdl99iWYTt2KmXp0KeN2s9pmLKkGAbacQP1RqzMFnoHawSMf0qTUVjAvhnI4+qz +MDjTNSBq9fa3nHmOYxownnrRkpiQUM/yD7/JmVENgwWb6akZeGYrXch9jd4XV3t8 +OD6TGzTedTki0TDNr6YZYhC7jUm9fK9Zs299pzOXSxRRNGd+3H9gbXizrBu4L/3l +UrNf//rM7OvV9Ho7u9YYyAQ3L3+OABK9FKHNhrpi8Q0cbhvWkD4oCKJ+YZ54XrOG +0YTg/YUAs5/3//FATI1sWdtLjJ5pSb0onV3LIbarRTN8lC4Le/5kd3lcot9J8b3E +MXL5p9OGW7wBfmNVRSUI74Vmwt+v9gyp0Hd0keRCUn8lo/1V0YD9i92KsE+/IqoY +Tjnya/5kX41jB8vr1ebkHFuJ404+G6ETd0owwxq64jLIcsp/GBZHGU0RKKAo9DRL +H7rpQ7PVlnw8TDNlOtWt5EJlBXFcPL+NgWbqkADAyA/XSNeWlqonvPlYfmasnAHA +pMd9NhPQhC7hJTjCiAwG8UyWpV8Dj07DHFQ5xBbkTnKH2OrJtguPqSNYtTASbsWz +09S8ujoTDXFT17NbFM2dMIiq0a4VQB3SzH13H2io9Cbg/TzJrJGmwgoXgwARAQAB +tDZNeVNRTCBSZWxlYXNlIEVuZ2luZWVyaW5nIDxteXNxbC1idWlsZEBvc3Mub3Jh +Y2xlLmNvbT6JAlQEEwEIAD4WIQS8pDQXw7SF3RKOxtS3s7eIqNN4XAUCZTas2gIb +AwUJA8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC3s7eIqNN4XLzoD/9P +lpWtfHlI8eQTHwGsGIwFA+fgipyDElapHw3MO+K9VOEYRZCZSuBXHJe9kjGEVCGU +DrfImvgTuNuqYmVUV+wyhP+w46W/cWVkqZKAW0hNp0TTvu3eDwap7gdk80VF24Y2 +Wo0bbiGkpPiPmB59oybGKaJ756JlKXIL4hTtK3/hjIPFnb64Ewe4YLZyoJu0fQOy +A8gXuBoalHhUQTbRpXI0XI3tpZiQemNbfBfJqXo6LP3/LgChAuOfHIQ8alvnhCwx +hNUSYGIRqx+BEbJw1X99Az8XvGcZ36VOQAZztkW7mEfH9NDPz7MXwoEvduc61xwl +MvEsUIaSfn6SGLFzWPClA98UMSJgF6sKb+JNoNbzKaZ8V5w13msLb/pq7hab72HH +99XJbyKNliYj3+KA3q0YLf+Hgt4Y4EhIJ8x2+g690Np7zJF4KXNFbi1BGloLGm78 +akY1rQlzpndKSpZq5KWw8FY/1PEXORezg/BPD3Etp0AVKff4YdrDlOkNB7zoHRfF +HAvEuuqti8aMBrbRnRSG0xunMUOEhbYS/wOOTl0g3bF9NpAkfU1Fun57N96Us2T9 +gKo9AiOY5DxMe+IrBg4zaydEOovgqNi2wbU0MOBQb23Puhj7ZCIXcpILvcx9ygjk +ONr75w+XQrFDNeux4Znzay3ibXtAPqEykPMZHsZ2sbkCDQRlNqzaARAAsdvBo8WR +qZ5WVVk6lReD8b6Zx83eJUkV254YX9zn5t8KDRjYOySwS75mJIaZLsv0YQjJk+5r +t10tejyCrJIFo9CMvCmjUKtVbgmhfS5+fUDRrYCEZBBSa0Dvn68EBLiHugr+SPXF +6o1hXEUqdMCpB6oVp6X45JVQroCKIH5vsCtw2jU8S2/IjjV0V+E/zitGCiZaoZ1f +6NG7ozyFep1CSAReZu/sssk0pCLlfCebRd9Rz3QjSrQhWYuJa+eJmiF4oahnpUGk +txMD632I9aG+IMfjtNJNtX32MbO+Se+cCtVc3cxSa/pR+89a3cb9IBA5tFF2Qoek +hqo/1mmLi93Xn6uDUhl5tVxTnB217dBT27tw+p0hjd9hXZRQbrIZUTyh3+8EMfmA +jNSIeR+th86xRd9XFRr9EOqrydnALOUr9cT7TfXWGEkFvn6ljQX7f4RvjJOTbc4j +JgVFyu8K+VU6u1NnFJgDiNGsWvnYxAf7gDDbUSXEuC2anhWvxPvpLGmsspngge4y +l+3nv+UqZ9sm6LCebR/7UZ67tYz3p6xzAOVgYsYcxoIUuEZXjHQtsYfTZZhrjUWB +J09jrMvlKUHLnS437SLbgoXVYZmcqwAWpVNOLZf+fFm4IE5aGBG5Dho2CZ6ujngW +9Zkn98T1d4N0MEwwXa2V6T1ijzcqD7GApZUAEQEAAYkCPAQYAQgAJhYhBLykNBfD +tIXdEo7G1Lezt4io03hcBQJlNqzaAhsMBQkDwmcAAAoJELezt4io03hcXqMP/01a +PT3A3Sg7oTQoHdCxj04ELkzrezNWGM+YwbSKrR2LoXR8zf2tBFzc2/Tl98V0+68f +/eCvkvqCuOtq4392Ps23j9W3r5XG+GDOwDsx0gl0E+Qkw07pwdJctA6efsmnRkjF +2YVO0N9MiJA1tc8NbNXpEEHJZ7F8Ri5cpQrGUz/AY0eae2b7QefyP4rpUELpMZPj +c8Px39Fe1DzRbT+5E19TZbrpbwlSYs1iCzS5YGFmpCRyZcLKXo3zS6N22+82cnRB +SPPipiO6WaQawcVMlQO1SX0giB+3/DryfN9VuIYd1EWCGQa3O0MVu6o5KVHwPgl9 +R1P6xPZhurkDpAd0b1s4fFxin+MdxwmG7RslZA9CXRPpzo7/fCMW8sYOH15DP+Yf +UckoEreBt+zezBxbIX2CGGWEV9v3UBXadRtwxYQ6sN9bqW4jm1b41vNA17b6CVH6 +sVgtU3eN+5Y9an1e5jLD6kFYx+OIeqIIId/TEqwS61csY9aav4j4KLOZFCGNU0FV +ji7NQewSpepTcJwfJDOzmtiDP4vol1ApJGLRwZZZ9PB6wsOgDOoP6sr0YrDI/NNX +2RyXXbglnQ1yJZVSH3/3eo6knG2qTthUKHCRDNKdy9Qqc1x4WWWtSRjh+zX8AvJK +2q1rVLH2/3ilxe9wcAZUlaj3id3TxquAlud4lWDz +=h5nH +-----END PGP PUBLIC KEY BLOCK----- diff --git a/boost-1.57.0-mpl-print.patch b/boost-1.57.0-mpl-print.patch new file mode 100644 index 0000000..561cef1 --- /dev/null +++ b/boost-1.57.0-mpl-print.patch @@ -0,0 +1,31 @@ +diff -up boost_1_57_0/boost/mpl/print.hpp\~ boost_1_57_0/boost/mpl/print.hpp +--- boost_1_57_0/boost/mpl/print.hpp~ 2014-07-09 23:12:31.000000000 +0200 ++++ boost_1_57_0/boost/mpl/print.hpp 2015-01-20 12:44:59.621400948 +0100 +@@ -52,16 +52,15 @@ struct print + enum { n = sizeof(T) + -1 }; + #elif defined(__MWERKS__) + void f(int); +-#else +- enum { +- n = +-# if defined(__EDG_VERSION__) +- aux::dependent_unsigned::value > -1 +-# else +- sizeof(T) > -1 +-# endif +- }; +-#endif ++#elif defined(__EDG_VERSION__) ++ enum { n = aux::dependent_unsigned::value > -1 }; ++#elif defined(BOOST_GCC) ++ enum { n1 }; ++ enum { n2 }; ++ enum { n = n1 != n2 }; ++#else ++ enum { n = sizeof(T) > -1 }; ++#endif + }; + + #if defined(BOOST_MSVC) + +Diff finished. Tue Jan 20 12:45:03 2015 diff --git a/boost-1.58.0-pool.patch b/boost-1.58.0-pool.patch new file mode 100644 index 0000000..ed8449e --- /dev/null +++ b/boost-1.58.0-pool.patch @@ -0,0 +1,120 @@ +Index: boost/pool/pool.hpp +=================================================================== +--- boost/pool/pool.hpp (revision 78317) ++++ boost/pool/pool.hpp (revision 78326) +@@ -27,4 +27,6 @@ + #include + ++// std::numeric_limits ++#include + // boost::integer::static_lcm + #include +@@ -358,4 +360,11 @@ + } + ++ size_type max_chunks() const ++ { //! Calculated maximum number of memory chunks that can be allocated in a single call by this Pool. ++ size_type partition_size = alloc_size(); ++ size_type POD_size = integer::static_lcm::value + sizeof(size_type); ++ return (std::numeric_limits::max() - POD_size) / alloc_size(); ++ } ++ + static void * & nextof(void * const ptr) + { //! \returns Pointer dereferenced. +@@ -377,5 +388,7 @@ + //! the first time that object needs to allocate system memory. + //! The default is 32. This parameter may not be 0. +- //! \param nmax_size is the maximum number of chunks to allocate in one block. ++ //! \param nmax_size is the maximum number of chunks to allocate in one block. ++ set_next_size(nnext_size); ++ set_max_size(nmax_size); + } + +@@ -400,7 +413,7 @@ + } + void set_next_size(const size_type nnext_size) +- { //! Set number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0. +- //! \returns nnext_size. +- next_size = start_size = nnext_size; ++ { //! Set number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0. ++ BOOST_USING_STD_MIN(); ++ next_size = start_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nnext_size, max_chunks()); + } + size_type get_max_size() const +@@ -410,5 +423,6 @@ + void set_max_size(const size_type nmax_size) + { //! Set max_size. +- max_size = nmax_size; ++ BOOST_USING_STD_MIN(); ++ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks()); + } + size_type get_requested_size() const +@@ -713,7 +727,7 @@ + BOOST_USING_STD_MIN(); + if(!max_size) +- next_size <<= 1; ++ set_next_size(next_size << 1); + else if( next_size*partition_size/requested_size < max_size) +- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size); ++ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size)); + + // initialize it, +@@ -753,7 +767,7 @@ + BOOST_USING_STD_MIN(); + if(!max_size) +- next_size <<= 1; ++ set_next_size(next_size << 1); + else if( next_size*partition_size/requested_size < max_size) +- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size); ++ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size)); + + // initialize it, +@@ -797,4 +811,6 @@ + //! \returns Address of chunk n if allocated ok. + //! \returns 0 if not enough memory for n chunks. ++ if (n > max_chunks()) ++ return 0; + + const size_type partition_size = alloc_size(); +@@ -845,7 +861,7 @@ + BOOST_USING_STD_MIN(); + if(!max_size) +- next_size <<= 1; ++ set_next_size(next_size << 1); + else if( next_size*partition_size/requested_size < max_size) +- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size); ++ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size)); + + // insert it into the list, +Index: libs/pool/test/test_bug_6701.cpp +=================================================================== +--- libs/pool/test/test_bug_6701.cpp (revision 78326) ++++ libs/pool/test/test_bug_6701.cpp (revision 78326) +@@ -0,0 +1,27 @@ ++/* Copyright (C) 2012 Étienne Dupuis ++* ++* Use, modification and distribution is subject to the ++* Boost Software License, Version 1.0. (See accompanying ++* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) ++*/ ++ ++// Test of bug #6701 (https://svn.boost.org/trac/boost/ticket/6701) ++ ++#include ++#include ++ ++int main() ++{ ++ boost::pool<> p(1024, std::numeric_limits::max() / 768); ++ ++ void *x = p.malloc(); ++ BOOST_ASSERT(!x); ++ ++ BOOST_ASSERT(std::numeric_limits::max() / 1024 >= p.get_next_size()); ++ BOOST_ASSERT(std::numeric_limits::max() / 1024 >= p.get_max_size()); ++ ++ void *y = p.ordered_malloc(std::numeric_limits::max() / 768); ++ BOOST_ASSERT(!y); ++ ++ return 0; ++} diff --git a/disable-moutline-atomics-for-aarch64.patch b/disable-moutline-atomics-for-aarch64.patch new file mode 100644 index 0000000..c7a8eba --- /dev/null +++ b/disable-moutline-atomics-for-aarch64.patch @@ -0,0 +1,37 @@ +From 3603a7c5191c98e86e3b769c5877d17fd18bf39b Mon Sep 17 00:00:00 2001 +From: maminjie +Date: Fri, 26 Feb 2021 14:58:05 +0800 +Subject: [PATCH] disable moutline-atomics for aarch64 + +--- + CMakeLists.txt | 13 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index df69eb90..94557fc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -938,13 +938,13 @@ ENDIF() + # The -moutline-atomics switch enables run-time detection of LSE support. + # There are compilers (gcc 9.3.1 for example) which support this switch, but + # do not enable it by default, even though it seems to help. So, we force it. +-IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") +- MY_CHECK_CXX_COMPILER_FLAG( "-moutline-atomics" HAVE_OUTLINE_ATOMICS) +- IF(HAVE_OUTLINE_ATOMICS) +- STRING_APPEND(CMAKE_C_FLAGS " -moutline-atomics") +- STRING_APPEND(CMAKE_CXX_FLAGS " -moutline-atomics") +- ENDIF() +-ENDIF() ++#IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") ++# MY_CHECK_CXX_COMPILER_FLAG( "-moutline-atomics" HAVE_OUTLINE_ATOMICS) ++# IF(HAVE_OUTLINE_ATOMICS) ++# STRING_APPEND(CMAKE_C_FLAGS " -moutline-atomics") ++# STRING_APPEND(CMAKE_CXX_FLAGS " -moutline-atomics") ++# ENDIF() ++#ENDIF() + + IF(LINUX) + OPTION(LINK_RANDOMIZE "Randomize the order of all symbols in the binary" OFF) +-- +2.23.0 + diff --git a/my.cnf.in b/my.cnf.in new file mode 100644 index 0000000..2bb9e88 --- /dev/null +++ b/my.cnf.in @@ -0,0 +1,16 @@ +# +# This group is read both both by the client and the server +# use it for options that affect everything +# +[client-server] + +# +# This group is read by the server +# +[mysqld] + +# +# include all files from the config directory +# +!includedir @SYSCONF2DIR@ + diff --git a/mysql-Add-sw64-architecture.patch b/mysql-Add-sw64-architecture.patch new file mode 100644 index 0000000..02445fb --- /dev/null +++ b/mysql-Add-sw64-architecture.patch @@ -0,0 +1,1522 @@ +From ae8a1ba8f8bec3586eee2a599ddaed833233c6f8 Mon Sep 17 00:00:00 2001 +From: wxy +Date: Tue, 1 Nov 2022 19:56:44 +0800 +Subject: [PATCH] Add sw64 architecture + +Signed-off-by: wxy +--- + .../atomic/detail/caps_arch_gcc_sw_64.hpp | 35 + + .../atomic/detail/core_arch_ops_gcc_sw_64.hpp | 1030 +++++++++++++++++ + .../detail/fence_arch_ops_gcc_sw_64.hpp | 53 + + .../boost/atomic/detail/platform.hpp | 4 + + .../detail/sw_64_rounding_control.hpp | 113 ++ + .../boost/numeric/interval/hw_rounding.hpp | 2 + + .../boost_1_77_0/boost/predef/architecture.h | 1 + + .../boost/predef/architecture/sw_64.h | 54 + + boost/boost_1_77_0/boost/wave/wave_config.hpp | 2 +- + .../icu/icu-release-73-1/source/acinclude.m4 | 6 + + .../icu/icu-release-73-1/source/config.guess | 8 + + extra/icu/icu-release-73-1/source/config.sub | 2 + + extra/icu/icu-release-73-1/source/configure | 8 +- + .../icu/icu-release-73-1/source/configure.ac | 2 +- + .../source/i18n/double-conversion-utils.h | 2 +- + extra/rapidjson/include/rapidjson/rapidjson.h | 2 +- + 16 files changed, 1319 insertions(+), 5 deletions(-) + create mode 100644 boost/boost_1_77_0/boost/atomic/detail/caps_arch_gcc_sw_64.hpp + create mode 100644 boost/boost_1_77_0/boost/atomic/detail/core_arch_ops_gcc_sw_64.hpp + create mode 100644 boost/boost_1_77_0/boost/atomic/detail/fence_arch_ops_gcc_sw_64.hpp + create mode 100644 boost/boost_1_77_0/boost/numeric/interval/detail/sw_64_rounding_control.hpp + create mode 100644 boost/boost_1_77_0/boost/predef/architecture/sw_64.h + +diff --git a/boost/boost_1_77_0/boost/atomic/detail/caps_arch_gcc_sw_64.hpp b/boost/boost_1_77_0/boost/atomic/detail/caps_arch_gcc_sw_64.hpp +new file mode 100644 +index 00000000..42af68f5 +--- /dev/null ++++ b/boost/boost_1_77_0/boost/atomic/detail/caps_arch_gcc_sw_64.hpp +@@ -0,0 +1,35 @@ ++/* ++ + * Distributed under the Boost Software License, Version 1.0. ++ + * (See accompanying file LICENSE_1_0.txt or copy at ++ + * http://www.boost.org/LICENSE_1_0.txt) ++ + * ++ + * Copyright (c) 2009 Helge Bahmann ++ + * Copyright (c) 2013 Tim Blechmann ++ + * Copyright (c) 2014 Andrey Semashev ++ + */ ++/*! ++ + * \file atomic/detail/caps_arch_gcc_sw_64.hpp ++ + * ++ + * This header defines feature capabilities macros ++ + */ ++ ++#ifndef BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_SW_64_HPP_INCLUDED_ ++#define BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_SW_64_HPP_INCLUDED_ ++ ++#include ++ ++#ifdef BOOST_HAS_PRAGMA_ONCE ++#pragma once ++#endif ++ ++#define BOOST_ATOMIC_INT8_LOCK_FREE 2 ++#define BOOST_ATOMIC_INT16_LOCK_FREE 2 ++#define BOOST_ATOMIC_INT32_LOCK_FREE 2 ++#define BOOST_ATOMIC_INT64_LOCK_FREE 2 ++#define BOOST_ATOMIC_POINTER_LOCK_FREE 2 ++ ++#define BOOST_ATOMIC_THREAD_FENCE 2 ++#define BOOST_ATOMIC_SIGNAL_FENCE 2 ++ ++#endif // BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_SW_64_HPP_INCLUDED_ ++ +diff --git a/boost/boost_1_77_0/boost/atomic/detail/core_arch_ops_gcc_sw_64.hpp b/boost/boost_1_77_0/boost/atomic/detail/core_arch_ops_gcc_sw_64.hpp +new file mode 100644 +index 00000000..91e24ac2 +--- /dev/null ++++ b/boost/boost_1_77_0/boost/atomic/detail/core_arch_ops_gcc_sw_64.hpp +@@ -0,0 +1,1030 @@ ++/* ++ * Distributed under the Boost Software License, Version 1.0. ++ * (See accompanying file LICENSE_1_0.txt or copy at ++ * http://www.boost.org/LICENSE_1_0.txt) ++ * ++ * Copyright (c) 2009 Helge Bahmann ++ * Copyright (c) 2013 Tim Blechmann ++ * Copyright (c) 2014 Andrey Semashev ++ */ ++/*! ++ * \file atomic/detail/core_arch_ops_gcc_sw_64.hpp ++ * ++ * This header contains implementation of the \c core_arch_operations template. ++ */ ++ ++#ifndef BOOST_ATOMIC_DETAIL_CORE_ARCH_OPS_GCC_SW_64_HPP_INCLUDED_ ++#define BOOST_ATOMIC_DETAIL_CORE_ARCH_OPS_GCC_SW_64_HPP_INCLUDED_ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef BOOST_HAS_PRAGMA_ONCE ++#pragma once ++#endif ++ ++namespace boost { ++namespace atomics { ++namespace detail { ++ ++/* ++ Refer to http://h71000.www7.hp.com/doc/82final/5601/5601pro_004.html ++ (HP OpenVMS systems documentation) and the Sw_64 Architecture Reference Manual. ++ */ ++ ++/* ++ NB: The most natural thing would be to write the increment/decrement ++ operators along the following lines: ++ ++ __asm__ __volatile__ ++ ( ++ "1: ldl_l %0,%1 \n" ++ "addl %0,1,%0 \n" ++ "stl_c %0,%1 \n" ++ "beq %0,1b\n" ++ : "=&b" (tmp) ++ : "m" (value) ++ : "cc" ++ ); ++ ++ However according to the comments on the HP website and matching ++ comments in the Linux kernel sources this defies branch prediction, ++ as the cpu assumes that backward branches are always taken; so ++ instead copy the trick from the Linux kernel, introduce a forward ++ branch and back again. ++ ++ I have, however, had a hard time measuring the difference between ++ the two versions in microbenchmarks -- I am leaving it in nevertheless ++ as it apparently does not hurt either. ++*/ ++ ++struct core_arch_operations_gcc_sw_64_base ++{ ++ static BOOST_CONSTEXPR_OR_CONST bool full_cas_based = false; ++ static BOOST_CONSTEXPR_OR_CONST bool is_always_lock_free = true; ++ ++ static BOOST_FORCEINLINE void fence_before(memory_order order) BOOST_NOEXCEPT ++ { ++ if ((static_cast< unsigned int >(order) & static_cast< unsigned int >(memory_order_release)) != 0u) ++ __asm__ __volatile__ ("memb" ::: "memory"); ++ } ++ ++ static BOOST_FORCEINLINE void fence_after(memory_order order) BOOST_NOEXCEPT ++ { ++ if ((static_cast< unsigned int >(order) & (static_cast< unsigned int >(memory_order_consume) | static_cast< unsigned int >(memory_order_acquire))) != 0u) ++ __asm__ __volatile__ ("memb" ::: "memory"); ++ } ++ ++ static BOOST_FORCEINLINE void fence_after_store(memory_order order) BOOST_NOEXCEPT ++ { ++ if (order == memory_order_seq_cst) ++ __asm__ __volatile__ ("memb" ::: "memory"); ++ } ++}; ++ ++ ++template< bool Signed, bool Interprocess > ++struct core_arch_operations< 4u, Signed, Interprocess > : ++ public core_arch_operations_gcc_sw_64_base ++{ ++ typedef typename storage_traits< 4u >::type storage_type; ++ ++ static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 4u; ++ static BOOST_CONSTEXPR_OR_CONST std::size_t storage_alignment = 4u; ++ static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed; ++ static BOOST_CONSTEXPR_OR_CONST bool is_interprocess = Interprocess; ++ ++ static BOOST_FORCEINLINE void store(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ fence_before(order); ++ storage = v; ++ fence_after_store(order); ++ } ++ ++ static BOOST_FORCEINLINE storage_type load(storage_type const volatile& storage, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type v = storage; ++ fence_after(order); ++ return v; ++ } ++ ++ static BOOST_FORCEINLINE storage_type exchange(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, tmp; ++ storage_type tmp1, tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n\t" ++ "ldi %2,%4\n\t" ++ "ldi %3,1\n\t" ++ "mov %5, %1\n\t" ++ "lldw %0, 0(%2)\n\t" ++ "wr_f %3\n\t" ++ "lstw %1, 0(%2)\n\t" ++ "rd_f %1\n\t" ++ "beq %1, 2f\n\t" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (tmp), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE bool compare_exchange_weak( ++ storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT ++ { ++ fence_before(success_order); ++ int success; ++ storage_type current; ++ storage_type tmp1,tmp2; ++ __asm__ __volatile__ ++ ( ++ "1:\n\t" ++ "ldi %4,%6\n\t" ++ "lldw %2, 0(%4)\n\t" // current = *(&storage) ++ "cmpeq %2, %0, %5\n\t" // success = current == expected ++ "wr_f %5\n\t" // success = current == expected ++ "mov %2, %0\n\t" // expected = current ++ "lstw %1, 0(%4)\n\t" // storage = desired; desired = store succeeded ++ "rd_f %1\n\t" // storage = desired; desired = store succeeded ++ "beq %5, 2f\n\t" // if (success == 0) goto end ++ "mov %1, %3\n\t" // success = desired ++ "2:\n\t" ++ : "+r" (expected), // %0 ++ "+r" (desired), // %1 ++ "=&r" (current), // %2 ++ "=&r" (success), // %3 ++ "=&r" (tmp1), // %4 ++ "=&r" (tmp2) // %5 ++ : "m" (storage) // %6 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ if (success) ++ fence_after(success_order); ++ else ++ fence_after(failure_order); ++ return !!success; ++ } ++ ++ static BOOST_FORCEINLINE bool compare_exchange_strong( ++ storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT ++ { ++ int success; ++ storage_type current, tmp; ++ storage_type tmp1,tmp2; ++ fence_before(success_order); ++ __asm__ __volatile__ ++ ( ++ "1:\n\t" ++ "ldi %4,%6\n\t" ++ "mov %7, %1\n\t" // tmp = desired ++ "lldw %2, 0(%4)\n\t" // current = *(&storage) ++ "cmpeq %2, %0, %5\n\t" // success = current == expected ++ "wr_f %5\n\t" // success = current == expected ++ "mov %2, %0\n\t" // expected = current ++ "lstw %1, 0(%4)\n\t" // storage = tmp; tmp = store succeeded ++ "rd_f %1\n\t" // storage = tmp; tmp = store succeeded ++ "beq %5, 2f\n\t" // if (success == 0) goto end ++ "beq %1, 3f\n\t" // if (tmp == 0) goto retry ++ "mov %1, %3\n\t" // success = tmp ++ "2:\n\t" ++ ++ ".subsection 2\n\t" ++ "3: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "+r" (expected), // %0 ++ "=&r" (tmp), // %1 ++ "=&r" (current), // %2 ++ "=&r" (success), // %3 ++ "=&r" (tmp1), // %4 ++ "=&r" (tmp2) // %5 ++ : "m" (storage), // %6 ++ "r" (desired) // %7 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ if (success) ++ fence_after(success_order); ++ else ++ fence_after(failure_order); ++ return !!success; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1, tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n\t" ++ "ldi %2,%4\n\t" ++ "ldi %3,1\n\t" ++ "lldw %0, 0(%2)\n\t" ++ "wr_f %3\n\t" ++ "addw %0, %5, %1\n\t" ++ "lstw %1, 0(%2)\n\t" ++ "rd_f %1\n\t" ++ "beq %1, 2f\n\t" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1, tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n\t" ++ "ldi %2,%4\n\t" ++ "ldi %3,1\n\t" ++ "lldw %0, 0(%2)\n\t" ++ "wr_f %3\n\t" ++ "subw %0, %5, %1\n\t" ++ "lstw %1, 0(%2)\n\t" ++ "rd_f %1\n\t" ++ "beq %1, 2f\n\t" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n\t" ++ "ldi %2,%4\n\t" ++ "ldi %3,1\n\t" ++ "lldw %0, 0(%2)\n\t" ++ "wr_f %3\n\t" ++ "and %0, %5, %1\n\t" ++ "lstw %1, 0(%2)\n\t" ++ "rd_f %1\n\t" ++ "beq %1, 2f\n\t" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %? \n" ++ "bis %0, %5, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1, tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "xor %0, %5, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE bool test_and_set(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT ++ { ++ return !!exchange(storage, (storage_type)1, order); ++ } ++ ++ static BOOST_FORCEINLINE void clear(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT ++ { ++ store(storage, 0, order); ++ } ++}; ++ ++ ++template< bool Interprocess > ++struct core_arch_operations< 1u, false, Interprocess > : ++ public core_arch_operations< 4u, false, Interprocess > ++{ ++ typedef core_arch_operations< 4u, false, Interprocess > base_type; ++ typedef typename base_type::storage_type storage_type; ++ ++ static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1, tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "addw %0, %5, %1\n" ++ "zapnot %1, #1, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1, tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "subw %0, %5, %1\n" ++ "zapnot %1, #1, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++}; ++ ++template< bool Interprocess > ++struct core_arch_operations< 1u, true, Interprocess > : ++ public core_arch_operations< 4u, true, Interprocess > ++{ ++ typedef core_arch_operations< 4u, true, Interprocess > base_type; ++ typedef typename base_type::storage_type storage_type; ++ ++ static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "addw %0, %5, %1\n" ++ "sextb %1, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "subw %0, %5, %1\n" ++ "sextb %1, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++}; ++ ++ ++template< bool Interprocess > ++struct core_arch_operations< 2u, false, Interprocess > : ++ public core_arch_operations< 4u, false, Interprocess > ++{ ++ typedef core_arch_operations< 4u, false, Interprocess > base_type; ++ typedef typename base_type::storage_type storage_type; ++ ++ static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "addw %0, %5, %1\n" ++ "zapnot %1, #3, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "subw %0, %5, %1\n" ++ "zapnot %1, #3, %1\n" ++ "lstw %1, %2\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++}; ++ ++template< bool Interprocess > ++struct core_arch_operations< 2u, true, Interprocess > : ++ public core_arch_operations< 4u, true, Interprocess > ++{ ++ typedef core_arch_operations< 4u, true, Interprocess > base_type; ++ typedef typename base_type::storage_type storage_type; ++ ++ static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "addw %0, %5, %1\n" ++ "sexth %1, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ base_type::fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldw %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "subw %0, %5, %1\n" ++ "sexth %1, %1\n" ++ "lstw %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ base_type::fence_after(order); ++ return original; ++ } ++}; ++ ++ ++template< bool Signed, bool Interprocess > ++struct core_arch_operations< 8u, Signed, Interprocess > : ++ public core_arch_operations_gcc_sw_64_base ++{ ++ typedef typename storage_traits< 8u >::type storage_type; ++ ++ static BOOST_CONSTEXPR_OR_CONST std::size_t storage_size = 8u; ++ static BOOST_CONSTEXPR_OR_CONST std::size_t storage_alignment = 8u; ++ static BOOST_CONSTEXPR_OR_CONST bool is_signed = Signed; ++ static BOOST_CONSTEXPR_OR_CONST bool is_interprocess = Interprocess; ++ ++ static BOOST_FORCEINLINE void store(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ fence_before(order); ++ storage = v; ++ fence_after_store(order); ++ } ++ ++ static BOOST_FORCEINLINE storage_type load(storage_type const volatile& storage, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type v = storage; ++ fence_after(order); ++ return v; ++ } ++ ++ static BOOST_FORCEINLINE storage_type exchange(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, tmp; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "mov %5, %1\n" ++ "lldl %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "lstl %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (tmp), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE bool compare_exchange_weak( ++ storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT ++ { ++ fence_before(success_order); ++ int success; ++ storage_type current; ++ storage_type tmp1,tmp2; ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %4,%6\n" ++ "lldl %2, 0(%4)\n" // current = *(&storage) ++ "cmpeq %2, %0, %5\n" // success = current == expected ++ "wr_f %5 \n" ++ "mov %2, %0\n" // expected = current ++ "lstl %1, 0(%4)\n" // storage = desired; desired = store succeeded ++ "rd_f %1 \n" ++ "beq %5, 2f\n" // if (success == 0) goto end ++ "mov %1, %3\n" // success = desired ++ "2:\n\t" ++ : "+r" (expected), // %0 ++ "+r" (desired), // %1 ++ "=&r" (current), // %2 ++ "=&r" (success), // %3 ++ "=&r" (tmp1), // %4 ++ "=&r" (tmp2) // %5 ++ : "m" (storage) // %6 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ if (success) ++ fence_after(success_order); ++ else ++ fence_after(failure_order); ++ return !!success; ++ } ++ ++ static BOOST_FORCEINLINE bool compare_exchange_strong( ++ storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT ++ { ++ int success; ++ storage_type current, tmp; ++ storage_type tmp1,tmp2; ++ fence_before(success_order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %4,%6\n" ++ "mov %7, %1\n" // tmp = desired ++ "lldl %2, 0(%4)\n" // current = *(&storage) ++ "cmpeq %2, %0, %5\n" // success = current == expected ++ "wr_f %5 \n" ++ "mov %2, %0\n" // expected = current ++ "lstl %1, 0(%4)\n" // storage = tmp; tmp = store succeeded ++ "rd_f %1 \n" ++ "beq %5, 2f\n" // if (success == 0) goto end ++ "beq %1, 3f\n" // if (tmp == 0) goto retry ++ "mov %1, %3\n" // success = tmp ++ "2:\n\t" ++ ++ ".subsection 2\n\t" ++ "3: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "+r" (expected), // %0 ++ "=&r" (tmp), // %1 ++ "=&r" (current), // %2 ++ "=&r" (success), // %3 ++ "=&r" (tmp1), // %4 ++ "=&r" (tmp2) // %5 ++ : "m" (storage), // %6 ++ "r" (desired) // %7 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ if (success) ++ fence_after(success_order); ++ else ++ fence_after(failure_order); ++ return !!success; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1, tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldl %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "addl %0, %5, %1\n" ++ "lstl %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldl %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "subl %0, %5, %1\n" ++ "lstl %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldl %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "and %0, %5, %1\n" ++ "lstl %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldl %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "bis %0, %5, %1\n" ++ "lstl %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE storage_type fetch_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT ++ { ++ storage_type original, modified; ++ storage_type tmp1,tmp2; ++ fence_before(order); ++ __asm__ __volatile__ ++ ( ++ "1:\n" ++ "ldi %2,%4\n" ++ "ldi %3,1\n" ++ "lldl %0, 0(%2)\n" ++ "wr_f %3 \n" ++ "xor %0, %5, %1\n" ++ "lstl %1, 0(%2)\n" ++ "rd_f %1 \n" ++ "beq %1, 2f\n" ++ ++ ".subsection 2\n\t" ++ "2: br 1b\n\t" ++ ".previous\n\t" ++ ++ : "=&r" (original), // %0 ++ "=&r" (modified), // %1 ++ "=&r" (tmp1), // %2 ++ "=&r" (tmp2) // %3 ++ : "m" (storage), // %4 ++ "r" (v) // %5 ++ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC ++ ); ++ fence_after(order); ++ return original; ++ } ++ ++ static BOOST_FORCEINLINE bool test_and_set(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT ++ { ++ return !!exchange(storage, (storage_type)1, order); ++ } ++ ++ static BOOST_FORCEINLINE void clear(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT ++ { ++ store(storage, (storage_type)0, order); ++ } ++}; ++ ++} // namespace detail ++} // namespace atomics ++} // namespace boost ++ ++#include ++ ++#endif // BOOST_ATOMIC_DETAIL_CORE_ARCH_OPS_GCC_SW_64_HPP_INCLUDED_ +diff --git a/boost/boost_1_77_0/boost/atomic/detail/fence_arch_ops_gcc_sw_64.hpp b/boost/boost_1_77_0/boost/atomic/detail/fence_arch_ops_gcc_sw_64.hpp +new file mode 100644 +index 00000000..95d3b209 +--- /dev/null ++++ b/boost/boost_1_77_0/boost/atomic/detail/fence_arch_ops_gcc_sw_64.hpp +@@ -0,0 +1,53 @@ ++/* ++ * Distributed under the Boost Software License, Version 1.0. ++ * (See accompanying file LICENSE_1_0.txt or copy at ++ * http://www.boost.org/LICENSE_1_0.txt) ++ * ++ * Copyright (c) 2020 Andrey Semashev ++ */ ++/*! ++ * \file atomic/detail/fence_arch_ops_gcc_sw_64.hpp ++ * ++ * This header contains implementation of the \c fence_arch_operations struct. ++ */ ++ ++#ifndef BOOST_ATOMIC_DETAIL_FENCE_ARCH_OPS_GCC_SW_64_HPP_INCLUDED_ ++#define BOOST_ATOMIC_DETAIL_FENCE_ARCH_OPS_GCC_SW_64_HPP_INCLUDED_ ++ ++#include ++#include ++#include ++ ++#ifdef BOOST_HAS_PRAGMA_ONCE ++#pragma once ++#endif ++ ++namespace boost { ++namespace atomics { ++namespace detail { ++ ++//! Fence operations for Sw_64 ++struct fence_arch_operations_gcc_sw_64 ++{ ++ static BOOST_FORCEINLINE void thread_fence(memory_order order) BOOST_NOEXCEPT ++ { ++ if (order != memory_order_relaxed) ++ __asm__ __volatile__ ("memb" ::: "memory"); ++ } ++ ++ static BOOST_FORCEINLINE void signal_fence(memory_order order) BOOST_NOEXCEPT ++ { ++ if (order != memory_order_relaxed) ++ __asm__ __volatile__ ("" ::: "memory"); ++ } ++}; ++ ++typedef fence_arch_operations_gcc_sw_64 fence_arch_operations; ++ ++} // namespace detail ++} // namespace atomics ++} // namespace boost ++ ++#include ++ ++#endif // BOOST_ATOMIC_DETAIL_FENCE_ARCH_OPS_GCC_SW_64_HPP_INCLUDED_ +diff --git a/boost/boost_1_77_0/boost/atomic/detail/platform.hpp b/boost/boost_1_77_0/boost/atomic/detail/platform.hpp +index 36607283..03207737 100644 +--- a/boost/boost_1_77_0/boost/atomic/detail/platform.hpp ++++ b/boost/boost_1_77_0/boost/atomic/detail/platform.hpp +@@ -82,6 +82,10 @@ + + #define BOOST_ATOMIC_DETAIL_CORE_ARCH_BACKEND gcc_alpha + ++#elif defined(__GNUC__) && defined(__sw_64__) ++ ++#define BOOST_ATOMIC_DETAIL_CORE_ARCH_BACKEND gcc_sw_64 ++ + #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) + + #define BOOST_ATOMIC_DETAIL_CORE_ARCH_BACKEND msvc_x86 +diff --git a/boost/boost_1_77_0/boost/numeric/interval/detail/sw_64_rounding_control.hpp b/boost/boost_1_77_0/boost/numeric/interval/detail/sw_64_rounding_control.hpp +new file mode 100644 +index 00000000..01b41024 +--- /dev/null ++++ b/boost/boost_1_77_0/boost/numeric/interval/detail/sw_64_rounding_control.hpp +@@ -0,0 +1,113 @@ ++/* Boost interval/detail/sw_64_rounding_control.hpp file ++ * ++ * Copyright 2005 Felix Höfling, Guillaume Melquiond ++ * ++ * Distributed under the Boost Software License, Version 1.0. ++ * (See accompanying file LICENSE_1_0.txt or ++ * copy at http://www.boost.org/LICENSE_1_0.txt) ++ */ ++ ++#ifndef BOOST_NUMERIC_INTERVAL_DETAIL_SW_64_ROUNDING_CONTROL_HPP ++#define BOOST_NUMERIC_INTERVAL_DETAIL_SW_64_ROUNDING_CONTROL_HPP ++ ++#if !defined(sw_64) && !defined(__sw_64__) ++#error This header only works on Sw_64 CPUs. ++#endif ++ ++#if defined(__GNUC__) || defined(__digital__) || defined(__DECCXX) ++ ++#include // write_rnd() and read_rnd() ++ ++namespace boost { ++namespace numeric { ++namespace interval_lib { ++ ++namespace detail { ++#if defined(__GNUC__ ) ++ typedef union { ++ ::boost::long_long_type imode; ++ double dmode; ++ } rounding_mode_struct; ++ ++ // set bits 59-58 (DYN), ++ // clear all exception bits and disable overflow (51) and inexact exceptions (62) ++ static const rounding_mode_struct mode_upward = { 0x4C08000000000000LL }; ++ static const rounding_mode_struct mode_downward = { 0x4408000000000000LL }; ++ static const rounding_mode_struct mode_to_nearest = { 0x4808000000000000LL }; ++ static const rounding_mode_struct mode_toward_zero = { 0x4008000000000000LL }; ++ ++ struct sw_64_rounding_control ++ { ++ typedef double rounding_mode; ++ ++ static void set_rounding_mode(const rounding_mode mode) ++ { __asm__ __volatile__ ("wfpcr %0" : : "f"(mode)); } ++ ++ static void get_rounding_mode(rounding_mode& mode) ++ { __asm__ __volatile__ ("rfpcr %0" : "=f"(mode)); } ++ ++ static void downward() { set_rounding_mode(mode_downward.dmode); } ++ static void upward() { set_rounding_mode(mode_upward.dmode); } ++ static void to_nearest() { set_rounding_mode(mode_to_nearest.dmode); } ++ static void toward_zero() { set_rounding_mode(mode_toward_zero.dmode); } ++ }; ++#elif defined(__digital__) || defined(__DECCXX) ++ ++#if defined(__DECCXX) && !(defined(__FLT_ROUNDS) && __FLT_ROUNDS == -1) ++#error Dynamic rounding mode not enabled. See cxx man page for details. ++#endif ++ ++ struct sw_64_rounding_control ++ { ++ typedef unsigned int rounding_mode; ++ ++ static void set_rounding_mode(const rounding_mode& mode) { write_rnd(mode); } ++ static void get_rounding_mode(rounding_mode& mode) { mode = read_rnd(); } ++ ++ static void downward() { set_rounding_mode(FP_RND_RM); } ++ static void upward() { set_rounding_mode(FP_RND_RP); } ++ static void to_nearest() { set_rounding_mode(FP_RND_RN); } ++ static void toward_zero() { set_rounding_mode(FP_RND_RZ); } ++ }; ++#endif ++} // namespace detail ++ ++extern "C" { ++ float rintf(float); ++ double rint(double); ++ long double rintl(long double); ++} ++ ++template<> ++struct rounding_control: ++ detail::sw_64_rounding_control ++{ ++ static float force_rounding(const float r) ++ { volatile float _r = r; return _r; } ++ static float to_int(const float& x) { return rintf(x); } ++}; ++ ++template<> ++struct rounding_control: ++ detail::sw_64_rounding_control ++{ ++ static const double & force_rounding(const double& r) { return r; } ++ static double to_int(const double& r) { return rint(r); } ++}; ++ ++template<> ++struct rounding_control: ++ detail::sw_64_rounding_control ++{ ++ static const long double & force_rounding(const long double& r) { return r; } ++ static long double to_int(const long double& r) { return rintl(r); } ++}; ++ ++} // namespace interval_lib ++} // namespace numeric ++} // namespace boost ++ ++#undef BOOST_NUMERIC_INTERVAL_NO_HARDWARE ++#endif ++ ++#endif /* BOOST_NUMERIC_INTERVAL_DETAIL_SW_64_ROUNDING_CONTROL_HPP */ +diff --git a/boost/boost_1_77_0/boost/numeric/interval/hw_rounding.hpp b/boost/boost_1_77_0/boost/numeric/interval/hw_rounding.hpp +index 46d452ee..3e7bb554 100644 +--- a/boost/boost_1_77_0/boost/numeric/interval/hw_rounding.hpp ++++ b/boost/boost_1_77_0/boost/numeric/interval/hw_rounding.hpp +@@ -30,6 +30,8 @@ + # include + #elif defined(alpha) || defined(__alpha__) + # include ++#elif defined(sw_64) || defined(__sw_64__) ++# include + #elif defined(ia64) || defined(__ia64) || defined(__ia64__) + # include + #endif +diff --git a/boost/boost_1_77_0/boost/predef/architecture.h b/boost/boost_1_77_0/boost/predef/architecture.h +index f43f9464..471c263e 100644 +--- a/boost/boost_1_77_0/boost/predef/architecture.h ++++ b/boost/boost_1_77_0/boost/predef/architecture.h +@@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt) + #endif + + #include ++#include + #include + #include + #include +diff --git a/boost/boost_1_77_0/boost/predef/architecture/sw_64.h b/boost/boost_1_77_0/boost/predef/architecture/sw_64.h +new file mode 100644 +index 00000000..87e90daa +--- /dev/null ++++ b/boost/boost_1_77_0/boost/predef/architecture/sw_64.h +@@ -0,0 +1,54 @@ ++/* ++Copyright Rene Rivera 2008-2015 ++Distributed under the Boost Software License, Version 1.0. ++(See accompanying file LICENSE_1_0.txt or copy at ++http://www.boost.org/LICENSE_1_0.txt) ++*/ ++ ++#ifndef BOOST_PREDEF_ARCHITECTURE_SW_64_H ++#define BOOST_PREDEF_ARCHITECTURE_SW_64_H ++ ++#include ++#include ++ ++/* tag::reference[] ++= `BOOST_ARCH_SW_64` ++ ++http://en.wikipedia.org/wiki/DEC_Sw_64[DEC Sw_64] architecture. ++ ++[options="header"] ++|=== ++| {predef_symbol} | {predef_version} ++| `+__sw_64__+` | {predef_detection} ++| `+__sw_64+` | {predef_detection} ++| `+_M_SW_64+` | {predef_detection} ++ ++| `+__sw_64_ev6__+` | 6.0.0 ++|=== ++*/ // end::reference[] ++ ++#define BOOST_ARCH_SW_64 BOOST_VERSION_NUMBER_NOT_AVAILABLE ++ ++#if defined(__sw_64__) || defined(__sw_64) || \ ++ defined(_M_SW_64) ++# undef BOOST_ARCH_SW_64 ++# if !defined(BOOST_ARCH_SW_64) && defined(__sw_64_sw6b__) ++# define BOOST_ARCH_SW_64 BOOST_VERSION_NUMBER(6,0,0) ++# endif ++#endif ++ ++#if BOOST_ARCH_SW_64 ++# define BOOST_ARCH_SW_64_AVAILABLE ++#endif ++ ++#if BOOST_ARCH_SW_64 ++# undef BOOST_ARCH_WORD_BITS_64 ++# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE ++#endif ++ ++#define BOOST_ARCH_SW_64_NAME "DEC Sw_64" ++ ++#endif ++ ++#include ++BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_SW_64,BOOST_ARCH_SW_64_NAME) +diff --git a/boost/boost_1_77_0/boost/wave/wave_config.hpp b/boost/boost_1_77_0/boost/wave/wave_config.hpp +index dce42d43..abd3d977 100644 +--- a/boost/boost_1_77_0/boost/wave/wave_config.hpp ++++ b/boost/boost_1_77_0/boost/wave/wave_config.hpp +@@ -253,7 +253,7 @@ + // CW up to 8.3 chokes as well *sigh* + // Tru64/CXX has linker problems when using flex_string + #if BOOST_WORKAROUND(__MWERKS__, < 0x3200) || \ +- (defined(__DECCXX) && defined(__alpha)) || \ ++ (defined(__DECCXX) && (defined(__alpha) || defined(__sw_64))) || \ + defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) + + #define BOOST_WAVE_STRINGTYPE std::string +diff --git a/extra/icu/icu-release-73-1/source/acinclude.m4 b/extra/icu/icu-release-73-1/source/acinclude.m4 +index 507f41f5..344471c0 100644 +--- a/extra/icu/icu-release-73-1/source/acinclude.m4 ++++ b/extra/icu/icu-release-73-1/source/acinclude.m4 +@@ -21,6 +21,12 @@ case "${host}" in + else + icu_cv_host_frag=mh-solaris + fi ;; ++sw_64*-*-linux-gnu) ++ if test "$GCC" = yes; then ++ icu_cv_host_frag=mh-sw_64-linux-gcc ++ else ++ icu_cv_host_frag=mh-sw_64-linux-cc ++ fi ;; + alpha*-*-linux-gnu) + if test "$GCC" = yes; then + icu_cv_host_frag=mh-alpha-linux-gcc +diff --git a/extra/icu/icu-release-73-1/source/config.guess b/extra/icu/icu-release-73-1/source/config.guess +index 31e01efe..3eb10f96 100644 +--- a/extra/icu/icu-release-73-1/source/config.guess ++++ b/extra/icu/icu-release-73-1/source/config.guess +@@ -894,6 +894,14 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ sw_64:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ sw) UNAME_MACHINE=sw_64 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi ++ echo ${UNAME_MACHINE}-sunway-linux-${LIBC} ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/extra/icu/icu-release-73-1/source/config.sub b/extra/icu/icu-release-73-1/source/config.sub +index fb579478..ad7fd2a7 100644 +--- a/extra/icu/icu-release-73-1/source/config.sub ++++ b/extra/icu/icu-release-73-1/source/config.sub +@@ -245,6 +245,7 @@ case $basic_machine in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ ++ | sw_64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +@@ -369,6 +370,7 @@ case $basic_machine in + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ ++ | sw_64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ +diff --git a/extra/icu/icu-release-73-1/source/configure b/extra/icu/icu-release-73-1/source/configure +index a2ff7e48..a1902502 100755 +--- a/extra/icu/icu-release-73-1/source/configure ++++ b/extra/icu/icu-release-73-1/source/configure +@@ -5249,6 +5249,12 @@ case "${host}" in + else + icu_cv_host_frag=mh-solaris + fi ;; ++sw_64*-*-linux-gnu) ++ if test "$GCC" = yes; then ++ icu_cv_host_frag=mh-sw_64-linux-gcc ++ else ++ icu_cv_host_frag=mh-sw_64-linux-cc ++ fi ;; + alpha*-*-linux-gnu) + if test "$GCC" = yes; then + icu_cv_host_frag=mh-alpha-linux-gcc +@@ -6511,7 +6517,7 @@ if test "$CC" = ccc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"C compiler set to CCC ${CC}\" " >&5 + $as_echo "\"C compiler set to CCC ${CC}\" " >&6; } + case "${host}" in +- alpha*-*-*) U_HAVE_INTTYPES_H=0; ++ alpha*-*-* | sw_64*-*-*) U_HAVE_INTTYPES_H=0; + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0" + esac + fi +diff --git a/extra/icu/icu-release-73-1/source/configure.ac b/extra/icu/icu-release-73-1/source/configure.ac +index 425fdc7b..73e26739 100644 +--- a/extra/icu/icu-release-73-1/source/configure.ac ++++ b/extra/icu/icu-release-73-1/source/configure.ac +@@ -685,7 +685,7 @@ fi + if test "$CC" = ccc; then + AC_MSG_RESULT("C compiler set to CCC ${CC}" ) + case "${host}" in +- alpha*-*-*) U_HAVE_INTTYPES_H=0; ++ alpha*-*-*|sw_64*-*-*) U_HAVE_INTTYPES_H=0; + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0" + esac + fi +diff --git a/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h b/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h +index c9374636..7dcdbf8e 100644 +--- a/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h ++++ b/extra/icu/icu-release-73-1/source/i18n/double-conversion-utils.h +@@ -122,7 +122,7 @@ int main(int argc, char** argv) { + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ +- defined(__SH4__) || defined(__alpha__) || \ ++ defined(__SH4__) || defined(__alpha__) || defined(__sw_64__) || \ + defined(_MIPS_ARCH_MIPS32R2) || defined(__ARMEB__) ||\ + defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \ + defined(__riscv) || defined(__e2k__) || \ +diff --git a/extra/rapidjson/include/rapidjson/rapidjson.h b/extra/rapidjson/include/rapidjson/rapidjson.h +index 329ce92b..50ce8e68 100644 +--- a/extra/rapidjson/include/rapidjson/rapidjson.h ++++ b/extra/rapidjson/include/rapidjson/rapidjson.h +@@ -239,7 +239,7 @@ + // Detect with architecture macros + # elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) + # define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +-# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) ++# elif defined(__i386__) || defined(__alpha__) || defined(__sw_64__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) + # define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN + # elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) + # define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +-- +2.33.0 + diff --git a/mysql-arm32-timer.patch b/mysql-arm32-timer.patch new file mode 100644 index 0000000..bafa0bb --- /dev/null +++ b/mysql-arm32-timer.patch @@ -0,0 +1,16 @@ +diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql +index 78b09285..b7153445 100644 +--- a/mysql-test/include/mtr_warnings.sql ++++ b/mysql-test/include/mtr_warnings.sql +@@ -376,6 +376,11 @@ INSERT INTO global_suppressions VALUES + + ("'mysql_native_password' is deprecated and will be removed in a future release."), + ++ /* ++ ARM32 don't support timers and get this warning in every test. ++ */ ++ ("The CYCLE timer is not available. WAIT events in the performance_schema will not be timed."), ++ + ("THE_LAST_SUPPRESSION"); + + diff --git a/mysql-boost-8.0.42.tar.gz b/mysql-boost-8.0.42.tar.gz new file mode 100644 index 0000000..24a5bba Binary files /dev/null and b/mysql-boost-8.0.42.tar.gz differ diff --git a/mysql-boost-8.0.42.tar.gz.asc b/mysql-boost-8.0.42.tar.gz.asc new file mode 100644 index 0000000..74d46b7 --- /dev/null +++ b/mysql-boost-8.0.42.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEvKQ0F8O0hd0SjsbUt7O3iKjTeFwFAmfsxhAACgkQt7O3iKjT +eFyExw//etTPv3bxpiwiNxAihTVQ8j+rc9KCzmbhm251DOTGjbwjDitEqve35nJK +pxaWaTHQnn5kbqPz8px/BzYd0JldluPYMGSqMDsLylxGf3R5e+x+rtKQtiuBuKoe +QVBrfFjJXEwkv9LuZvZoZDMf7pgdumcBencKl7mBrQzIRGxR2aFqfJCoy6Q0iHBU +Cr5Wr+w3uidlOWAEAEDFRRTZyB07IqRvoRIjabEBTToXmux/QzMG+diVpzYlwV2s +sXD4begczJSK2G+3oFvpNt4ybuukQJqGIu85KU1P55OxzcK6kZCk/++sTTGxyjEH +GMAO+k8CiZyDMRIMXbnoKylCdwjqkXbg7vHo4JAaeqnOig6Gxkot/WoEPHWGi/Dm +u74LDCLOv3QXz/wI0YdaVVYb5JFlsDtKN0fmEj7G+1dfkvGkBr7yvMP/KQmv4sbv +QVnQiOyvvqKUWUFtfYbkSac0NSxiD6X81WOT1hEY9DhVqeqtQY9ZIwrB+7MNZefM +pkmorsDHJfGOsfna/bXIfHIbmLCoGPUVUReT/aNYglOs7RzoCstI+2dgPvRTPeOB +28rx/gOm9d9TEWvMIw0Usj0a7ShqsiMw8GN41Ybcec11P8HnyjlHcOE8MxKBY4lR +mPoGFadUEDERkwuoVAFxgYB5dElfQm+GvaTCa5tuEApDv68J+bA= +=x3/7 +-----END PGP SIGNATURE----- diff --git a/mysql-check-socket.sh b/mysql-check-socket.sh new file mode 100644 index 0000000..b15cd32 --- /dev/null +++ b/mysql-check-socket.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# We check if there is already a process using the socket file, +# since otherwise the systemd service file could report false +# positive result when starting and mysqld_safe could remove +# a socket file, which is actually being used by a different daemon. + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +if test -e "$socketfile" ; then + echo "Socket file $socketfile exists." >&2 + + # no write permissions + if ! test -w "$socketfile" ; then + echo "Not enough permission to write to the socket file $socketfile, which is suspicious." >&2 + echo "Please, remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # not a socket file + if ! test -S "$socketfile" ; then + echo "The file $socketfile is not a socket file, which is suspicious." >&2 + echo "Please, remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # some process uses the socket file + if fuser "$socketfile" &>/dev/null ; then + socketpid=$(fuser "$socketfile" 2>/dev/null) + echo "Is another MySQL daemon already running with the same unix socket?" >&2 + echo "Please, stop the process $socketpid or remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # socket file is a garbage + echo "No process is using $socketfile, which means it is a garbage, so it will be removed automatically." >&2 +fi + +exit 0 diff --git a/mysql-file-contents.patch b/mysql-file-contents.patch new file mode 100644 index 0000000..0f1cdba --- /dev/null +++ b/mysql-file-contents.patch @@ -0,0 +1,45 @@ +Upstream chooses to install INFO_SRC and INFO_BIN into the docs dir, which +breaks at least two packaging commandments, so we put them into $libdir +instead. That means we have to hack the file_contents regression test +to know about this. + +Recommendation they change is at http://bugs.mysql.com/bug.php?id=61425 + +diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test +index 75f8c93..973291c 100644 +--- a/mysql-test/t/file_contents.test ++++ b/mysql-test/t/file_contents.test +@@ -12,7 +12,7 @@ + --perl + print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; + $dir_bin = $ENV{'MYSQL_BINDIR'}; +-if ($dir_bin =~ m|^/usr/|) { ++if ($dir_bin =~ m|.*/usr/$|) { + # RPM package + $dir_docs = $dir_bin; + $dir_docs =~ s|/lib|/share/doc|; +@@ -35,7 +35,7 @@ if ($dir_bin =~ m|^/usr/|) { + } + } + } +-} elsif ($dir_bin =~ m|/usr$|) { ++} elsif ($dir_bin =~ m|.*/usr$|) { + # RPM build during development + $dir_docs = "$dir_bin/share/doc"; + if(-d "$dir_docs/packages") { +@@ -55,6 +55,15 @@ if ($dir_bin =~ m|^/usr/|) { + $dir_docs = glob "$dir_bin/share/mysql-*/docs"; + } + } ++ ++ # All the above is entirely wacko, because these files are not docs; ++ # they should be kept in libdir instead. mtr does not provide a nice ++ # way to find libdir though, so we have to kluge it like this: ++ if (-d "$dir_bin/lib64/mysql") { ++ $dir_docs = "$dir_bin/lib64/mysql"; ++ } else { ++ $dir_docs = "$dir_bin/lib/mysql"; ++ } + } + } else { + # tar.gz package, Windows, or developer work (in git) diff --git a/mysql-install-test.patch b/mysql-install-test.patch new file mode 100644 index 0000000..1f67132 --- /dev/null +++ b/mysql-install-test.patch @@ -0,0 +1,52 @@ +Improve the documentation that will be installed in the mysql-test RPM. + + +diff -Naur mysql-5.5.20.orig/mysql-test/README mysql-5.5.20/mysql-test/README +--- mysql-5.5.20.orig/mysql-test/README 2011-12-16 14:52:05.000000000 -0500 ++++ mysql-5.5.20/mysql-test/README 2012-02-10 17:06:19.531082253 -0500 +@@ -1,14 +1,26 @@ + This directory contains a test suite for the MySQL daemon. To run +-the currently existing test cases, simply execute ./mysql-test-run in +-this directory. It will fire up the newly built mysqld and test it. ++the currently existing test cases, execute ./mysql-test-run in ++this directory. + +-Note that you do not have to have to do "make install", and you could +-actually have a co-existing MySQL installation. The tests will not +-conflict with it. +- +-All tests must pass. If one or more of them fail on your system, please +-read the following manual section for instructions on how to report the +-problem: ++For use in Red Hat distributions, you should run the script as user mysql, ++so the best bet is something like ++ cd /usr/share/mysql-test ++ sudo -u mysql ./mysql-test-run --skip-test-list=platform-specific-tests.list ++This will use the installed mysql executables, but will run a private copy ++of the server process (using data files within /usr/share/mysql-test), ++so you need not start the mysqld service beforehand. ++ ++The "--skip-test-list=platform-specific-tests.list" option excludes tests that are ++known to fail on one or more Red-Hat-supported platforms. You can omit it ++if you want to check whether such failures occur for you. Documentation ++about the reasons for omitting such tests can be found in the file ++platform-specific-tests.list. ++ ++To clean up afterwards, remove the created "var" subdirectory, eg ++ sudo -u mysql rm -rf /usr/share/mysql-test/var ++ ++If one or more tests fail on your system, please read the following manual ++section for instructions on how to report the problem: + + http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html + +@@ -25,7 +37,8 @@ + + With no test cases named on the command line, mysql-test-run falls back + to the normal "non-extern" behavior. The reason for this is that some +-tests cannot run with an external server. ++tests cannot run with an external server (because they need to control the ++options with which the server is started). + + + You can create your own test cases. To create a test case, create a new diff --git a/mysql-paths.patch b/mysql-paths.patch new file mode 100644 index 0000000..d5978b6 --- /dev/null +++ b/mysql-paths.patch @@ -0,0 +1,77 @@ +Some hard-coded paths make problems when package is built into chroot like +Software Collections. Removing these hard-coded paths should fix it. + +Upstream report: https://mariadb.atlassian.net/browse/MDEV-6485 + +diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake +index 9f7945d8..6734cdfd 100644 +--- a/cmake/install_layout.cmake ++++ b/cmake/install_layout.cmake +@@ -105,7 +105,7 @@ IF(UNIX) + " Choose between ${VALID_INSTALL_LAYOUTS}" ) + ENDIF() + +- SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" ++ SET(SYSCONFDIR "/etc" + CACHE PATH "config directory (for my.cnf)") + MARK_AS_ADVANCED(SYSCONFDIR) + ENDIF() +@@ -189,6 +189,7 @@ SET(INSTALL_SECURE_FILE_PRIVDIR_TARGZ ${secure_file_priv_path}) + # + SET(INSTALL_BINDIR_RPM "bin") + SET(INSTALL_SBINDIR_RPM "sbin") ++SET(INSTALL_SYSCONFDIR_RPM "/etc") + # + IF(CMAKE_SYSTEM_PROCESSOR IN_LIST KNOWN_64BIT_ARCHITECTURES) + SET(INSTALL_LIBDIR_RPM "lib64/mysql") +diff --git a/mysys/my_default.cc b/mysys/my_default.cc +index 290f1666..8403425f 100644 +--- a/mysys/my_default.cc ++++ b/mysys/my_default.cc +@@ -1570,12 +1570,12 @@ static const char **init_default_directories(MEM_ROOT *alloc) { + + #else + +- errors += add_directory(alloc, "/etc/", dirs); +- errors += add_directory(alloc, "/etc/mysql/", dirs); +- + #if defined(DEFAULT_SYSCONFDIR) + if (DEFAULT_SYSCONFDIR[0]) ++ { + errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); ++ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs); ++ } + #endif /* DEFAULT_SYSCONFDIR */ + + #endif +diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt +index 4149a764..b091d5e2 100644 +--- a/scripts/CMakeLists.txt ++++ b/scripts/CMakeLists.txt +@@ -288,9 +288,9 @@ IF(UNIX) + ENDIF(UNIX) + + SET(prefix "${CMAKE_INSTALL_PREFIX}") +-SET(sysconfdir ${prefix}) ++SET(sysconfdir ${SYSCONFDIR}) + SET(bindir ${prefix}/${INSTALL_BINDIR}) +-SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) ++SET(libexecdir ${prefix}/${INSTALL_LIBEXECDIR}) + SET(datadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) + SET(libsubdir ${INSTALL_LIBDIR}) + SET(pkgincludedir ${prefix}/${INSTALL_INCLUDEDIR}) +diff --git a/scripts/mysqld_multi.pl.in b/scripts/mysqld_multi.pl.in +index 84dd4d7c..50397ddd 100644 +--- a/scripts/mysqld_multi.pl.in ++++ b/scripts/mysqld_multi.pl.in +@@ -586,9 +586,7 @@ sub list_defaults_files + + my %seen; # Don't list the same file more than once + return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ } +- ('/etc/my.cnf', +- '/etc/mysql/my.cnf', +- '@sysconfdir@/my.cnf', ++ ('@sysconfdir@/my.cnf', + ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef), + $opt{'extra-file'}, + ($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef)); diff --git a/mysql-prepare-db-dir.sh b/mysql-prepare-db-dir.sh new file mode 100644 index 0000000..46cf636 --- /dev/null +++ b/mysql-prepare-db-dir.sh @@ -0,0 +1,112 @@ +#!/bin/sh + +# This script creates the mysql data directory during first service start. +# In subsequent starts, it does nothing much. +# +# This script is meant to be run as non-root user either during initscript +# or systemd service execution, before starting the mysqld daemon. +# Running it as root may have some security risks, because it touches files +# that can be symlinks pointing to unexpected locations. +# +# On the other hand, when using non-standard locations for datadir and logfile, +# this script might not be able to create the files and the daemon won't start +# properly. A solution for that is to created the locations for datadir and +# logfile with correct ownership before starting the daemon. + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +# If two args given first is user, second is group +# otherwise the arg is the systemd service file +if [ "$#" -eq 2 ] +then + myuser="$1" + mygroup="$2" +else + # Absorb configuration settings from the specified systemd service file, + # or the default service if not specified + SERVICE_NAME="$1" + if [ x"$SERVICE_NAME" = x ] + then + SERVICE_NAME=@DAEMON_NAME@.service + fi + + myuser=`systemctl show -p User "${SERVICE_NAME}" | + sed 's/^User=//'` + if [ x"$myuser" = x ] + then + myuser=mysql + fi + + mygroup=`systemctl show -p Group "${SERVICE_NAME}" | + sed 's/^Group=//'` + if [ x"$mygroup" = x ] + then + mygroup=mysql + fi +fi + +# Set up the errlogfile with appropriate permissions +if [ ! -e "$errlogfile" -a ! -h "$errlogfile" -a x$(dirname "$errlogfile") = "x/var/log" ]; then + case $(basename "$errlogfile") in + mysql*.log|mariadb*.log) install /dev/null -m0640 -o$myuser -g$mygroup "$errlogfile" ;; + *) ;; + esac +else + # Provide some advice if the log file cannot be created by this script + errlogdir=$(dirname "$errlogfile") + if ! [ -d "$errlogdir" ] ; then + echo "The directory $errlogdir does not exist." + exit 1 + elif [ -e "$errlogfile" -a ! -w "$errlogfile" ] ; then + echo "The log file $errlogfile cannot be written, please, fix its permissions." + echo "The daemon will be run under $myuser:$mygroup" + exit 1 + fi +fi + + + +export LC_ALL=C + +# Returns content of the specified directory +# If listing files fails, fake-file is returned so which means +# we'll behave like there was some data initialized +# Some files or directories are fine to be there, so those are +# explicitly removed from the listing +# @param datadir +list_datadir () +{ + ( ls -1A "$1" 2>/dev/null || echo "fake-file" ) | grep -v \ + -e '^lost+found$' \ + -e '\.err$' \ + -e '^\.bash_history$' +} + +# Checks whether datadir should be initialized +# @param datadir +should_initialize () +{ + test -z "$(list_datadir "$1")" +} + +# Make the data directory if doesn't exist or empty +if should_initialize "$datadir" ; then + + # Now create the database + echo "Initializing @NICE_PROJECT_NAME@ database" + @libexecdir@/mysqld --initialize-insecure --datadir="$datadir" --user="$myuser" + ret=$? + if [ $ret -ne 0 ] ; then + echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 + echo "Perhaps @sysconfdir@/my.cnf is misconfigured." >&2 + # Clean up any partially-created database files + if [ ! -e "$datadir/mysql/user.frm" ] ; then + rm -rf "$datadir"/* + fi + exit $ret + fi + # upgrade does not need to be run on a fresh datadir + echo "@VERSION@" >"$datadir/mysql_upgrade_info" +fi + +exit 0 diff --git a/mysql-rpath.patch b/mysql-rpath.patch new file mode 100644 index 0000000..16d5bc4 --- /dev/null +++ b/mysql-rpath.patch @@ -0,0 +1,19 @@ +MySQL 8.0 includes a feature that requires we set linux NICE capabilities to +mysqld daemon. Because of that, LD_LIBRARY_PATH does not work (see +secure-execution mode in http://man7.org/linux/man-pages/man8/ld.so.8.html). + +Related: #1628814 + +diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt +index 3f179a7a..209b3eb2 100644 +--- a/sql/CMakeLists.txt ++++ b/sql/CMakeLists.txt +@@ -918,6 +918,8 @@ IF(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR) + ADD_INSTALL_RPATH_FOR_PROTOBUF(mysqld) + ENDIF() + ++SET_TARGET_PROPERTIES(mysqld PROPERTIES INSTALL_RPATH "${RPATH_LIBDIR}") ++ + OPTION(DEBUG_EXTNAME "Build server as mysqld-debug (debug builds only)" OFF) + MARK_AS_ADVANCED(DEBUG_EXTNAME) + diff --git a/mysql-scripts-common.sh b/mysql-scripts-common.sh new file mode 100644 index 0000000..58f0437 --- /dev/null +++ b/mysql-scripts-common.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# Some useful functions used in other MySQL helper scripts +# This scripts defines variables datadir, errlogfile, socketfile + +export LC_ALL=C + +# extract value of a MySQL option from config files +# Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ] +# result is returned in $result +# We use my_print_defaults which prints all options from multiple files, +# with the more specific ones later; hence take the last match. +get_mysql_option(){ + if [ $# -ne 3 ] ; then + echo "get_mysql_option requires 3 arguments: section option default_value" + return + fi + sections="$1" + option_name="$2" + default_value="$3" + result=`@bindir@/my_print_defaults $my_print_defaults_extra_args $sections | sed -n "s/^--${option_name}=//p" | tail -n 1` + if [ -z "$result" ]; then + # not found, use default + result="${default_value}" + fi +} + +# For the case of running more instances via systemd, scrits that source +# this file can get --default-group-suffix or similar option as the first +# argument. The utility my_print_defaults needs to use it as well, so the +# scripts sourcing this file work with the same options as the daemon. +my_print_defaults_extra_args='' +while echo "$1" | grep -q '^--defaults' ; do + my_print_defaults_extra_args="${my_print_defaults_extra_args} $1" + shift +done + +# Defaults here had better match what mysqld_safe will default to +# The option values are generally defined on three important places +# on the default installation: +# 1) default values are hardcoded in the code of mysqld daemon or +# mysqld_safe script +# 2) configurable values are defined in @sysconfdir@/my.cnf +# 3) default values for helper scripts are specified bellow +# So, in case values are defined in my.cnf, we need to get that value. +# In case they are not defined in my.cnf, we need to get the same value +# in the daemon, as in the helper scripts. Thus, default values here +# must correspond with values defined in mysqld_safe script and source +# code itself. + +server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ client-server" + +get_mysql_option "$server_sections" datadir "@MYSQL_DATADIR@" +datadir="$result" + +# if there is log_error in the my.cnf, my_print_defaults still +# returns log-error +# log-error might be defined in mysqld_safe and mysqld sections, +# the former has bigger priority +get_mysql_option "$server_sections" log-error "$datadir/`hostname`.err" +errlogfile="$result" + +get_mysql_option "$server_sections" socket "@MYSQL_UNIX_ADDR@" +socketfile="$result" + +get_mysql_option "$server_sections" pid-file "$datadir/`hostname`.pid" +pidfile="$result" + diff --git a/mysql-scripts.patch b/mysql-scripts.patch new file mode 100644 index 0000000..322577b --- /dev/null +++ b/mysql-scripts.patch @@ -0,0 +1,33 @@ +--- mysql-8.0.22/scripts/CMakeLists.txt.old 2020-10-21 11:08:50.654252563 +0200 ++++ mysql-8.0.22/scripts/CMakeLists.txt 2020-10-21 11:11:33.635935366 +0200 +@@ -507,4 +507,30 @@ + ) + ENDIF() + ENDIF() ++ ++ # files for systemd ++ SET(SYSTEMD_SCRIPTS ++ mysql.tmpfiles.d ++ mysql.service ++ mysql@.service ++ mysql-prepare-db-dir ++ mysql-wait-stop ++ mysql-check-socket ++ mysql-scripts-common ++ mysql_config_multilib ++ my.cnf ++ server.cnf ++ ) ++ FOREACH(file ${SYSTEMD_SCRIPTS}) ++ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) ++ ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) ++ ELSE() ++ MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file}.in in " ++ "${CMAKE_CURRENT_SOURCE_DIR}" ) ++ ENDIF() ++ ENDFOREACH() + ENDIF() diff --git a/mysql-sharedir.patch b/mysql-sharedir.patch new file mode 100644 index 0000000..fa0dc72 --- /dev/null +++ b/mysql-sharedir.patch @@ -0,0 +1,27 @@ +diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt +index f77bd022..a3a3bd9f 100644 +--- a/mysql-test/CMakeLists.txt ++++ b/mysql-test/CMakeLists.txt +@@ -57,6 +57,9 @@ IF(INSTALL_MYSQLTESTDIR) + ENDIF() + + ++# Expand some paths in the perl script correctly ++CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql-test-run.pl ${CMAKE_CURRENT_SOURCE_DIR}/mysql-test-run.pl @ONLY) ++ + IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + # Enable running mtr from build directory + FIND_PROGRAM(PERL_EXECUTABLE perl +diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl +index b82611fd..7fc5987e 100755 +--- a/mysql-test/mysql-test-run.pl ++++ b/mysql-test/mysql-test-run.pl +@@ -1656,7 +1656,7 @@ sub command_line_setup { + my $path_share = $path_language; + + @share_locations = +- ("share/mysql-" . $mysql_base_version, "share/mysql", "share"); ++ ("@INSTALL_MYSQLSHAREDIR@", "share/mysql-" . $mysql_base_version, "share/mysql", "share"); + + $path_charsetsdir = my_find_dir($basedir, \@share_locations, "charsets"); + diff --git a/mysql-wait-stop.sh b/mysql-wait-stop.sh new file mode 100644 index 0000000..62bde30 --- /dev/null +++ b/mysql-wait-stop.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +# This script waits for mysqld to be properly stopped +# (which can be many seconds in some large load). +# Running this as ExecStopPost is useful so that starting which is done +# as part of restart doesn't see the former process still running. + +# Wait for the server to properly end the main server +ret=0 +TIMEOUT=60 +SECONDS=0 + +if ! [ -f "$pidfile" ]; then + exit 0 +fi + +MYSQLPID=`cat "$pidfile" 2>/dev/null` +if [ -z "$MYSQLPID" ] ; then + exit 2 +fi + +while /bin/true; do + # Check process still exists + if ! [ -d "/proc/${MYSQLPID}" ] ; then + break + fi + if [ $SECONDS -gt $TIMEOUT ] ; then + ret=3 + break + fi + sleep 1 +done + +exit $ret diff --git a/mysql.rpmlintrc b/mysql.rpmlintrc new file mode 100644 index 0000000..605529e --- /dev/null +++ b/mysql.rpmlintrc @@ -0,0 +1,37 @@ +# THIS FILE SERVES FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON +# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors + +# (same file in python3 package served as a great example) + + + +# Spelling errors +addFilter(r'spelling-error .* en_US (cnf|mysqld|subpackage) ') + +# Debug symlinks +addFilter(r'dangling-relative-symlink /usr/lib/.build-id') + +# Testsuite +# Some expected tests results are zero-length files +addFilter(r'(zero-length|pem-certificate|hidden-file-or-dir) /usr/share/mysql-test/*') + +# Chroot function +# False positive; checked by upstream +addFilter(r'missing-call-to-chdir-with-chroot') + +# Missing documentation +# I don't think that's on the upstream priority list +addFilter(r'no-documentation') +addFilter(r'no-manual-page-for-binary') + +# Cluster is gone +addFilter("W: obsolete-not-provided mysql-cluster") +addFilter("W: obsolete-not-provided mysql-bench") +addFilter("W: obsolete-not-provided community-mysql-bench") + +# Config file without noreplace flag +# Don't replace logs that may contain old entries +addFilter(r'conffile-without-noreplace-flag /var/log/mariadb/mariadb.log') + +# Seems pretty standard to me ... +addFilter(r'non-standard-dir-perm /var/log/mysql 750') diff --git a/mysql.service.in b/mysql.service.in new file mode 100644 index 0000000..0e96374 --- /dev/null +++ b/mysql.service.in @@ -0,0 +1,62 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to use systemctl edit: +# +# $ systemctl edit @DAEMON_NAME@.service +# +# this will create file +# +# /etc/systemd/system/@DAEMON_NAME@.service.d/override.conf +# +# which be parsed after the file @DAEMON_NAME@.service itself is parsed. +# +# For example, if you want to increase mysql's open-files-limit to 20000 +# add following when editing with command above: +# +# [Service] +# LimitNOFILE=20000 +# +# Or if you require to execute pre and post scripts in the unit file as root, set +# PermissionsStartOnly=true +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F +# +# Don't forget to reload systemd daemon after you change unit configuration: +# root> systemctl --system daemon-reload + +[Unit] +Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server +After=syslog.target +After=network.target + +[Service] +Type=notify +User=mysql +Group=mysql + +ExecStartPre=@libexecdir@/mysql-check-socket +ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=@libexecdir@/mysqld --basedir=@prefix@ +ExecStopPost=@libexecdir@/mysql-wait-stop + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + +Restart=on-failure + +RestartPreventExitStatus=1 + +# Sets open_files_limit +LimitNOFILE = 10000 + +# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command. +Environment=MYSQLD_PARENT_PID=1 + +[Install] +WantedBy=multi-user.target diff --git a/mysql.spec b/mysql.spec new file mode 100644 index 0000000..bfb5dbf --- /dev/null +++ b/mysql.spec @@ -0,0 +1,674 @@ +%undefine __cmake_in_source_build +%global pkg_name %{name} +%global pkgnamepatch mysql +%{!?runselftest:%global runselftest 0} +%global check_testsuite 0 +%global require_mysql_selinux 1 +%global _pkgdocdirname %{pkg_name}%{!?_pkgdocdir:-%{version}} +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{pkg_name}-%{version}} +%global _default_patch_flags --no-backup-if-mismatch +%global skiplist platform-specific-tests.list +%bcond_without clibrary +%bcond_without devel +%bcond_without client +%bcond_without common +%bcond_without errmsg +%bcond_without test +%bcond_with config +%bcond_with debug +%global boost_bundled_version 1.77.0 +%global daemon_name mysqld +%global daemon_no_prefix mysqld +%global pidfiledir %{_rundir}/%{daemon_name} +%global logrotateddir %{_sysconfdir}/logrotate.d +%global logfiledir %{_localstatedir}/log/mysql +%global logfile %{logfiledir}/%{daemon_no_prefix}.log +%global dbdatadir %{_localstatedir}/lib/mysql +%global mysqluserhome /var/lib/mysql +%bcond_without mysql_names +%bcond_without conflicts +%global sameevr %{?epoch:%{epoch}:}%{version}-%{release} +Name: mysql +Version: 8.0.42 +Release: 1 +Summary: MySQL client programs and shared libraries +URL: http://www.mysql.com +License: GPL-2.0-or-later AND LGPL-2.1-only AND BSL-1.0 AND GPL-1.0-or-later OR Artistic-1.0-Perl AND BSD-2-Clause +Source0: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-boost-%{version}.tar.gz +Source2: mysql_config_multilib.sh +Source3: my.cnf.in +Source6: README.mysql-docs +Source7: README.mysql-license +Source10: mysql.tmpfiles.d.in +Source11: mysql.service.in +Source12: mysql-prepare-db-dir.sh +Source14: mysql-check-socket.sh +Source15: mysql-scripts-common.sh +Source17: mysql-wait-stop.sh +Source18: mysql@.service.in +Source30: %{pkgnamepatch}.rpmlintrc +Source31: server.cnf.in +Source32: https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-boost-%{version}.tar.gz.asc +Source33: https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 +Patch1: %{pkgnamepatch}-install-test.patch +Patch3: %{pkgnamepatch}-file-contents.patch +Patch4: %{pkgnamepatch}-scripts.patch +Patch5: %{pkgnamepatch}-paths.patch +Patch52: %{pkgnamepatch}-sharedir.patch +Patch55: %{pkgnamepatch}-rpath.patch +Patch75: %{pkgnamepatch}-arm32-timer.patch +Patch81: disable-moutline-atomics-for-aarch64.patch +Patch115: boost-1.58.0-pool.patch +Patch125: boost-1.57.0-mpl-print.patch +Patch126: mysql-Add-sw64-architecture.patch + +BuildRequires: cmake gcc-c++ libaio-devel libedit-devel libevent-devel libicu-devel lz4 +BuildRequires: lz4-devel mecab-devel bison libzstd-devel +%ifnarch aarch64 %{arm} s390 s390x +BuildRequires: numactl-devel +%endif +BuildRequires: openssl openssl-devel libcurl-devel make +BuildRequires: perl-interpreter perl-generators +BuildRequires: rpcgen libtirpc-devel +BuildRequires: protobuf-lite-devel rapidjson-devel zlib zlib-devel multilib-rpm-config procps +BuildRequires: time perl(base) perl(Carp) perl(Cwd) perl(Digest::file) perl(Digest::MD5) +BuildRequires: perl(English) perl(Env) perl(Errno) perl(Exporter) perl(Fcntl) +BuildRequires: perl(File::Basename) perl(File::Copy) perl(File::Find) perl(File::Spec) +BuildRequires: perl(File::Spec::Functions) perl(File::Temp) perl(FindBin) perl(Data::Dumper) +BuildRequires: perl(Getopt::Long) perl(if) perl(IO::File) perl(IO::Handle) perl(IO::Select) +BuildRequires: perl(IO::Socket::INET) perl(IPC::Open3) perl(JSON) perl(lib) perl(LWP::Simple) +BuildRequires: perl(Memoize) perl(Net::Ping) perl(POSIX) perl(Socket) perl(strict) +BuildRequires: perl(Sys::Hostname) perl(Test::More) perl(Time::HiRes) perl(Time::localtime) +BuildRequires: perl(warnings) systemd m4 chrpath gnupg2 wget +Requires: bash coreutils grep %{name}-common%{?_isa} = %{sameevr} +Provides: bundled(boost) = %{boost_bundled_version} +%if %{with mysql_names} +Provides: mysql = %{sameevr} +Provides: mysql%{?_isa} = %{sameevr} +Provides: mysql-compat-client = %{sameevr} +Provides: mysql-compat-client%{?_isa} = %{sameevr} +%endif +%{?with_conflicts:Conflicts: mariadb} +%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::) +%global __provides_exclude_from ^(%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$ +%description +MySQL is a multi-user, multi-threaded SQL database server. MySQL is a +client/server implementation consisting of a server daemon (mysqld) +and many different client programs and libraries. The base package +contains the standard MySQL client programs and generic MySQL files. +%if %{with clibrary} + +%package libs +Summary: The shared libraries required for MySQL clients +Requires: %{name}-common%{?_isa} = %{sameevr} +%if %{with mysql_names} +Provides: mysql-libs = %{sameevr} +Provides: mysql-libs%{?_isa} = %{sameevr} +%endif +%description libs +The mysql-libs package provides the essential shared libraries for any +MySQL client program or interface. You will need to install this package +to use any other MySQL package or any clients that need to connect to a +MySQL server. +%endif + + +%package config +Summary: The config files required by server and client +%description config +The package provides the config file my.cnf and my.cnf.d directory used by any +MariaDB or MySQL program. You will need to install this package to use any +other MariaDB or MySQL package if the config files are not provided in the +package itself. + +%if %{with common} + +%package common +Summary: The shared files required for MySQL server and client +Requires: %{name}-config = %{sameevr} +%description common +The mysql-common package provides the essential shared files for any +MySQL program. You will need to install this package to use any other +MySQL package. +%endif +%if %{with errmsg} + +%package errmsg +Summary: The error messages files required by MySQL server +Requires: %{name}-common%{?_isa} = %{sameevr} +%description errmsg +The package provides error messages files for the MySQL daemon +%endif + +%package server +Summary: The MySQL server and related files +Suggests: %{name}%{?_isa} = %{sameevr} +Requires: mysql%{?_isa} +Requires: %{name}-common%{?_isa} = %{sameevr} %{name}-config = %{sameevr} +Requires: %{_sysconfdir}/my.cnf.d %{name}-errmsg%{?_isa} = %{sameevr} +%{?mecab:Requires: mecab-ipadic} +Requires: coreutils +Requires(pre): /usr/sbin/useradd +Requires: systemd +%{?systemd_requires: %systemd_requires} +Recommends: libcap +Requires(post): policycoreutils-python-utils +%if %require_mysql_selinux +Requires: (mysql-selinux if selinux-policy-targeted) +%endif +%if %{with mysql_names} +Provides: mysql-server = %{sameevr} +Provides: mysql-server%{?_isa} = %{sameevr} +Provides: mysql-compat-server = %{sameevr} +Provides: mysql-compat-server%{?_isa} = %{sameevr} +%endif +%{?with_conflicts:Conflicts: mariadb-server} +%{?with_conflicts:Conflicts: mariadb-galera-server} +%description server +MySQL is a multi-user, multi-threaded SQL database server. MySQL is a +client/server implementation consisting of a server daemon (mysqld) +and many different client programs and libraries. This package contains +the MySQL server and some accompanying files and directories. +%if %{with devel} + +%package devel +Summary: Files for development of MySQL applications +%{?with_clibrary:Requires: %{name}-libs%{?_isa} = %{sameevr}} +Requires: openssl-devel zlib-devel libzstd-devel +%{?with_conflicts:Conflicts: mariadb-devel} +%description devel +MySQL is a multi-user, multi-threaded SQL database server. This +package contains the libraries and header files that are needed for +developing MySQL client applications. +%endif +%if %{with test} + +%package test +Summary: The test suite distributed with MySQL +Requires: %{name}%{?_isa} = %{sameevr} %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-server%{?_isa} = %{sameevr} gzip lz4 openssl perl(Digest::file) +Requires: perl(Digest::MD5) perl(Env) perl(Exporter) perl(Fcntl) perl(File::Temp) +Requires: perl(FindBin) perl(Data::Dumper) perl(Getopt::Long) perl(IPC::Open3) perl(JSON) +Requires: perl(LWP::Simple) perl(Memoize) perl(Socket) perl(Sys::Hostname) +Requires: perl(Test::More) perl(Time::HiRes) +%{?with_conflicts:Conflicts: mariadb-test} +%if %{with mysql_names} +Provides: mysql-test = %{sameevr} +Provides: mysql-test%{?_isa} = %{sameevr} +%endif +%description test +MySQL is a multi-user, multi-threaded SQL database server. This +package contains the regression test suite distributed with +the MySQL sources. +%endif + +%package help +Summary: Docs for development of MySQL applications. +Requires: mysql = %{version}-%{release} +%description help +The package provides Docs for development of MySQL applications. + + +%prep +# download source0 and gpg check +# wget -qO %{SOURCE0} https://user-repo.openeuler.openatom.cn/lfs-tar/mysql/mysql-boost-%{version}.tar.gz +gpg --import %{SOURCE33} +gpg --verify %{SOURCE32} %{SOURCE0} +%setup -q -n mysql-%{version} +%patch1 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch52 -p1 +%patch55 -p1 +%patch75 -p1 +%patch81 -p1 +pushd boost/boost_$(echo %{boost_bundled_version}| tr . _) +%patch115 -p0 +%patch125 -p1 +popd +%ifarch sw_64 +%patch126 -p1 +%endif +pushd mysql-test +add_test () { + echo "$1" : BUG#0 "${@:2}" >> %{skiplist} +} +touch %{skiplist} +add_test innodb.redo_log_archive_04 failed since 8.0.17 +add_test clone.remote_dml_no_binlog failed since 8.0.17 +add_test auth_sec.keyring_file_data_qa sporadic since 8.0.19 +add_test collations.chinese sporadic since 8.0.19 +add_test main.mysql_load_data_local_dir local infile on +add_test rpl.rpl_row_jsondiff_basic_pk failed since 8.0.22 +add_test rpl.rpl_row_jsondiff_basic_nokey failed since 8.0.22 +%ifarch %arm aarch64 +add_test gis.st_latitude +add_test gis.st_longitude +add_test perfschema.func_file_io missing hw on arm32 +add_test perfschema.func_mutex missing hw on arm32 +add_test perfschema.global_read_lock missing hw on arm32 +add_test perfschema.setup_objects missing hw on arm32 +add_test clone.remote_error_basic max_allowed_packet is 0 +add_test innodb.create_tablespace +%endif +%ifarch s390x +add_test gis.geometry_class_attri_prop +add_test gis.geometry_property_function_issimple +add_test gis.gis_bugs_crashes +add_test gis.spatial_analysis_functions_buffer +add_test gis.spatial_analysis_functions_centroid +add_test gis.spatial_analysis_functions_distance +add_test gis.spatial_operators_intersection +add_test gis.spatial_op_testingfunc_mix +add_test gis.spatial_utility_function_distance_sphere +add_test gis.spatial_utility_function_simplify +add_test innodb.log_encrypt_kill main.with_recursive +add_test innodb.mysqldump_max_recordsize +add_test main.lock_multi_bug38499 +add_test main.window_std_var +add_test main.window_std_var_optimized +add_test main.with_recursive +add_test x.resource_groups +add_test gis.spatial_operators_symdifference +add_test gis.spatial_operators_union +add_test main.subquery_bugs +%endif +%ifarch %arm +add_test perfschema.relaylog +%endif +popd +cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} \ + %{SOURCE14} %{SOURCE15} %{SOURCE17} %{SOURCE18} %{SOURCE31} scripts + +%build +%ifarch %arm +%define _lto_cflags %{nil} +%endif +%if %runselftest + if [ x"$(id -u)" = "x0" ]; then + echo "mysql's regression tests fail if run as root." + echo "If you really need to build the RPM as root, use" + echo "--nocheck to skip the regression tests." + exit 1 + fi +%endif +mkdir -p build && chmod +w build && cd build +cmake .. \ + -DBUILD_CONFIG=mysql_release \ + -DFEATURE_SET="community" \ + -DINSTALL_LAYOUT=RPM \ + -DDAEMON_NAME="%{daemon_name}" \ + -DDAEMON_NO_PREFIX="%{daemon_no_prefix}" \ + -DLOG_LOCATION="%{logfile}" \ + -DPID_FILE_DIR="%{pidfiledir}" \ + -DNICE_PROJECT_NAME="MySQL" \ + -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ + -DSYSCONFDIR="%{_sysconfdir}" \ + -DSYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \ + -DINSTALL_DOCDIR="share/doc/%{_pkgdocdirname}" \ + -DINSTALL_DOCREADMEDIR="share/doc/%{_pkgdocdirname}" \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_INFODIR=share/info \ + -DINSTALL_LIBEXECDIR=libexec \ + -DINSTALL_LIBDIR="%{_lib}/mysql" \ + -DRPATH_LIBDIR="%{_libdir}" \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_MYSQLSHAREDIR=share/%{pkg_name} \ + -DINSTALL_MYSQLTESTDIR=share/mysql-test \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_SBINDIR=bin \ + -DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \ + -DMYSQL_DATADIR="%{dbdatadir}" \ + -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \ + -DENABLED_LOCAL_INFILE=ON \ + -DWITH_SYSTEMD=1 \ + -DSYSTEMD_SERVICE_NAME="%{daemon_name}" \ + -DSYSTEMD_PID_DIR="%{pidfiledir}" \ + -DWITH_INNODB_MEMCACHED=ON \ + -DWITH_FIDO=bundled \ +%ifnarch aarch64 %{arm} s390 s390x + -DWITH_NUMA=ON \ +%endif +%ifarch s390 s390x armv7hl + -DUSE_LD_GOLD=OFF \ +%endif + -DWITH_ROUTER=OFF \ + -DWITH_SYSTEM_LIBS=ON \ + -DWITH_MECAB=system \ + -DWITH_BOOST=../boost \ + -DREPRODUCIBLE_BUILD=OFF \ + -DCMAKE_C_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable}" \ + -DCMAKE_CXX_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable}" \ + -DCMAKE_EXE_LINKER_FLAGS="-pie %{build_ldflags}" \ +%{?with_debug: -DWITH_DEBUG=1} \ +%{?with_debug: -DMYSQL_MAINTAINER_MODE=0} \ + -DTMPDIR=/var/tmp \ + -DWITH_MYSQLD_LDFLAGS="%{build_ldflags}" \ + -DCMAKE_C_LINK_FLAGS="%{build_ldflags}" \ + -DCMAKE_CXX_LINK_FLAGS="%{build_ldflags}" +cmake .. -LAH + +%make_build +cd - + +%install +cd build +make DESTDIR=%{buildroot} install +if %multilib_capable; then +mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits} +install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config +fi +install -p -m 0644 Docs/INFO_SRC %{buildroot}%{_libdir}/mysql/ +install -p -m 0644 Docs/INFO_BIN %{buildroot}%{_libdir}/mysql/ +mkdir -p %{buildroot}%{logfiledir} +mkdir -p %{buildroot}%{pidfiledir} +install -p -m 0755 -d %{buildroot}%{dbdatadir} +install -p -m 0750 -d %{buildroot}%{_localstatedir}/lib/mysql-files +install -p -m 0700 -d %{buildroot}%{_localstatedir}/lib/mysql-keyring + +install -D -p -m 0644 scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf + +install -D -p -m 644 scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service +install -D -p -m 644 scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service +install -D -p -m 0644 scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{daemon_name}.conf +rm -r %{buildroot}%{_tmpfilesdir}/mysql.conf +install -D -p -m 755 scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir +install -p -m 755 scripts/mysql-wait-stop %{buildroot}%{_libexecdir}/mysql-wait-stop +install -p -m 755 scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket +install -p -m 644 scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common +install -D -p -m 0644 scripts/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf +rm %{buildroot}%{_libdir}/mysql/*.a +rm %{buildroot}%{_mandir}/man1/comp_err.1* +mkdir -p %{buildroot}%{logrotateddir} +mv %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name} +chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name} +mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d +echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf +mv %{buildroot}%{_bindir}/mysqld %{buildroot}%{_libexecdir}/mysqld +chrpath -d %{buildroot}%{_libexecdir}/mysqld +mkdir -p %{buildroot}%{_sbindir} +ln -s %{_libexecdir}/mysqld %{buildroot}%{_sbindir}/mysqld + +%if %{with debug} +mv %{buildroot}%{_bindir}/mysqld-debug %{buildroot}%{_libexecdir}/mysqld +%endif + +cd - +install -p -m 0644 %{SOURCE6} %{basename:%{SOURCE6}} +install -p -m 0644 %{SOURCE7} %{basename:%{SOURCE7}} +install -p -m 0644 mysql-test/%{skiplist} %{buildroot}%{_datadir}/mysql-test + + +mkdir -p %{buildroot}%{_sysconfdir}/my.cnf.d + + + + +%check +%if %runselftest +pushd build +make test VERBOSE=1 +cd mysql-test +cp ../../mysql-test/%{skiplist} . +export MTR_BUILD_THREAD=%{__isa_bits} +./mtr %{?with_debug:--debug-server} \ + --mem --parallel=auto --force --retry=2 \ + --mysqld=--binlog-format=mixed \ + --suite-timeout=720 --testcase-timeout=30 \ + --report-unstable-tests --clean-vardir \ +%if %{check_testsuite} + --max-test-fail=0 || : +%else + --skip-test-list=%{skiplist} +%endif +rm -r var $(readlink var) +cd - +popd +%endif + +%pre server +/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || : +/usr/sbin/useradd -M -N -g mysql -o -r -d %{mysqluserhome} -s /sbin/nologin \ + -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || : + +%post server +%systemd_post %{daemon_name}.service +if [ ! -e "%{logfile}" -a ! -h "%{logfile}" ] ; then + install /dev/null -m0640 -omysql -gmysql "%{logfile}" +fi + +%preun server +%systemd_preun %{daemon_name}.service + +%postun server +%systemd_postun_with_restart %{daemon_name}.service + +%files +%doc README README.mysql-license README.mysql-docs +%{_bindir}/{mysql,mysql_config_editor,mysqladmin,mysqlcheck,mysqldump} +%{_bindir}/{mysqlimport,mysqlpump,mysqlshow,mysqlslap,mysqlbinlog,zlib_decompress} +%exclude %{_tmpfilesdir}/mysql.conf + +%files libs +%{_libdir}/mysql/libmysqlclient*.so.* +%config(noreplace) %{_sysconfdir}/ld.so.conf.d/* + +%files config +%dir %{_sysconfdir}/my.cnf.d +%config(noreplace) %{_sysconfdir}/my.cnf + + + +%files common +%dir %{_libdir}/mysql +%dir %{_datadir}/mysql +%{_datadir}/mysql/charsets + +%files errmsg +%{_datadir}/mysql/messages_to_error_log.txt +%{_datadir}/mysql/messages_to_clients.txt +%{_datadir}/mysql/{errmsg-utf8.txt,english} +%lang(bg) %{_datadir}/mysql/bulgarian +%lang(cs) %{_datadir}/mysql/czech +%lang(da) %{_datadir}/mysql/danish +%lang(nl) %{_datadir}/mysql/dutch +%lang(et) %{_datadir}/mysql/estonian +%lang(fr) %{_datadir}/mysql/french +%lang(de) %{_datadir}/mysql/german +%lang(el) %{_datadir}/mysql/greek +%lang(hu) %{_datadir}/mysql/hungarian +%lang(it) %{_datadir}/mysql/italian +%lang(ja) %{_datadir}/mysql/japanese +%lang(ko) %{_datadir}/mysql/korean +%lang(no) %{_datadir}/mysql/norwegian +%lang(no) %{_datadir}/mysql/norwegian-ny +%lang(pl) %{_datadir}/mysql/polish +%lang(pt) %{_datadir}/mysql/portuguese +%lang(ro) %{_datadir}/mysql/romanian +%lang(ru) %{_datadir}/mysql/russian +%lang(sr) %{_datadir}/mysql/serbian +%lang(sk) %{_datadir}/mysql/slovak +%lang(es) %{_datadir}/mysql/spanish +%lang(sv) %{_datadir}/mysql/swedish +%lang(uk) %{_datadir}/mysql/ukrainian + +%files server +%{_bindir}/{ibd2sdi,myisamchk,myisam_ftdump,myisamlog,myisampack,my_print_defaults} +%{_bindir}/{mysql_secure_installation,mysql_ssl_rsa_setup,mysql_tzinfo_to_sql,perror} +%{_bindir}/{mysql_upgrade,mysqld_pre_systemd,mysqldumpslow,innochecksum} +%{_bindir}/{mysql_keyring_encryption_test,mysql_migrate_keyring} +%config(noreplace) %{_sysconfdir}/my.cnf.d/mysql-server.cnf +%{_sbindir}/mysqld +%caps(cap_sys_nice=ep) %{_libexecdir}/mysqld +%{_libdir}/mysql/{INFO_SRC,INFO_BIN,plugin} +%dir %{_datadir}/mysql +%{_datadir}/mysql/dictionary.txt +%{_datadir}/mysql/*.sql +%{_unitdir}/mysqld* +%{_libexecdir}/{mysql-prepare-db-dir,mysql-wait-stop,mysql-check-socket,mysql-scripts-common} +%{_tmpfilesdir}/mysqld.conf +%attr(0755,mysql,mysql) %dir %{_localstatedir}/lib/mysql +%attr(0750,mysql,mysql) %dir %{_localstatedir}/lib/mysql-files +%attr(0700,mysql,mysql) %dir %{_localstatedir}/lib/mysql-keyring +%attr(0750,mysql,mysql) %dir %{_localstatedir}/log/mysql +%attr(0755,mysql,mysql) %dir %{_rundir}/mysqld +%attr(0640,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{_localstatedir}/log/mysql/mysqld.log +%config(noreplace) %{_sysconfdir}/logrotate.d/mysqld + +%files devel +%{_bindir}/mysql_config* +%{_includedir}/mysql +%{_datadir}/aclocal/mysql.m4 +%{_libdir}/mysql/libmysqlclient.so +%{_libdir}/pkgconfig/mysqlclient.pc +%exclude %{_bindir}/mysql_config_editor + + +%files test +%{_bindir}/{mysql_client_test,mysqltest,mysqltest_safe_process,mysqlxtest} +%{_bindir}/{mysqld_safe,comp_err} +%attr(-,mysql,mysql) %{_datadir}/mysql-test + +%files help +%doc README.mysql-license README.mysql-docs LICENSE +%doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google +%{_mandir}/man1/{mysql.1*,mysql_config_editor.1*,mysqladmin.1*,mysqlbinlog.1*,mysqldump.1*} +%{_mandir}/man1/{mysqlcheck.1*,mysqlimport.1*,mysqlpump.1*,mysqlshow.1*,mysqlslap.1*} +%{_mandir}/man1/{ibd2sdi.1*,myisamchk.1*,myisamlog.1*,myisampack.1*,myisam_ftdump.1*,mysqlman.1*} +%{_mandir}/man1/{my_print_defaults.1*,mysql_secure_installation.1*,mysql_ssl_rsa_setup.1*} +%{_mandir}/man1/{mysql_tzinfo_to_sql.1*,mysql_upgrade.1*,mysqldumpslow.1*,perror.1*} +%{_mandir}/man1/{lz4_decompress.1*,zlib_decompress.1*,innochecksum.1*,mysql.server.1*} +%{_mandir}/man8/mysqld.8* +%{_mandir}/man1/mysql_config.1* + +%changelog +* Wed Apr 16 2025 yaoxin <1024769339@qq.com> - 8.0.42-1 +- Update to 8.0.42 for fix CVEs(CVE-2025-21574,CVE-2025-21575,CVE-2025-21577, + CVE-2025-21580,CVE-2025-21581,CVE-2025-21584,CVE-2025-21585,CVE-2025-30681, + CVE-2025-30682,CVE-2025-30683,CVE-2025-30684,CVE-2025-30685,CVE-2025-30687, + CVE-2025-30688,CVE-2025-30689,CVE-2025-30693,CVE-2025-30695,CVE-2025-30696, + CVE-2025-30699,CVE-2025-30703,CVE-2025-30704,CVE-2025-30705,CVE-2025-30710, + CVE-2025-30715,CVE-2025-30721,CVE-2025-30722 + +* Wed Jan 22 2025 yaoxin <1024769339@qq.com> - 8.0.41-1 +- Update to 8.0.41 for fix CVEs(CVE-2025-21490,CVE-2025-21491,CVE-2025-21495, + CVE-2025-21497,CVE-2025-21500,CVE-2025-21501,CVE-2025-21503,CVE-2025-21505, + CVE-2025-21518,CVE-2025-21519,CVE-2025-21520,CVE-2025-21522,CVE-2025-21523, + CVE-2025-21529,CVE-2025-21531,CVE-2025-21540,CVE-2025-21543,CVE-2025-21546, + CVE-2025-21555,CVE-2025-21559) + +* Thu Nov 21 2024 zhouyi - 8.0.40-2 +- Add lfs config to branch openEuler-24.03-LTS + Edit mysql.spec + +* Thu Oct 17 2024 wangkai <13474090681@163.com> - 8.0.40-1 +- Update to 8.0.40 for fix CVEs(CVE-2024-21218,CVE-2024-21196,CVE-2024-21207, + CVE-2024-21198,CVE-2024-21203,CVE-2024-21213,CVE-2024-21239,CVE-2024-21199, + CVE-2024-21197,CVE-2024-21247,CVE-2024-21193,CVE-2024-21212,CVE-2024-21241, + CVE-2024-21230,CVE-2024-21236,CVE-2024-21194,CVE-2024-21238,CVE-2024-21237, + CVE-2024-21201,CVE-2024-21231,CVE-2024-21219,CVE-2024-21185) + +* Mon Jul 22 2024 wangkai <13474090681@163.com> - 8.0.38-1 +- Update to 8.0.38 for fix CVEs(CVE-2024-21125,CVE-2024-21142,CVE-2024-21179, + CVE-2024-21171,CVE-2024-21130,CVE-2024-21162,CVE-2024-21177,CVE-2024-20996, + CVE-2024-21134,CVE-2024-21165,CVE-2024-21173,CVE-2024-21129,CVE-2024-21127, + CVE-2024-21163) + +* Tue May 07 2024 wangkai <13474090681@163.com> - 8.0.37-1 +- Update to 8.0.37 for fix CVEs(CVE-2024-20964,CVE-2024-20971,CVE-2024-20976, + CVE-2024-20973,CVE-2024-20978,CVE-2024-20981,CVE-2024-20962,CVE-2024-20977, + CVE-2024-20963,CVE-2024-20965,CVE-2024-20972,CVE-2024-20961,CVE-2024-20982, + CVE-2024-20970,CVE-2024-20967,CVE-2024-20984,CVE-2024-20974,CVE-2024-20966, + CVE-2024-20960,CVE-2024-20985,CVE-2024-20969,CVE-2024-21000,CVE-2024-21069, + CVE-2024-21009,CVE-2024-21087,CVE-2024-21047,CVE-2024-20998,CVE-2024-21013, + CVE-2024-21060,CVE-2024-21008,CVE-2024-21102,CVE-2024-21054,CVE-2024-21062, + CVE-2024-20994,CVE-2024-21096,CVE-2024-21061,CVE-2024-20993,CVE-2024-21055, + CVE-2024-21057,CVE-2023-6129) + +* Wed Dec 13 2023 Ge Wang - 8.0.35-2 +- Remove rpath to fix euler maker build failure + +* Tue Nov 07 2023 yaoxin - 8.0.35-1 +- Upgrade to 8.0.35 for fix cves + +* Tue May 16 2023 yaoxin - 8.0.29-3 +- Fix CVE-2022-37434 + +* Wed Oct 26 2022 wuzx - 8.0.29-2 +- Add sw64 architecture + +*Mon May 9 2022 jintang song - 8.0.29-1 +- Upgrade mysql to 8.0.29,fix CVES:'CVE-2022-21423 CVE-2022-21451 + CVE-2022-21444 CVE-2022-21460 CVE-2022-21417 CVE-2022-21427 CVE-2022-21414 + CVE-2022-21435 CVE-2022-21452 CVE-2022-21413 CVE-2022-21462 CVE-2022-21412 + CVE-2022-21415 CVE-2022-21437 CVE-2022-21438 CVE-2022-21436 CVE-2022-21418 + CVE-2022-21459 CVE-2022-21478 CVE-2022-21479 CVE-2022-21440 CVE-2022-21425 + CVE-2022-21457 CVE-2022-21454 CVE-2022-21483 CVE-2022-21482 CVE-2022-21484 + CVE-2022-21485 CVE-2022-21486 CVE-2022-21489 CVE-2022-21490 +* Tue Jan 25 2022 yaoxin - 8.0.28-1 +- Upgrade mysql to 8.0.28 to fix cves. + +* Fri Oct 29 2021 yaoxin - 8.0.27-1 +- Upgrade mysql to 8.0.27,fix CVES:CVE-2021-2471 CVE-2021-2478 CVE-2021-2479 + CVE-2021-2481 CVE-2021-35546 CVE-2021-35575 CVE-2021-35577 CVE-2021-35591 + CVE-2021-35596 CVE-2021-35597 CVE-2021-35602 CVE-2021-35604 CVE-2021-35607 + CVE-2021-35608 CVE-2021-35610 CVE-2021-35612 CVE-2021-35618 + CVE-2021-35621-to-CVE-2021-35636 CVE-2021-35638-to-CVE-2021-35642 + CVE-2021-35644-to-CVE-2021-35648 + +* Mon Aug 2 2021 liwu - 8.0.26-1 +- Upgrade mysql to 8.0.26,fix CVES:CVE-2021-2356 CVE-2021-2339 CVE-2021-2354 + CVE-2021-2352 CVE-2021-2340 + +* Wed Jun 16 2021 zhaoyao - 8.0.24-2 +- Fix buiding error: Built target mysqlgcs error +- Add m4 in BuildRequires + +* Thu May 8 2021 wutao - 8.0.24-1 +- Upgrade mysql to 8.0.24, fix CVES: CVE-2021-2166 CVE-2021-2146 + CVE-2021-2162 CVE-2021-2212 CVE-2021-2299 CVE-2021-2293 CVE-2021-2215 + CVE-2021-2278 CVE-2021-2164 CVE-2021-2208 CVE-2021-2217 CVE-2021-2203 + CVE-2021-2226 CVE-2021-2298 CVE-2021-2230 CVE-2021-2300 CVE-2021-2304 + CVE-2021-2172 CVE-2021-2194 CVE-2021-2170 CVE-2021-2196 CVE-2021-2201 + CVE-2021-2180 CVE-2021-2307 CVE-2021-2169 CVE-2021-2171 CVE-2021-2305 + CVE-2021-2179 CVE-2021-2174 CVE-2021-2193 CVE-2021-2232 CVE-2021-2301 + CVE-2021-2308 + +* Wed Mar 10 2021 wangxiao - 8.0.23-1 +- Upgrade mysql to 8.0.23, fix CVES: CVE-2021-1998 CVE-2021-2002 + CVE-2021-2010 CVE-2021-2011 CVE-2021-2016 CVE-2021-2021 CVE-2021-2022 + CVE-2021-2024 CVE-2021-2031 CVE-2021-2032 CVE-2021-2036 CVE-2021-2038 + CVE-2021-2046 CVE-2021-2048 CVE-2021-2056 CVE-2021-2058 CVE-2021-2060 + CVE-2021-2061 CVE-2021-2065 CVE-2021-2070 CVE-2021-2072 CVE-2021-2076 + CVE-2021-2081 CVE-2021-2087 CVE-2021-2088 CVE-2021-2122 + +* Wed Jan 13 2021 Shengjing Wei - 8.0.22-2 +- Delete useless information + +* Tue Dec 1 2020 weishengjing - 8.0.22-1 +- New version 8.0.22 fix CVES: CVE-2020-14852 CVE-2020-14794 CVE-2020-14775 + CVE-2020-14893 CVE-2020-14829 CVE-2020-14828 CVE-2020-14888 CVE-2020-14891 + CVE-2020-14812 CVE-2020-14870 CVE-2020-14769 CVE-2020-14878 CVE-2020-14789 + CVE-2020-14821 CVE-2020-14844 CVE-2020-14836 CVE-2020-14830 CVE-2020-14827 + CVE-2020-14773 CVE-2020-14765 CVE-2020-14869 CVE-2020-14776 CVE-2020-14861 + CVE-2020-14866 CVE-2020-14672 CVE-2020-14837 CVE-2020-14771 CVE-2020-14785 + CVE-2020-14838 CVE-2020-14848 CVE-2020-14791 CVE-2020-14793 CVE-2020-14804 + CVE-2020-14777 CVE-2020-14800 CVE-2020-14786 CVE-2020-14845 CVE-2020-14839 + CVE-2020-14846 CVE-2020-14867 CVE-2020-14868 CVE-2020-14873 CVE-2020-14860 + CVE-2020-14814 CVE-2020-14790 CVE-2020-14809 + +* Sat Sep 19 2020 maminjie - 8.0.21-2 +- fix internal compiler error: Segmentation fault + +* Mon Sep 14 2020 maminjie - 8.0.21-1 +- upgrade to 8.0.21 + +* Mon Jun 1 2020 Jeffery.Gao - 8.0.18-2 +- Package upgrade. + +* Sun Mar 1 2020 zhangtao 8.0.17-3 +- add fstack-protector-strong + +* Fri Feb 28 2020 catastrowings 8.0.17-2 +- openEuler package init. diff --git a/mysql.tmpfiles.d.in b/mysql.tmpfiles.d.in new file mode 100644 index 0000000..d2c4b31 --- /dev/null +++ b/mysql.tmpfiles.d.in @@ -0,0 +1 @@ +d @PID_FILE_DIR@ 0755 mysql mysql - diff --git a/mysql.yaml b/mysql.yaml new file mode 100644 index 0000000..e1e3105 --- /dev/null +++ b/mysql.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: mysql/mysql-server +tag_prefix: mysql-cluster- +seperator: . diff --git a/mysql@.service.in b/mysql@.service.in new file mode 100644 index 0000000..b7b2d48 --- /dev/null +++ b/mysql@.service.in @@ -0,0 +1,62 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to use systemctl edit: +# +# $ systemctl edit @DAEMON_NAME@.service +# +# this will create file +# +# /etc/systemd/system/@DAEMON_NAME@.service.d/override.conf +# +# which be parsed after the file @DAEMON_NAME@.service itself is parsed. +# +# For example, if you want to increase mysql's open-files-limit to 20000 +# add following when editing with command above: +# +# [Service] +# LimitNOFILE=20000 +# +# Or if you require to execute pre and post scripts in the unit file as root, set +# PermissionsStartOnly=true +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F +# +# Don't forget to reload systemd daemon after you change unit configuration: +# root> systemctl --system daemon-reload + +[Unit] +Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server +After=syslog.target +After=network.target + +[Service] +Type=notify +User=mysql +Group=mysql + +ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I +ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ +ExecStopPost=@libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + +Restart=on-failure + +RestartPreventExitStatus=1 + +# Sets open_files_limit +LimitNOFILE = 10000 + +# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command. +Environment=MYSQLD_PARENT_PID=1 + +[Install] +WantedBy=multi-user.target diff --git a/mysql_config_multilib.sh b/mysql_config_multilib.sh new file mode 100644 index 0000000..06c2a2b --- /dev/null +++ b/mysql_config_multilib.sh @@ -0,0 +1,26 @@ +#! /bin/sh +# +# Wrapper script for mysql_config to support multilib +# +# This command respects setarch + +bits=$(rpm --eval %__isa_bits) + +case $bits in + 32|64) status=known ;; + *) status=unknown ;; +esac + +if [ "$status" = "unknown" ] ; then + echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits" + exit 1 +fi + + +if [ -x @bindir@/mysql_config-$bits ] ; then + @bindir@/mysql_config-$bits "$@" +else + echo "$0: error: needed binary: @bindir@/mysql_config-$bits is missing" + exit 1 +fi + diff --git a/server.cnf.in b/server.cnf.in new file mode 100644 index 0000000..ba3d479 --- /dev/null +++ b/server.cnf.in @@ -0,0 +1,18 @@ +# +# This group are read by MySQL server. +# Use it for options that only the server (but not clients) should see +# +# For advice on how to change settings please see +# http://dev.mysql.com/doc/refman/en/server-configuration-defaults.html + +# Settings user and group are ignored when systemd is used. +# If you need to run mysqld under a different user or group, +# customize your systemd unit file for mysqld according to the +# instructions in http://fedoraproject.org/wiki/Systemd + +[mysqld] +datadir=@MYSQL_DATADIR@ +socket=@MYSQL_UNIX_ADDR@ +log-error=@LOG_LOCATION@ +pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid +