protobuf: 3.19.4 -> 3.21.5 upgrade

Drop the patch that was accepted upstream
Forward port clang-mips patch

Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Vyacheslav Yurkov
2022-08-26 08:59:22 +02:00
committed by Khem Raj
parent 8eb1905780
commit 61e3493c53
7 changed files with 22 additions and 114 deletions
@@ -14,19 +14,13 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
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 71325c387..303475232 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -230,7 +230,7 @@
@@ -255,6 +255,7 @@
#error PROTOBUF_TAILCALL was previously defined
#endif
#if __has_cpp_attribute(clang::musttail) && \
- !defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__)
+ !defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__) && !defined(__mips__)
# ifndef PROTO2_OPENSOURCE
// Compilation fails on ARM32: b/195943306
// Compilation fails on powerpc64le: b/187985113
--
2.33.1
#if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \
+ !defined(__mips__) && \
!defined(_ARCH_PPC) && !defined(__wasm__) && \
!(defined(_MSC_VER) && defined(_M_IX86)) && \
!(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24)
@@ -1,4 +1,4 @@
From ddb9c5147883f8b27b4205450139e4a115d9961f Mon Sep 17 00:00:00 2001
From a91130bb95528743a3f7253f8fe945b7505047d5 Mon Sep 17 00:00:00 2001
From: Kyungjik Min <dp.min@lge.com>
Date: Mon, 28 Dec 2020 15:56:09 +0900
Subject: [PATCH] Fix linking error with ld-gold
@@ -19,6 +19,7 @@ N/A
:Issues Addressed:
[PLAT-130467] Fix build error for libgoogleassistant with latest
protobuf-3.11.4
---
src/libprotobuf-lite.map | 2 ++
src/libprotobuf.map | 2 ++
@@ -64,6 +65,3 @@ index 391554669..a1853ca6c 100644
local:
*;
--
2.17.1
@@ -1,79 +0,0 @@
From 8ff34dbff1eac612326b492d0b2cb93901ad7e2b Mon Sep 17 00:00:00 2001
From: Jani Nurminen <jani.nurminen@windriver.com>
Date: Fri, 24 Sep 2021 09:56:11 +0200
Subject: [PATCH] Lower init prio for extension attributes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Added PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY in
code generation for extension attributes.
It has lower prio than PROTOBUF_ATTRIBUTE_INIT_PRIORITY to
ensure that extension attributes are initialized after
other attribute.
This is needed in some applications to avoid segmentation fault.
Reported by Karl-Herman Näslund.
Signed-off-by: Jani Nurminen <jani.nurminen@windriver.com>
Rebase on master
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
src/google/protobuf/compiler/cpp/cpp_extension.cc | 2 +-
src/google/protobuf/port_def.inc | 12 ++++++++++++
src/google/protobuf/port_undef.inc | 1 +
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/google/protobuf/compiler/cpp/cpp_extension.cc b/src/google/protobuf/compiler/cpp/cpp_extension.cc
index 8604da5f2..984345ebe 100644
--- a/src/google/protobuf/compiler/cpp/cpp_extension.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_extension.cc
@@ -164,7 +164,7 @@ void ExtensionGenerator::GenerateDefinition(io::Printer* printer) {
}
format(
- "PROTOBUF_ATTRIBUTE_INIT_PRIORITY "
+ "PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY "
"::$proto_ns$::internal::ExtensionIdentifier< $extendee$,\n"
" ::$proto_ns$::internal::$type_traits$, $field_type$, $packed$ >\n"
" $scoped_name$($constant_name$, $1$);\n",
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 7e9119112..a5117090d 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -614,6 +614,18 @@
#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY
#endif
+// Some embedded systems get a segmentation fault if extension attributes are
+// initialized with higher or equal priority as other attributes. This gives
+// extension attributes high priority, but lower than other attributes.
+#ifdef PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY
+#error PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY was previously defined
+#endif
+#if PROTOBUF_GNUC_MIN(3, 0) && (!defined(__APPLE__) || defined(__clang__)) && !((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))
+#define PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY __attribute__((init_priority((103))))
+#else
+#define PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY
+#endif
+
#ifdef PROTOBUF_PRAGMA_INIT_SEG
#error PROTOBUF_PRAGMA_INIT_SEG was previously defined
#endif
diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc
index ccc5daf56..2b28f3a31 100644
--- a/src/google/protobuf/port_undef.inc
+++ b/src/google/protobuf/port_undef.inc
@@ -83,6 +83,7 @@
#undef PROTOBUF_HAVE_ATTRIBUTE_WEAK
#undef PROTOBUF_ATTRIBUTE_NO_DESTROY
#undef PROTOBUF_ATTRIBUTE_INIT_PRIORITY
+#undef PROTOBUF_EXTENSION_ATTRIBUTE_INIT_PRIORITY
#undef PROTOBUF_PRAGMA_INIT_SEG
#undef PROTOBUF_ASAN
#undef PROTOBUF_MSAN
--
2.26.2
@@ -1,4 +1,4 @@
From 8515ceec5ba3e2fcdbc819b5bf10fe742d7c9d5d Mon Sep 17 00:00:00 2001
From 76980e1c84374e8bfa4dffcca78c5050783e83b9 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 27 Jun 2019 13:27:18 +0000
Subject: [PATCH] Makefile.am: include descriptor.pb.cc when building
@@ -17,14 +17,14 @@ Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
1 file changed, 1 insertion(+)
diff --git a/src/Makefile.am b/src/Makefile.am
index d4f11ce79..96d911746 100644
index e6a7dc7fd..6b0fe6686 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -323,6 +323,7 @@ libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
@@ -326,6 +326,7 @@ libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
endif
libprotoc_la_SOURCES = \
+ google/protobuf/descriptor.pb.cc \
google/protobuf/compiler/code_generator.cc \
google/protobuf/compiler/command_line_interface.cc \
google/protobuf/compiler/cpp/cpp_enum.cc \
google/protobuf/compiler/cpp/enum.cc \
@@ -1,4 +1,4 @@
From e5340f816aa273cfda36998466739ca0748caafb Mon Sep 17 00:00:00 2001
From e3fa241637ab5a7fa78c0d474802134cff75f91e Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Fri, 28 Jun 2019 13:50:52 +0000
Subject: [PATCH] examples/Makefile: respect CXX,LDFLAGS variables, fix build
@@ -24,12 +24,13 @@ Subject: [PATCH] examples/Makefile: respect CXX,LDFLAGS variables, fix build
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
examples/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/examples/Makefile b/examples/Makefile
index e9f9635ae..b2fbe2de1 100644
index 1c7ec8d63..85f591231 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -2,6 +2,8 @@
@@ -41,7 +42,7 @@ index e9f9635ae..b2fbe2de1 100644
all: cpp java python
cpp: add_person_cpp list_people_cpp
@@ -41,11 +43,11 @@ protoc_middleman_dart: addressbook.proto
@@ -40,11 +42,11 @@ protoc_middleman_dart: addressbook.proto
add_person_cpp: add_person.cc protoc_middleman
pkg-config --cflags protobuf # fails if protobuf is not installed
@@ -55,6 +56,3 @@ index e9f9635ae..b2fbe2de1 100644
add_person_dart: add_person.dart protoc_middleman_dart
--
2.17.1
@@ -1,4 +1,4 @@
From 52959e8e01e39139d18f752e97283e45b4b7a426 Mon Sep 17 00:00:00 2001
From 2649fe191ad3f086274a9bf1520212a4c715c944 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Wed, 18 Jul 2018 17:52:34 +0800
Subject: [PATCH] protobuf: fix configure error
@@ -12,15 +12,16 @@ caused by missing submodule googletest.
Upstream-Status: Inappropriate [oe-specific]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.ac | 1 -
1 file changed, 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index aec10cf..7fbe57d 100644
index 375a79d93..1d73cd73f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,7 +214,6 @@ AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
@@ -241,7 +241,6 @@ AC_SUBST([LIBLOG_LIBS])
# too.
export CFLAGS
export CXXFLAGS
@@ -28,6 +29,3 @@ index aec10cf..7fbe57d 100644
AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
AC_OUTPUT
--
2.7.4
@@ -10,15 +10,14 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b"
DEPENDS = "zlib"
DEPENDS:append:class-target = " protobuf-native"
SRCREV = "22d0e265de7d2b3d2e9a00d071313502e7d4cccf"
SRCREV = "ab840345966d0fa8e7100d771c92a73bfbadd25c"
SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=3.19.x;protocol=https \
SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=21.x;protocol=https \
file://run-ptest \
file://0001-protobuf-fix-configure-error.patch \
file://0001-Makefile.am-include-descriptor.cc-when-building-libp.patch \
file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
file://0001-Fix-linking-error-with-ld-gold.patch \
file://0001-Lower-init-prio-for-extension-attributes.patch \
"
SRC_URI:append:mips:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "