From 752281ea43b01b360215c8a8665a2f8eca0a2a9a Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 24 Jan 2023 14:15:29 -0500 Subject: [PATCH] Fix build with GCC 13 --- mariadb-10.5-gcc13.patch | 12 +++ mariadb.spec | 7 ++ rocksdb-6.8-gcc13.patch | 164 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100644 mariadb-10.5-gcc13.patch create mode 100644 rocksdb-6.8-gcc13.patch diff --git a/mariadb-10.5-gcc13.patch b/mariadb-10.5-gcc13.patch new file mode 100644 index 0000000..341b47b --- /dev/null +++ b/mariadb-10.5-gcc13.patch @@ -0,0 +1,12 @@ +diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc +index 8a6688e6775..5eff358723d 100644 +--- a/tpool/aio_linux.cc ++++ b/tpool/aio_linux.cc +@@ -17,6 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ + #include "tpool.h" + + #ifdef LINUX_NATIVE_AIO ++# include + # include + # include + # include diff --git a/mariadb.spec b/mariadb.spec index 392fde2..65cfe6d 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -209,6 +209,9 @@ Patch7: %{pkgnamepatch}-scripts.patch Patch9: %{pkgnamepatch}-ownsetup.patch # Patch10: Fix cipher name in the SSL Cipher name test Patch10: %{pkgnamepatch}-ssl-cipher-tests.patch +# https://gcc.gnu.org/gcc-13/porting_to.html +Patch11: mariadb-10.5-gcc13.patch +Patch12: rocksdb-6.8-gcc13.patch BuildRequires: make BuildRequires: cmake gcc-c++ @@ -740,6 +743,10 @@ rm -r storage/rocksdb/ # Keeping the patch commented out, need to revisit # once the test is re-enabled by upstream in some future release #%patch10 -p1 +%patch11 -p1 +%if %{with rocksdb} +%patch12 -p1 -d storage/rocksdb/rocksdb/ +%endif # generate a list of tests that fail, but are not disabled by upstream cat %{SOURCE50} | tee -a mysql-test/unstable-tests diff --git a/rocksdb-6.8-gcc13.patch b/rocksdb-6.8-gcc13.patch new file mode 100644 index 0000000..597c493 --- /dev/null +++ b/rocksdb-6.8-gcc13.patch @@ -0,0 +1,164 @@ +diff --git a/db/compaction/compaction_iteration_stats.h b/db/compaction/compaction_iteration_stats.h +index 963c1d8eb..79acbec6a 100644 +--- a/db/compaction/compaction_iteration_stats.h ++++ b/db/compaction/compaction_iteration_stats.h +@@ -5,6 +5,8 @@ + + #pragma once + ++#include ++ + #include "rocksdb/rocksdb_namespace.h" + + struct CompactionIterationStats { +diff --git a/include/rocksdb/thread_status.h b/include/rocksdb/thread_status.h +index 6b2f5c885..bb2de6c7b 100644 +--- a/include/rocksdb/thread_status.h ++++ b/include/rocksdb/thread_status.h +@@ -13,13 +13,15 @@ + + #pragma once + +-#include + #include ++#include + #include + #include + #include + #include + ++#include "rocksdb/rocksdb_namespace.h" ++ + #if !defined(ROCKSDB_LITE) && !defined(NROCKSDB_THREAD_STATUS) && \ + defined(ROCKSDB_SUPPORT_THREAD_LOCAL) + #define ROCKSDB_USING_THREAD_STATUS +diff --git a/include/rocksdb/universal_compaction.h b/include/rocksdb/universal_compaction.h +index e3aeee6ce..58323f2d9 100644 +--- a/include/rocksdb/universal_compaction.h ++++ b/include/rocksdb/universal_compaction.h +@@ -5,10 +5,12 @@ + + #pragma once + +-#include + #include ++#include + #include + ++#include "rocksdb/rocksdb_namespace.h" ++ + namespace ROCKSDB_NAMESPACE { + + // +diff --git a/include/rocksdb/utilities/checkpoint.h b/include/rocksdb/utilities/checkpoint.h +index c7f93b4cf..3c2ab8053 100644 +--- a/include/rocksdb/utilities/checkpoint.h ++++ b/include/rocksdb/utilities/checkpoint.h +@@ -8,6 +8,7 @@ + #pragma once + #ifndef ROCKSDB_LITE + ++#include + #include + #include + #include "rocksdb/status.h" +diff --git a/include/rocksdb/utilities/ldb_cmd_execute_result.h b/include/rocksdb/utilities/ldb_cmd_execute_result.h +index c837b47f7..57bac3346 100644 +--- a/include/rocksdb/utilities/ldb_cmd_execute_result.h ++++ b/include/rocksdb/utilities/ldb_cmd_execute_result.h +@@ -5,6 +5,10 @@ + // + #pragma once + ++#include ++ ++#include "rocksdb/rocksdb_namespace.h" ++ + #ifdef FAILED + #undef FAILED + #endif +diff --git a/memory/memory_usage.h b/memory/memory_usage.h +index 15e8b87cd..4c73cd40b 100644 +--- a/memory/memory_usage.h ++++ b/memory/memory_usage.h +@@ -5,8 +5,11 @@ + + #pragma once + ++#include + #include + ++#include "rocksdb/rocksdb_namespace.h" ++ + namespace ROCKSDB_NAMESPACE { + + // Helper methods to estimate memroy usage by std containers. +diff --git a/table/block_based/data_block_hash_index.h b/table/block_based/data_block_hash_index.h +index f356395f3..321522175 100644 +--- a/table/block_based/data_block_hash_index.h ++++ b/table/block_based/data_block_hash_index.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + +diff --git a/util/crc32c_ppc.h b/util/crc32c_ppc.h +index c359061c6..5cb12c89a 100644 +--- a/util/crc32c_ppc.h ++++ b/util/crc32c_ppc.h +@@ -7,6 +7,9 @@ + + #pragma once + ++#include ++#include ++ + #ifdef __cplusplus + extern "C" { + #endif +diff --git a/util/string_util.h b/util/string_util.h +index a761be66c..064d059f0 100644 +--- a/util/string_util.h ++++ b/util/string_util.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include +diff --git a/utilities/blob_db/blob_db_gc_stats.h b/utilities/blob_db/blob_db_gc_stats.h +index 1e6e4a25d..fea6b0032 100644 +--- a/utilities/blob_db/blob_db_gc_stats.h ++++ b/utilities/blob_db/blob_db_gc_stats.h +@@ -5,6 +5,10 @@ + // + #pragma once + ++#include ++ ++#include "rocksdb/rocksdb_namespace.h" ++ + #ifndef ROCKSDB_LITE + + namespace ROCKSDB_NAMESPACE { +diff --git a/utilities/cassandra/serialize.h b/utilities/cassandra/serialize.h +index cd980ade0..8f50a02dd 100644 +--- a/utilities/cassandra/serialize.h ++++ b/utilities/cassandra/serialize.h +@@ -10,6 +10,11 @@ + + #pragma once + ++#include ++#include ++ ++#include "rocksdb/rocksdb_namespace.h" ++ + namespace ROCKSDB_NAMESPACE { + namespace cassandra { + namespace {