summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/protobuf
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2025-03-21 13:34:14 +0800
committerKhem Raj <raj.khem@gmail.com>2025-03-21 11:07:33 -0700
commitd9daf66b11dab5bb3806404a9f0cc266645f80ca (patch)
tree788b5324510656b21ac95f4bdf77114a98dc596e /meta-oe/recipes-devtools/protobuf
parenteee1e11a4deb39f7af7c43efede7bd8aff2cb258 (diff)
downloadmeta-openembedded-d9daf66b11dab5bb3806404a9f0cc266645f80ca.tar.gz
protobuf: 4.25.5 -> 5.29.4
Refresh local patches - 0001-Fix-build-on-mips-clang.patch - 0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch Fix protobuf-native build failure with gcc 10 Fix dev-elf QA issue: |ERROR: protobuf-5.29.4-r0 do_package_qa: QA Issue: -dev package protobuf-dev contains non-symlink .so '/usr/lib/libutf8_range.so' [dev-elf] |ERROR: protobuf-5.29.4-r0 do_package_qa: QA Issue: -dev package protobuf-dev contains non-symlink .so '/usr/lib/libutf8_validity.so' [dev-elf] Changelog: https://github.com/protocolbuffers/protobuf/releases/tag/v29.4 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/protobuf')
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch26
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch31
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf/0001-fix-protobuf-native-build-failure-with-gcc-10.patch46
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf/0001-utf8_range-add-version-marker-to-library-19009.patch43
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb (renamed from meta-oe/recipes-devtools/protobuf/protobuf_4.25.5.bb)6
5 files changed, 126 insertions, 26 deletions
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch
index 9f6116c4c4..1e0d04dc8d 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch
@@ -1,6 +1,6 @@
1From 08e46feb6553af670754e65d94c3bb6fcd4e0cf9 Mon Sep 17 00:00:00 2001 1From cd6c5f36c0dc38e4734b74b03923489b7bfb9aba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 31 Oct 2021 23:39:44 -0700 3Date: Mon, 10 Mar 2025 19:59:19 -0700
4Subject: [PATCH] Fix build on mips/clang 4Subject: [PATCH] Fix build on mips/clang
5 5
6clang13 crashes on mips, until its fixed upstream disable tailcall on 6clang13 crashes on mips, until its fixed upstream disable tailcall on
@@ -10,17 +10,25 @@ https://bugs.llvm.org/show_bug.cgi?id=52367
10 10
11Upstream-Status: Inappropriate [Clang workaround] 11Upstream-Status: Inappropriate [Clang workaround]
12Signed-off-by: Khem Raj <raj.khem@gmail.com> 12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13
14Rebase to v5.29.4
15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
13--- 16---
14 src/google/protobuf/port_def.inc | 2 +- 17 src/google/protobuf/port_def.inc | 1 +
15 1 file changed, 1 insertion(+), 1 deletion(-) 18 1 file changed, 1 insertion(+)
16 19
20diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
21index 56f995e45..428d096b3 100644
17--- a/src/google/protobuf/port_def.inc 22--- a/src/google/protobuf/port_def.inc
18+++ b/src/google/protobuf/port_def.inc 23+++ b/src/google/protobuf/port_def.inc
19@@ -255,6 +255,7 @@ 24@@ -227,6 +227,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
20 #error PROTOBUF_TAILCALL was previously defined 25 #error PROTOBUF_TAILCALL was previously defined
21 #endif 26 #endif
22 #if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \ 27 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::musttail) && !defined(__arm__) && \
23+ !defined(__mips__) && \ 28+ !defined(__mips__) && \
24 !defined(_ARCH_PPC) && !defined(__wasm__) && \ 29 !defined(_ARCH_PPC) && !defined(__wasm__) && \
25 !(defined(_MSC_VER) && defined(_M_IX86)) && \ 30 !(defined(_MSC_VER) && defined(_M_IX86)) && !defined(__i386__)
26 !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) 31 // Compilation fails on ARM32: b/195943306
32--
332.25.1
34
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 7c4bf260eb..7a8906a9a4 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,13 +1,12 @@
1From e3fa241637ab5a7fa78c0d474802134cff75f91e Mon Sep 17 00:00:00 2001 1From f6a3554e37fb39f93e4b47a75318bbda53cfdb46 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com> 2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 28 Jun 2019 13:50:52 +0000 3Date: Thu, 20 Mar 2025 20:33:02 -0700
4Subject: [PATCH] examples/Makefile: respect CXX,LDFLAGS variables, fix build 4Subject: [PATCH] examples/Makefile: respect CXX,LDFLAGS variables
5 with gold
6 5
7* move pkg-config call to separate variable, so that the final version 6* move pkg-config call to separate variable, so that the final version
8 of the whole command so it's shown in log.do_compile_ptest_base 7 of the whole command so it's shown in log.do_compile_ptest_base
9* add ../src/google/protobuf/.libs/timestamp.pb.o when linking 8* add ../src/google/protobuf/.libs/timestamp.pb.o when linking
10 add_person_cpp otherwise it fails to link with gold: 9 add_person_cpp otherwise it fails:
11 i686-oe-linux-g++ -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` 10 i686-oe-linux-g++ -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf`
12 /tmp/cccjSJQs.o:addressbook.pb.cc:scc_info_Person_addressbook_2eproto: error: undefined reference to 'scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto' 11 /tmp/cccjSJQs.o:addressbook.pb.cc:scc_info_Person_addressbook_2eproto: error: undefined reference to 'scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto'
13 /tmp/cccjSJQs.o:addressbook.pb.cc:descriptor_table_addressbook_2eproto_deps: error: undefined reference to 'descriptor_table_google_2fprotobuf_2ftimestamp_2eproto' 12 /tmp/cccjSJQs.o:addressbook.pb.cc:descriptor_table_addressbook_2eproto_deps: error: undefined reference to 'descriptor_table_google_2fprotobuf_2ftimestamp_2eproto'
@@ -25,37 +24,39 @@ Upstream-Status: Pending
25Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> 24Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
26Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> 25Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
27 26
27Rebase to 5.29.4
28Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
28--- 29---
29 examples/Makefile | 6 ++++-- 30 examples/Makefile | 6 ++++--
30 1 file changed, 4 insertions(+), 2 deletions(-) 31 1 file changed, 4 insertions(+), 2 deletions(-)
31 32
32diff --git a/examples/Makefile b/examples/Makefile 33diff --git a/examples/Makefile b/examples/Makefile
33index ef7a4ef58..7206e14e1 100644 34index f7ee9b116..8cd1359e2 100644
34--- a/examples/Makefile 35--- a/examples/Makefile
35+++ b/examples/Makefile 36+++ b/examples/Makefile
36@@ -2,6 +2,8 @@ 37@@ -4,6 +4,8 @@
37 38
38 .PHONY: all cpp java python clean 39 all: cpp java python
39 40
40+PROTOBUF := $(shell pkg-config --cflags --libs protobuf) 41+PROTOBUF := $(shell pkg-config --cflags --libs protobuf)
41+ 42+
42 all: cpp java python
43
44 cpp: add_person_cpp list_people_cpp 43 cpp: add_person_cpp list_people_cpp
45@@ -41,11 +43,11 @@ protoc_middleman_dart: addressbook.proto 44 dart: add_person_dart list_people_dart
45 go: add_person_go list_people_go
46@@ -46,11 +48,11 @@ protoc_middleman_ruby: addressbook.proto
46 47
47 add_person_cpp: add_person.cc protoc_middleman 48 add_person_cpp: add_person.cc protoc_middleman
48 pkg-config --cflags protobuf # fails if protobuf is not installed 49 pkg-config --cflags protobuf # fails if protobuf is not installed
49- c++ -std=c++14 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` 50- c++ -std=c++14 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf`
50+ $(CXX) $(CXXFLAGS) $(LDFLAGS) ../src/google/protobuf/.libs/timestamp.pb.o $(PROTOBUF) add_person.cc addressbook.pb.cc -o add_person_cpp #$(CXX) -std=c++17 $(PROTOBUF) add_person.cc addressbook.pb.cc -o add_person_cpp 51+ $(CXX) $(CXXFLAGS) $(LDFLAGS) ../src/google/protobuf/.libs/timestamp.pb.o $(PROTOBUF) add_person.cc addressbook.pb.cc -o add_person_cpp
51 52
52 list_people_cpp: list_people.cc protoc_middleman 53 list_people_cpp: list_people.cc protoc_middleman
53 pkg-config --cflags protobuf # fails if protobuf is not installed 54 pkg-config --cflags protobuf # fails if protobuf is not installed
54- c++ -std=c++14 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf` 55- c++ -std=c++14 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf`
55+ $(CXX) $(CXXFLAGS) $(LDFLAGS) ../src/google/protobuf/.libs/timestamp.pb.o $(PROTOBUF) list_people.cc addressbook.pb.cc -o list_people_cpp #$(CXX) -std=c++17 $(PROTOBUF) list_people.cc addressbook.pb.cc -o list_people_cpp 56+ $(CXX) $(CXXFLAGS) $(LDFLAGS) ../src/google/protobuf/.libs/timestamp.pb.o $(PROTOBUF) list_people.cc addressbook.pb.cc -o list_people_cpp
56 57
57 add_person_dart: add_person.dart protoc_middleman_dart 58 add_person_dart: add_person.dart protoc_middleman_dart
58 59
59-- 60--
602.34.1 612.25.1
61 62
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-fix-protobuf-native-build-failure-with-gcc-10.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-fix-protobuf-native-build-failure-with-gcc-10.patch
new file mode 100644
index 0000000000..2edba6b7eb
--- /dev/null
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-fix-protobuf-native-build-failure-with-gcc-10.patch
@@ -0,0 +1,46 @@
1From 213f29fb63473304db098b3d12a0393fd50e4914 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 17 Mar 2025 13:28:13 +0800
4Subject: [PATCH] fix protobuf-native build failure with gcc 10
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Build protobuf-native failed on ubuntu 20.04 which has gcc 10
10
11protobuf-native/4.30.0/git/src/google/protobuf/port_def.inc:105:48:
12error: static assertion failed: Protobuf only supports C+
13 ↪ +17 and newer.
14 | 105 | #define PROTOBUF_CPLUSPLUS_MIN(x) (__cplusplus >= x)
15 | | ~~~~~~~~~~~~~^~~~~
16 | /home/kraj01/yoe/build/tmp/work/x86_64-linux/protobuf-native/4.30.0/git/src/google/protobuf/port_def.inc:119:15:
17note: in expansion of macro ‘PROTOBUF_CPLUSPLUS_MIN’
18 | 119 | static_assert(PROTOBUF_CPLUSPLUS_MIN(201703L),
19 | | ^~~~~~~~~~~~~~~~~~~~~~
20
21Upstream-Status: Pending
22
23Signed-off-by: Khem Raj <raj.khem@gmail.com>
24Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
25---
26 CMakeLists.txt | 4 ++++
27 1 file changed, 4 insertions(+)
28
29diff --git a/CMakeLists.txt b/CMakeLists.txt
30index e90cb8aa2..3ffac1307 100644
31--- a/CMakeLists.txt
32+++ b/CMakeLists.txt
33@@ -14,6 +14,10 @@ endif()
34 # Project
35 project(protobuf C CXX)
36
37+set(CMAKE_CXX_STANDARD 17)
38+set(CMAKE_CXX_STANDARD_REQUIRED ON)
39+set(CMAKE_CXX_EXTENSIONS OFF)
40+
41 if(protobuf_DEPRECATED_CMAKE_SUBDIRECTORY_USAGE)
42 if(CMAKE_PROJECT_NAME STREQUAL "protobuf")
43 get_filename_component(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)
44--
452.25.1
46
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/0001-utf8_range-add-version-marker-to-library-19009.patch b/meta-oe/recipes-devtools/protobuf/protobuf/0001-utf8_range-add-version-marker-to-library-19009.patch
new file mode 100644
index 0000000000..e58fdc1d19
--- /dev/null
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-utf8_range-add-version-marker-to-library-19009.patch
@@ -0,0 +1,43 @@
1From fd020ef700dbf2d324aecd087b8fcb6ff329feb6 Mon Sep 17 00:00:00 2001
2From: Jan Engelhardt <jengelh@inai.de>
3Date: Thu, 21 Nov 2024 11:30:17 -0800
4Subject: [PATCH] utf8_range: add version marker to library (#19009)
5
6Unversioned libraries / libraries without due ABI indicators are not allowed in certain Linux distributions because it precludes the concurrent presence of multiple versions.
7
8If you have both /usr/lib/libprotobuf-lite.so.28.3.0 and /usr/lib/libprotobuf-lite.so.29.0.0, both of them want libutf8_validity.so, but if the ABI is different between utf8_range 28 and utf8_range 29, that's a problem.
9
10Closes #19009
11
12COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/19009 from jengelh:master 1a5f8682be2f2b84da07fcdd32474baae8088959
13PiperOrigin-RevId: 698855702
14
15Upstream-Status: Backport [https://github.com/protocolbuffers/protobuf/commit/ced605d0e6a7ad20985375b596b2ca6720e07737]
16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
17---
18 third_party/utf8_range/CMakeLists.txt | 9 +++++++++
19 1 file changed, 9 insertions(+)
20
21diff --git a/third_party/utf8_range/CMakeLists.txt b/third_party/utf8_range/CMakeLists.txt
22index 4276b97290..e054893c63 100644
23--- a/third_party/utf8_range/CMakeLists.txt
24+++ b/third_party/utf8_range/CMakeLists.txt
25@@ -19,6 +19,15 @@ add_library (utf8_range
26 # A heavier-weight C++ wrapper that supports Abseil.
27 add_library (utf8_validity utf8_validity.cc utf8_range.c)
28
29+set_target_properties(utf8_range PROPERTIES
30+ VERSION ${protobuf_VERSION}
31+ OUTPUT_NAME ${LIB_PREFIX}utf8_range
32+)
33+set_target_properties(utf8_validity PROPERTIES
34+ VERSION ${protobuf_VERSION}
35+ OUTPUT_NAME ${LIB_PREFIX}utf8_validity
36+)
37+
38 # Load Abseil dependency.
39 if (NOT TARGET absl::strings)
40 if (NOT ABSL_ROOT_DIR)
41--
422.34.1
43
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.5.bb b/meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb
index a470a7c643..777378369e 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.5.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_5.29.4.bb
@@ -14,11 +14,13 @@ LIC_FILES_CHKSUM = " \
14DEPENDS = "zlib abseil-cpp jsoncpp" 14DEPENDS = "zlib abseil-cpp jsoncpp"
15DEPENDS:append:class-target = " protobuf-native" 15DEPENDS:append:class-target = " protobuf-native"
16 16
17SRCREV = "9d0ec0f92b5b5fdeeda11f9dcecc1872ff378014" 17SRCREV = "1be1c9d0ea6efa2a25bd7b76186844d1669be78a"
18 18
19SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=25.x;protocol=https \ 19SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=29.x;protocol=https \
20 file://run-ptest \ 20 file://run-ptest \
21 file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \ 21 file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
22 file://0001-fix-protobuf-native-build-failure-with-gcc-10.patch \
23 file://0001-utf8_range-add-version-marker-to-library-19009.patch \
22 " 24 "
23SRC_URI:append:mips:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch " 25SRC_URI:append:mips:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
24SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch " 26SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "