[meta-oe][PATCH v2 1/2] protobuf: 3.19.4 -> 3.21.5 upgrade


Vyacheslav Yurkov
 

From: Vyacheslav Yurkov <Vyacheslav.Yurkov@...>

Drop the patch that was accepted upstream

Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@...>
---
.../0001-Fix-linking-error-with-ld-gold.patch | 6 +-
...r-init-prio-for-extension-attributes.patch | 79 -------------------
...ude-descriptor.cc-when-building-libp.patch | 8 +-
...e-respect-CXX-LDFLAGS-variables-fix-.patch | 10 +--
.../0001-protobuf-fix-configure-error.patch | 10 +--
...{protobuf_3.19.4.bb => protobuf_3.21.5.bb} | 5 +-
6 files changed, 16 insertions(+), 102 deletions(-)
delete mode 100644 meta-oe/recipes-devtools/protobuf/protobuf/0001-Lower-init-prio-for-extension-attributes.patch
rename meta-oe/recipes-devtools/protobuf/{protobuf_3.19.4.bb => protobuf_3.21.5.bb} (95%)

diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-linking-error-with-ld-gold.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-linking-error-with-ld-gold.patch
index 488c1f6ff..2bcb13873 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-linking-error-with-ld-gold.patch
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-linking-error-with-ld-gold.patch
@@ -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@...>
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
-
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Lower-init-prio-for-extension-attributes.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Lower-init-prio-for-extension-attributes.patch
deleted file mode 100644
index a1200e01c..000000000
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Lower-init-prio-for-extension-attributes.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 8ff34dbff1eac612326b492d0b2cb93901ad7e2b Mon Sep 17 00:00:00 2001
-From: Jani Nurminen <jani.nurminen@...>
-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@...>
-
-Rebase on master
-
-Signed-off-by: He Zhe <zhe.he@...>
----
- 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
-
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch
index bd3a277a3..59d43072c 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch
@@ -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@...>
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@...>
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 \
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch
index 934c98193..36c3c597a 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch
@@ -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@...>
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@...>
Signed-off-by: Leon Anavi <leon.anavi@...>
+
---
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
-
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch
index a2f7a4b77..7c87dbe26 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch
@@ -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@...>
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@...>
+
---
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
-
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.19.4.bb b/meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb
similarity index 95%
rename from meta-oe/recipes-devtools/protobuf/protobuf_3.19.4.bb
rename to meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb
index 566233084..a8828ec40 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_3.19.4.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb
@@ -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 "
--
2.25.1

Join {openembedded-devel@lists.openembedded.org to automatically receive all group messages.