From e110d8dcc450a8e50a5e7d9ccdb61ddb5b618c8f Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Tue, 2 Dec 2025 09:59:30 +0100 Subject: [PATCH] Update externals to build with gcc14 --- abseil-cpp.spec | 2 +- bazel-absl.patch | 10 ++--- clhep.spec | 7 ++-- dd4hep.spec | 2 +- grpc-cpp23.patch | 11 ++++++ grpc-no-aligned-storage.patch | 70 +++++++++++++++++++++++++++++++++++ grpc-no-std-iterator.patch | 43 +++++++++++++++++++++ grpc.spec | 6 +++ libfabric.spec | 1 + tensorflow-absl-src.patch | 15 -------- tensorflow-sources.file | 2 +- tensorflow-sources.spec | 2 +- 12 files changed, 144 insertions(+), 27 deletions(-) create mode 100644 grpc-cpp23.patch create mode 100644 grpc-no-aligned-storage.patch create mode 100644 grpc-no-std-iterator.patch delete mode 100644 tensorflow-absl-src.patch diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 3ed304133db..49a7e73b588 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -1,4 +1,4 @@ -### RPM external abseil-cpp 20220623.1 +### RPM external abseil-cpp 20230802.3 ## INCLUDE cpp-standard Source: https://github.com/abseil/abseil-cpp/archive/%{realversion}.tar.gz diff --git a/bazel-absl.patch b/bazel-absl.patch index 5d69389e3b5..d020e269a85 100644 --- a/bazel-absl.patch +++ b/bazel-absl.patch @@ -6,20 +6,20 @@ "com_google_absl": { - "archive": "20211102.0.tar.gz", - "sha256": "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4", -+ "archive": "20230125.3.tar.gz", -+ "sha256": "5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36", ++ "archive": "20230802.3.tar.gz", ++ "sha256": "052d1384266a3da0a4d16b644d7f9c4c2bfec4855720ac988a9407aebc06a3d8", "urls": [ - "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz", - "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz", -+ "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.tar.gz", -+ "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.tar.gz", ++ "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/refs/tags/20230802.3.tar.gz", ++ "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.3.tar.gz", ], "used_in": [ "additional_distfiles", "test_WORKSPACE_files", ], - "strip_prefix": "abseil-cpp-20211102.0", -+ "strip_prefix": "abseil-cpp-20230125.3", ++ "strip_prefix": "abseil-cpp-20230802.3", }, "zstd-jni": { "archive": "v1.5.0-4.zip", diff --git a/clhep.spec b/clhep.spec index a383f1e118d..8fff13a71bb 100644 --- a/clhep.spec +++ b/clhep.spec @@ -1,6 +1,6 @@ -### RPM external clhep 2.4.7.1 +### RPM external clhep 2.4.7.2 ## INCLUDE cpp-standard -%define tag d5f0b7af1c3231ca63887ecaa9500e1b02c6b0fe +%define tag fa41009631cf8ec83eb4f2de65af461f5818a52f %define branch cms/v%{realversion} %define github_user cms-externals Source: git+https://github.com/%github_user/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz @@ -19,7 +19,8 @@ cmake ../%{n}-%{realversion} \ -G Ninja \ -DCLHEP_BUILD_CXXSTD="-std=c++%{cms_cxx_standard}" \ -DCMAKE_INSTALL_PREFIX:PATH="%i" \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCLHEP_BUILD_STATIC_LIBS=OFF ninja -v %{makeprocesses} diff --git a/dd4hep.spec b/dd4hep.spec index ff45fbcc4c8..871e76195b2 100644 --- a/dd4hep.spec +++ b/dd4hep.spec @@ -1,5 +1,5 @@ ### RPM external dd4hep v01-31-0x -%define tag 4990888b50e29a5dc0ff65fc3a6fdf17205192a5 +%define tag 74155cec308e842fba19cc21e01165a4553bba47 %define branch master %define github_user AIDASoft diff --git a/grpc-cpp23.patch b/grpc-cpp23.patch new file mode 100644 index 00000000000..8aa3ea1de0e --- /dev/null +++ b/grpc-cpp23.patch @@ -0,0 +1,11 @@ +--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc.orig 2025-11-27 10:34:29.305947885 +0100 ++++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc 2025-11-27 10:34:40.604302735 +0100 +@@ -148,7 +148,7 @@ + // to use for LRS load reporting. Caller must ensure that config_ is set + // before calling. + std::pair GetLrsClusterKey() const { +- if (!parent_->is_xds_uri_) return {parent_->server_name_, nullptr}; ++ if (!parent_->is_xds_uri_) return {parent_->server_name_, {}}; + return { + parent_->config_->discovery_mechanisms()[index_].cluster_name, + parent_->config_->discovery_mechanisms()[index_].eds_service_name}; diff --git a/grpc-no-aligned-storage.patch b/grpc-no-aligned-storage.patch new file mode 100644 index 00000000000..f01177fb2fd --- /dev/null +++ b/grpc-no-aligned-storage.patch @@ -0,0 +1,70 @@ +diff --git a/include/grpcpp/impl/codegen/server_context.h b/include/grpcpp/impl/codegen/server_context.h +index 5a62873ec8..46b797c814 100644 +--- a/include/grpcpp/impl/codegen/server_context.h ++++ b/include/grpcpp/impl/codegen/server_context.h +@@ -513,8 +513,7 @@ class ServerContextBase { + const std::function func_; + }; + +- typename std::aligned_storage::type +- default_reactor_; ++ alignas(Reactor) std::byte default_reactor_[sizeof(Reactor)]; + std::atomic_bool default_reactor_used_{false}; + std::unique_ptr test_unary_; + }; +diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/src/core/ext/filters/http/message_compress/message_compress_filter.cc +index 09c914fab0..88d92210ef 100644 +--- a/src/core/ext/filters/http/message_compress/message_compress_filter.cc ++++ b/src/core/ext/filters/http/message_compress/message_compress_filter.cc +@@ -164,9 +164,7 @@ class CallData { + grpc_linked_mdelem accept_stream_encoding_storage_; + grpc_slice_buffer slices_; /**< Buffers up input slices to be compressed */ + // Allocate space for the replacement stream +- std::aligned_storage::type +- replacement_stream_; ++ alignas(grpc_core::SliceBufferByteStream) std::byte replacement_stream_[sizeof(grpc_core::SliceBufferByteStream)]; + grpc_closure* original_send_message_on_complete_ = nullptr; + grpc_closure send_message_on_complete_; + grpc_closure on_send_message_next_done_; +diff --git a/src/core/ext/filters/http/message_compress/message_decompress_filter.cc b/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +index 4ab8a5638c..0c8dc75567 100644 +--- a/src/core/ext/filters/http/message_compress/message_decompress_filter.cc ++++ b/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +@@ -123,9 +123,7 @@ class CallData { + // It is initialized during construction and reset when a new stream is + // created using it. + grpc_slice_buffer recv_slices_; +- std::aligned_storage::type +- recv_replacement_stream_; ++ alignas(SliceBufferByteStream) std::byte recv_replacement_stream_[sizeof(SliceBufferByteStream)]; + // Fields for handling recv_trailing_metadata_ready callback + bool seen_recv_trailing_metadata_ready_ = false; + grpc_closure on_recv_trailing_metadata_ready_; +diff --git a/src/core/lib/gprpp/manual_constructor.h b/src/core/lib/gprpp/manual_constructor.h +index 7ee13796ee..2a5d40e964 100644 +--- a/src/core/lib/gprpp/manual_constructor.h ++++ b/src/core/lib/gprpp/manual_constructor.h +@@ -159,10 +159,8 @@ class PolymorphicManualConstructor { + GPR_ASSERT(static_cast(p) == p); + } + +- typename std::aligned_storage< +- grpc_core::manual_ctor_impl::max_size_of::value, +- grpc_core::manual_ctor_impl::max_align_of::value>::type +- space_; ++ alignas(grpc_core::manual_ctor_impl::max_align_of::value) ++ std::byte space_[grpc_core::manual_ctor_impl::max_size_of::value]; + }; + + template +@@ -205,7 +203,7 @@ class ManualConstructor { + void Destroy() { get()->~Type(); } + + private: +- typename std::aligned_storage::type space_; ++ alignas(Type) std::byte space_[sizeof(Type)]; + }; + + } // namespace grpc_core diff --git a/grpc-no-std-iterator.patch b/grpc-no-std-iterator.patch new file mode 100644 index 00000000000..70de5683ede --- /dev/null +++ b/grpc-no-std-iterator.patch @@ -0,0 +1,43 @@ +diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h +index c9fc1429ac..0b575c7d0c 100644 +--- a/src/core/ext/filters/client_channel/lb_policy.h ++++ b/src/core/ext/filters/client_channel/lb_policy.h +@@ -133,25 +133,28 @@ class LoadBalancingPolicy : public InternallyRefCounted { + /// Implemented by the client channel and used by the SubchannelPicker. + class MetadataInterface { + public: +- class iterator +- : public std::iterator< +- std::input_iterator_tag, +- std::pair, // value_type +- std::ptrdiff_t, // difference_type +- std::pair*, // pointer +- std::pair& // reference +- > { ++ class iterator { + public: ++ using iterator_category = std::input_iterator_tag; ++ using value_type = std::pair; ++ using difference_type = std::ptrdiff_t; ++ using pointer = value_type*; ++ using reference = value_type&; ++ + iterator(const MetadataInterface* md, intptr_t handle) + : md_(md), handle_(handle) {} ++ + iterator& operator++() { + handle_ = md_->IteratorHandleNext(handle_); + return *this; + } +- bool operator==(iterator other) const { ++ ++ bool operator==(const iterator& other) const { + return md_ == other.md_ && handle_ == other.handle_; + } +- bool operator!=(iterator other) const { return !(*this == other); } ++ ++ bool operator!=(const iterator& other) const { return !(*this == other); } ++ + value_type operator*() const { return md_->IteratorHandleGet(handle_); } + + private: diff --git a/grpc.spec b/grpc.spec index 553cf2ded32..7b2aec4bbcc 100644 --- a/grpc.spec +++ b/grpc.spec @@ -4,6 +4,9 @@ Source: git+https://github.com/grpc/grpc.git?obj=master/v%{realversion}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz Source1: https://patch-diff.githubusercontent.com/raw/grpc/grpc/pull/28212.patch Patch1: grpc-mno-outline-atomics +Patch2: grpc-no-aligned-storage +Patch3: grpc-no-std-iterator +Patch4: grpc-cpp23 BuildRequires: cmake ninja go Requires: protobuf zlib pcre c-ares abseil-cpp re2 %define keep_archives true @@ -13,6 +16,9 @@ Requires: protobuf zlib pcre c-ares abseil-cpp re2 %setup -n %{n}-%{realversion} patch -p1 <%{_sourcedir}/28212.patch %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build rm -rf ../build diff --git a/libfabric.spec b/libfabric.spec index 83cf31a6c09..17cc4441180 100644 --- a/libfabric.spec +++ b/libfabric.spec @@ -6,6 +6,7 @@ Requires: curl Requires: numactl Requires: rdma-core Requires: xpmem +BuildRequires: autotools %prep %setup -q -n %{n}-%{realversion} diff --git a/tensorflow-absl-src.patch b/tensorflow-absl-src.patch deleted file mode 100644 index 2f9c65cdd25..00000000000 --- a/tensorflow-absl-src.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/third_party/absl/workspace.bzl b/third_party/absl/workspace.bzl -index 183bb7f..5783c67 100644 ---- a/third_party/absl/workspace.bzl -+++ b/third_party/absl/workspace.bzl -@@ -6,8 +6,8 @@ def repo(): - """Imports absl.""" - - # Attention: tools parse and update these lines. -- ABSL_COMMIT = "997aaf3a28308eba1b9156aa35ab7bca9688e9f6" -- ABSL_SHA256 = "35f22ef5cb286f09954b7cc4c85b5a3f6221c9d4df6b8c4a1e9d399555b366ee" -+ ABSL_COMMIT = "215105818dfde3174fe799600bb0f3cae233d0bf" -+ ABSL_SHA256 = "237e2e6aec7571ae90d961d02de19f56861a7417acbbc15713b8926e39d461ed" - - tf_http_archive( - name = "com_google_absl", diff --git a/tensorflow-sources.file b/tensorflow-sources.file index 9a22c68f804..098608aafaa 100644 --- a/tensorflow-sources.file +++ b/tensorflow-sources.file @@ -14,7 +14,7 @@ BuildRequires: bazel java-env git %endif #Set cms_cxx_standard to 17 as LLVM downloaded by TF does not build with c++20 -%if "%{cms_cxx_standard}" == "20" +%if "%{cms_cxx_standard}" == "20" || "%{cms_cxx_standard}" == "23" %undefine cms_cxx_standard %define cms_cxx_standard 17 %endif diff --git a/tensorflow-sources.spec b/tensorflow-sources.spec index 296a6707e2d..32bc7149f08 100644 --- a/tensorflow-sources.spec +++ b/tensorflow-sources.spec @@ -1,5 +1,5 @@ ### RPM external tensorflow-sources 2.12.0 -%define tag 4a22f3b460370aa5b1c60579104cd103e8f0d6bb +%define tag 655018dbd1d31b23e0c45cae82ba5a6b42254ab0 %define branch cms/v%{realversion} %define github_user cms-externals %define python_cmd python3