summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2022-07-02 17:42:00 +0200
committer Matteo Bernardini2022-08-06 20:51:45 +0200
commita333594e7e82f2622034d53c74cb3e5a52f4d036 (patch)
treee316996c7afbaae9f97589e03286a57e9ca5c511
parentd01cfb721ca5becf618d7950779ea4a042c36ba9 (diff)
downloadslackbuilds-protobuf3.tar.gz
development/protobuf3: Upstream fix for a bug in gcc 12.1.protobuf3
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--development/protobuf3/gcc12.patch24
-rw-r--r--development/protobuf3/protobuf3.SlackBuild1
2 files changed, 25 insertions, 0 deletions
diff --git a/development/protobuf3/gcc12.patch b/development/protobuf3/gcc12.patch
new file mode 100644
index 0000000000..866977ecdb
--- /dev/null
+++ b/development/protobuf3/gcc12.patch
@@ -0,0 +1,24 @@
+From b180b2809f7e77fdf7dd075d26a7421085bac58f Mon Sep 17 00:00:00 2001
+From: Adam Cozzette <acozzette@google.com>
+Date: Mon, 9 May 2022 13:15:44 -0700
+Subject: [PATCH] Use __constinit only in GCC 12.2 and up (#9936)
+
+Fixes #9916. GCC appears to have a bug preventing our use of __constinit
+from working correctly, but this bug will be fixed in GCC 12.2.
+---
+ src/google/protobuf/port_def.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
+index dcb0ff758f..289a42674c 100644
+--- a/src/google/protobuf/port_def.inc
++++ b/src/google/protobuf/port_def.inc
+@@ -650,7 +650,7 @@
+ (!defined(__APPLE__) && __clang_major__ >= 12))
+ #define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
+ #define PROTOBUF_CONSTEXPR constexpr
+-#elif PROTOBUF_GNUC_MIN(12, 0)
++#elif PROTOBUF_GNUC_MIN(12, 2)
+ #define PROTOBUF_CONSTINIT __constinit
+ #define PROTOBUF_CONSTEXPR constexpr
+ #else
diff --git a/development/protobuf3/protobuf3.SlackBuild b/development/protobuf3/protobuf3.SlackBuild
index 0cef90a454..13395478c8 100644
--- a/development/protobuf3/protobuf3.SlackBuild
+++ b/development/protobuf3/protobuf3.SlackBuild
@@ -85,6 +85,7 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
patch -p1 < $CWD/protobuf3.patch
+patch -p1 < $CWD/gcc12.patch
./autogen.sh
CFLAGS="$SLKCFLAGS" \