diff options
Diffstat (limited to 'meta-oe/recipes-devtools/protobuf/protobuf')
4 files changed, 88 insertions, 34 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 new file mode 100644 index 0000000000..9f6116c4c4 --- /dev/null +++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch @@ -0,0 +1,26 @@ +From 08e46feb6553af670754e65d94c3bb6fcd4e0cf9 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 31 Oct 2021 23:39:44 -0700 +Subject: [PATCH] Fix build on mips/clang + +clang13 crashes on mips, until its fixed upstream disable tailcall on +mips + +https://bugs.llvm.org/show_bug.cgi?id=52367 + +Upstream-Status: Inappropriate [Clang workaround] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/google/protobuf/port_def.inc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -255,6 +255,7 @@ + #error PROTOBUF_TAILCALL was previously defined + #endif + #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) 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 new file mode 100644 index 0000000000..7c4bf260eb --- /dev/null +++ b/meta-oe/recipes-devtools/protobuf/protobuf/0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch @@ -0,0 +1,61 @@ +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 + with gold + +* move pkg-config call to separate variable, so that the final version + of the whole command so it's shown in log.do_compile_ptest_base +* add ../src/google/protobuf/.libs/timestamp.pb.o when linking + add_person_cpp otherwise it fails to link with gold: + 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` + /tmp/cccjSJQs.o:addressbook.pb.cc:scc_info_Person_addressbook_2eproto: error: undefined reference to 'scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto' + /tmp/cccjSJQs.o:addressbook.pb.cc:descriptor_table_addressbook_2eproto_deps: error: undefined reference to 'descriptor_table_google_2fprotobuf_2ftimestamp_2eproto' + collect2: error: ld returned 1 exit status + Makefile:43: recipe for target 'add_person_cpp' failed + +* and the same with list_people_cpp this time with pkg-config already through the variable: + 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 -pthread -Icore2-32-oe-linux/protobuf/3.8.0-r0/git/src -Lcore2-32-oe-linux/protobuf/3.8.0-r0/git/src/.libs -Lcore2-32-oe-linux/protobuf/3.8.0-r0/recipe-sysroot/usr/lib -lprotobuf list_people.cc addressbook.pb.cc -o list_people_cpp + /tmp/ccpaI5Su.o:addressbook.pb.cc:scc_info_Person_addressbook_2eproto: error: undefined reference to 'scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto' + /tmp/ccpaI5Su.o:addressbook.pb.cc:descriptor_table_addressbook_2eproto_deps: error: undefined reference to 'descriptor_table_google_2fprotobuf_2ftimestamp_2eproto' + collect2: error: ld returned 1 exit status + Makefile:49: recipe for target 'list_people_cpp' failed + +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 ef7a4ef58..7206e14e1 100644 +--- a/examples/Makefile ++++ b/examples/Makefile +@@ -2,6 +2,8 @@ + + .PHONY: all cpp java python clean + ++PROTOBUF := $(shell pkg-config --cflags --libs protobuf) ++ + all: cpp java python + + cpp: add_person_cpp list_people_cpp +@@ -41,11 +43,11 @@ protoc_middleman_dart: addressbook.proto + + add_person_cpp: add_person.cc protoc_middleman + pkg-config --cflags protobuf # fails if protobuf is not installed +- c++ -std=c++14 add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf` ++ $(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 + + list_people_cpp: list_people.cc protoc_middleman + pkg-config --cflags protobuf # fails if protobuf is not installed +- c++ -std=c++14 list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf` ++ $(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 + + add_person_dart: add_person.dart protoc_middleman_dart + +-- +2.34.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 deleted file mode 100644 index a2f7a4b771..0000000000 --- a/meta-oe/recipes-devtools/protobuf/protobuf/0001-protobuf-fix-configure-error.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 52959e8e01e39139d18f752e97283e45b4b7a426 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 - -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 <changqing.li@windriver.com> ---- - configure.ac | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index aec10cf..7fbe57d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -214,7 +214,6 @@ AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) - # 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 --- -2.7.4 - diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest b/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest index 7c3a8d1b3a..b3b2278c47 100644 --- a/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest +++ b/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest @@ -8,7 +8,7 @@ for write_exe_full_path in ${DIR}/add_person_*; do if [ -x "${write_exe_full_path}" ]; then write_exe=`basename ${write_exe_full_path}` echo "Generating new test file using ${write_exe}..." - ${write_exe_full_path} "${TEST_FILE}" + printf "1234\nname\nname@example.com\n" | ${write_exe_full_path} "${TEST_FILE}" RETVAL=$? [ $RETVAL -eq 0 ] || exit $RETVAL |