From b26df6bb84a6645d9f43a85c1487b8883413f36b98855478eb9824a6b6e52b78 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 12 Jun 2023 20:33:13 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/protobuf?expand=0&rev=153 --- gcc12-disable-__constinit-with-c++-11.patch | 16 ++++++++++++++++ protobuf.spec | 1 + 2 files changed, 17 insertions(+) create mode 100644 gcc12-disable-__constinit-with-c++-11.patch diff --git a/gcc12-disable-__constinit-with-c++-11.patch b/gcc12-disable-__constinit-with-c++-11.patch new file mode 100644 index 0000000..ff6c0c0 --- /dev/null +++ b/gcc12-disable-__constinit-with-c++-11.patch @@ -0,0 +1,16 @@ +Index: protobuf-21.4/src/google/protobuf/port_def.inc +=================================================================== +--- protobuf-21.4.orig/src/google/protobuf/port_def.inc ++++ protobuf-21.4/src/google/protobuf/port_def.inc +@@ -652,7 +652,11 @@ + #define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]] + #define PROTOBUF_CONSTEXPR constexpr + #elif PROTOBUF_GNUC_MIN(12, 2) ++#if PROTOBUF_CPLUSPLUS_MIN(201703L) + #define PROTOBUF_CONSTINIT __constinit ++#else ++#define PROTOBUF_CONSTINIT ++#endif + #define PROTOBUF_CONSTEXPR constexpr + // MSVC 17 currently seems to raise an error about constant-initialized pointers. + #elif defined(_MSC_VER) && _MSC_VER >= 1930 diff --git a/protobuf.spec b/protobuf.spec index e2e70c6..128576d 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -40,6 +40,7 @@ Source0: https://github.com/protocolbuffers/protobuf/archive/v%{version}. Source1: manifest.txt.in Source2: baselibs.conf Source1000: %{name}-rpmlintrc +Patch0: gcc12-disable-__constinit-with-c++-11.patch Patch1: add-missing-stdint-header.patch BuildRequires: %{python_module abseil} BuildRequires: %{python_module devel}