From 8670f9b870f51b603b1b90c6bce640fac2fbafd2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 3 Nov 2023 17:19:19 -0700 Subject: [PATCH 1/3] abseil-cpp: upgrade 20230802.0 -> 20230802.1 Signed-off-by: Khem Raj (cherry picked from commit fbed5bbeb3fade5f0d37cd850451e1eb81e3ca44) --- meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb index f847ebf1568..5003187d0dc 100644 --- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb @@ -7,8 +7,8 @@ SECTION = "libs" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915" -PV = "20230802.0" -SRCREV = "29bf8085f3bf17b84d30e34b3d7ff8248fda404e" +PV = "20230802.1" +SRCREV = "fb3621f4f897824c0dbe0615fa94543df6192f30" BRANCH = "lts_2023_08_02" SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \ file://0001-absl-always-use-asm-sgidefs.h.patch \ From ccf0e27d77867b5aee08f0e4d438079d79de7b9b Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Wed, 8 Nov 2023 18:39:06 +0000 Subject: [PATCH 2/3] abseil-cpp: fix mingw build Add patch to fix mingw build of abseil-cpp undefined reference to `absl::lts_20230802::synchronization_internal::Win32Waiter::Poke()' undefined reference to `absl::lts_20230802::synchronization_internal::Win32Waiter::Win32Waiter()' undefined reference to `absl::lts_20230802::synchronization_internal::Win32Waiter::Post()' undefined reference to `absl::lts_20230802::synchronization_internal::Win32Waiter::Poke()' and include bindir to recipe sysroot to fix protobuf build. | The imported target "absl::log_severity" references the file | | "../nativesdk-protobuf/4.23.4/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-w64-mingw32/usr/bin/libabsl_log_severity.dll" | | but this file does not exist. Signed-off-by: Samuli Piippo Signed-off-by: Khem Raj (cherry picked from commit ca4c5ab653b9d5187385050552386f95ec868944) --- ...-Win32Waiter-and-PthreadWaiter-on-Mi.patch | 62 +++++++++++++++++++ .../abseil-cpp/abseil-cpp_git.bb | 3 + 2 files changed, 65 insertions(+) create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-Avoid-using-both-Win32Waiter-and-PthreadWaiter-on-Mi.patch diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-Avoid-using-both-Win32Waiter-and-PthreadWaiter-on-Mi.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-Avoid-using-both-Win32Waiter-and-PthreadWaiter-on-Mi.patch new file mode 100644 index 00000000000..db559bb1616 --- /dev/null +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-Avoid-using-both-Win32Waiter-and-PthreadWaiter-on-Mi.patch @@ -0,0 +1,62 @@ +From cb7665f39e23e95e2466390c60ee5a410780a3ed Mon Sep 17 00:00:00 2001 +From: Derek Mauro +Date: Wed, 8 Nov 2023 09:55:31 -0800 +Subject: [PATCH] Avoid using both Win32Waiter and PthreadWaiter on MinGW, and + use StdcppWaiter instead. + +There are various flavors of MinGW, some of which support pthread, +and some of which support Win32. Instead of figuring out which +platform is being used, just use the generic implementation. + +PiperOrigin-RevId: 580565507 +Change-Id: Ia85fd7496f1e6ebdeadb95202f0039e844826118 +Upstream-Status: Backport +--- + absl/synchronization/internal/pthread_waiter.h | 4 ++-- + absl/synchronization/internal/win32_waiter.h | 6 ++++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/absl/synchronization/internal/pthread_waiter.h b/absl/synchronization/internal/pthread_waiter.h +index 206aefa4..23db76ad 100644 +--- a/absl/synchronization/internal/pthread_waiter.h ++++ b/absl/synchronization/internal/pthread_waiter.h +@@ -16,7 +16,7 @@ + #ifndef ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ + #define ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ + +-#ifndef _WIN32 ++#if !defined(_WIN32) && !defined(__MINGW32__) + #include + + #include "absl/base/config.h" +@@ -55,6 +55,6 @@ class PthreadWaiter : public WaiterCrtp { + ABSL_NAMESPACE_END + } // namespace absl + +-#endif // ndef _WIN32 ++#endif // !defined(_WIN32) && !defined(__MINGW32__) + + #endif // ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ +diff --git a/absl/synchronization/internal/win32_waiter.h b/absl/synchronization/internal/win32_waiter.h +index 87eb617c..fdab264e 100644 +--- a/absl/synchronization/internal/win32_waiter.h ++++ b/absl/synchronization/internal/win32_waiter.h +@@ -20,7 +20,8 @@ + #include + #endif + +-#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ++#if defined(_WIN32) && !defined(__MINGW32__) && \ ++ _WIN32_WINNT >= _WIN32_WINNT_VISTA + + #include "absl/base/config.h" + #include "absl/synchronization/internal/kernel_timeout.h" +@@ -65,6 +66,7 @@ class Win32Waiter : public WaiterCrtp { + ABSL_NAMESPACE_END + } // namespace absl + +-#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ++#endif // defined(_WIN32) && !defined(__MINGW32__) && ++ // _WIN32_WINNT >= _WIN32_WINNT_VISTA + + #endif // ABSL_SYNCHRONIZATION_INTERNAL_WIN32_WAITER_H_ diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb index 5003187d0dc..65ecab7d088 100644 --- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb @@ -15,6 +15,7 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \ file://0002-Remove-maes-option-from-cross-compilation.patch \ file://abseil-ppc-fixes.patch \ file://0003-Remove-neon-option-from-cross-compilation.patch \ + file://0004-Avoid-using-both-Win32Waiter-and-PthreadWaiter-on-Mi.patch \ " S = "${WORKDIR}/git" @@ -32,4 +33,6 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \ BBCLASSEXTEND = "native nativesdk" +SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}" + FILES:${PN}-dev += "${includedir} ${libdir}/cmake ${libdir}/pkgconfig" From ef09c1929e182f9d1367f7c0096b3692c35d3741 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 13 Nov 2023 08:42:45 +0000 Subject: [PATCH 3/3] protobuf: stage protoc binary to sysroot If protoc is enabled for the build, recipes using protobuf will fail when protoc is not available in the recipe sysroot: | The imported target "protobuf::protoc" references the file | | ".../recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/protoc-3.21.5.0" | | but this file does not exist. Possible reasons include: | | * The file was deleted, renamed, or moved to another location. | | * An install or uninstall procedure did not complete successfully. | | * The installation package was faulty and contained | | ".../recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/cmake/protobuf/protobuf-targets.cmake" | | but not all the files it references. Use SYSROOT_DIRS to stage the binary to sysroot so it's always available for other recipes. Signed-off-by: Samuli Piippo Signed-off-by: Khem Raj (cherry picked from commit b1deec0de476d8f0a0c6427919f57ee5f681ea0e) --- meta-oe/recipes-devtools/protobuf/protobuf_4.23.4.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_4.23.4.bb b/meta-oe/recipes-devtools/protobuf/protobuf_4.23.4.bb index 1edc21cdfc9..7d37ee3d29c 100644 --- a/meta-oe/recipes-devtools/protobuf/protobuf_4.23.4.bb +++ b/meta-oe/recipes-devtools/protobuf/protobuf_4.23.4.bb @@ -101,6 +101,9 @@ PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite" FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}" FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" +# CMake requires protoc binary to exist in sysroot, even if it has wrong architecture. +SYSROOT_DIRS += "${bindir}" + RDEPENDS:${PN}-compiler = "${PN}" RDEPENDS:${PN}-dev += "${PN}-compiler" RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"