protobuf: change build system to cmake
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 protobuf: change build system to cmake
From: Vyacheslav Yurkov <[email protected]>
Autotools support has been removed and replaced completely by CMake.
See related issues for details:
https://github.com/protocolbuffers/protobuf/issues/7911
https://github.com/protocolbuffers/protobuf/pull/10132
Drop autotools patches too.
--- ...ude-descriptor.cc-when-building-libp.patch | 30 ------------------ .../0001-protobuf-fix-configure-error.patch | 31 ------------------- .../protobuf/protobuf_3.21.5.bb | 25 ++++++++++----- 3 files changed, 18 insertions(+), 68 deletions(-) delete mode 100644 meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch delete mode 100644 meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch
meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch deleted +0 -30
@@ -1,30 +0,0 @@ -From 76980e1c84374e8bfa4dffcca78c5050783e83b9 Mon Sep 17 00:00:00 2001 -From: Martin Jansa <[email protected]> -Date: Thu, 27 Jun 2019 13:27:18 +0000 -Subject: [PATCH] Makefile.am: include descriptor.pb.cc when building - libprotoc.so - -* otherwise plugin.pb.o has undefined symbol scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto - and build with gold fails with: - core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot-native/usr/bin/i686-oe-linux/../../libexec/i686-oe-linux/gcc/i686-oe-linux/9.1.0/ld.bfd: ./.libs/libprotoc.so: undefined reference to `descriptor_table_google_2fprotobuf_2fdescriptor_2eproto' - core2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot-native/usr/bin/i686-oe-linux/../../libexec/i686-oe-linux/gcc/i686-oe-linux/9.1.0/ld.bfd: ./.libs/libprotoc.so: undefined reference to `scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto' - -Upstream-Status: Pending -Signed-off-by: Martin Jansa <[email protected]> - ---- - src/Makefile.am | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/Makefile.am b/src/Makefile.am -index e6a7dc7fd..6b0fe6686 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -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/enum.cc \
meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch deleted +0 -31
@@ -1,31 +0,0 @@ -From 2649fe191ad3f086274a9bf1520212a4c715c944 Mon Sep 17 00:00:00 2001 -From: Changqing Li <[email protected]> -Date: Wed, 18 Jul 2018 17:52:34 +0800 -Subject: [PATCH] protobuf: fix configure error - -fix below error: -gnu-configize: 'configure.ac' or 'configure.in' is required - -third_party/googletest is git submodule of protobuf. Above error -caused by missing submodule googletest. - -Upstream-Status: Inappropriate [oe-specific] - -Signed-off-by: Changqing Li <[email protected]> - ---- - configure.ac | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 375a79d93..1d73cd73f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -241,7 +241,6 @@ AC_SUBST([LIBLOG_LIBS]) - # too. - export CFLAGS - export CXXFLAGS --AC_CONFIG_SUBDIRS([third_party/googletest]) - - AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc]) - AC_OUTPUT
meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb +18 -7
@@ -14,8 +14,6 @@ SRCREV = "ab840345966d0fa8e7100d771c92a73bfbadd25c" 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 \ "
@@ -24,12 +22,19 @@ SRC_URI:append:mipsel:toolchain-clang = " file://0001-Fix-build-on-mips-clang.pa S = "${WORKDIR}/git" -inherit autotools-brokensep pkgconfig ptest +inherit cmake pkgconfig ptest PACKAGECONFIG ??= "" PACKAGECONFIG[python] = ",," -EXTRA_OECONF += "--with-protoc=echo" +EXTRA_OECMAKE += "\ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_BUILD_EXAMPLES=OFF \ +" +EXTRA_OECMAKE:append:class-target= "\ + -Dprotobuf_BUILD_PROTOC_BINARIES=OFF \ + -Dprotobuf_BUILD_SHARED_LIBS=ON \ +" TEST_SRC_DIR = "examples" LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
@@ -40,9 +45,15 @@ do_compile_ptest() { # Add the location of the cross-compiled header and library files # which haven't been installed yet. cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc" + cp ${S}/${TEST_SRC_DIR}/*.cc "${B}/${TEST_SRC_DIR}/" + cp ${S}/${TEST_SRC_DIR}/*.proto "${B}/${TEST_SRC_DIR}/" + cp ${S}/${TEST_SRC_DIR}/*.py "${B}/${TEST_SRC_DIR}/" + cp ${S}/${TEST_SRC_DIR}/Makefile "${B}/${TEST_SRC_DIR}/" sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" - sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" + sed -e 's|Libs:|Libs: -L${B}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" + # Until out-of-tree build of examples is supported, we have to use this approach + sed -e 's|../src/google/protobuf/.libs/timestamp.pb.o|${B}/CMakeFiles/libprotobuf.dir/src/google/protobuf/timestamp.pb.cc.o|' -i "${B}/${TEST_SRC_DIR}/Makefile" export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}" # Save the pkgcfg sysroot variable, and update it to nothing so
@@ -54,7 +65,7 @@ do_compile_ptest() { # Compile the tests for lang in ${LANG_SUPPORT}; do - oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang} + oe_runmake -C "${B}/${TEST_SRC_DIR}" ${lang} done # Restore the pkgconfig sysroot variable
@@ -71,7 +82,7 @@ do_install_ptest() { install "$i" "${D}/${PTEST_PATH}" fi done - cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" + cp "${B}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" cd "$olddir" }
Signature · 1 line
2.25.1
PATCH 3/3 protobuf: correct ptest dependency
In reply to a message not in the archiveFrom: Vyacheslav Yurkov <[email protected]>
--- meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb +1 -1
@@ -93,7 +93,7 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" RDEPENDS:${PN}-compiler = "${PN}" RDEPENDS:${PN}-dev += "${PN}-compiler" -RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}" +RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}" MIPS_INSTRUCTION_SET = "mips"
Signature · 1 line
2.25.1
Re: [oe] [meta-oe][PATCH 1/3] protobuf: 3.19.4 -> 3.21.5 upgrade
In reply to a message not in the archiveits fails to build
https://errors.yoctoproject.org/Errors/Build/152159/
Quoted 269 lines · Vyacheslav Yurkov
From: Vyacheslav Yurkov <[email protected]>
Drop the patch that was accepted upstream
Signed-off-by Vyacheslav Yurkov <[email protected]>--- .../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%)meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-linking-error-with-ld-gold.patch +2
-4@@ -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 <[email protected]> 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 -meta-oe/recipes-devtools/protobuf/protobuf/0001-Lower-init-prio-for-extension-attributes.patch deleted +0
-79@@ -1,79 +0,0 @@ -From 8ff34dbff1eac612326b492d0b2cb93901ad7e2b Mon Sep 17 00:00:00 2001 -From: Jani Nurminen <[email protected]> -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 <[email protected]> - -Rebase on master - -Signed-off-by: He Zhe <[email protected]> ---- - 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 -meta-oe/recipes-devtools/protobuf/protobuf/0001-Makefile.am-include-descriptor.cc-when-building-libp.patch +4
-4@@ -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 <[email protected]> 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 <[email protected]> 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 \meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch +4
-6@@ -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 <[email protected]> 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 <[email protected]> Signed-off-by: Leon Anavi <[email protected]> + --- 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 -meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch +4
-6@@ -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 <[email protected]> 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 <[email protected]> + --- 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 -meta-oe/recipes-devtools/protobuf/protobuf_3.21.5.bb renamed from meta-oe/recipes-devtools/protobuf/protobuf_3.19.4.bb +2
-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 " --2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#98430): https://lists.openembedded.org/g/openembedded-devel/message/98430
Mute This Topic: https://lists.openembedded.org/mt/93246133/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-