[Buildroot] [PATCH 1/1] package/libabseil-cpp: fix build with libexecinfo

Fabrice Fontaine fontaine.fabrice at gmail.com
Tue Jun 21 19:32:10 UTC 2022


Fix the following build failure with collectd:

/home/buildroot/autobuild/instance-0/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libabsl_stacktrace.so: undefined reference to `backtrace'

[...]

    libgrpc++ . . . . . . no (libgrpc++ not found)

[...]

configure: error: "Some plugins are missing dependencies - see the summary above for details"

Fixes:
 - http://autobuild.buildroot.org/results/6a0484412f020e763ce3ad5bda48f09c78645bff

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 ...-txt-link-with-libexecinfo-if-needed.patch | 65 +++++++++++++++++++
 package/libabseil-cpp/libabseil-cpp.mk        |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 package/libabseil-cpp/0004-PR-1200-absl-debugging-CMakeLists-txt-link-with-libexecinfo-if-needed.patch

diff --git a/package/libabseil-cpp/0004-PR-1200-absl-debugging-CMakeLists-txt-link-with-libexecinfo-if-needed.patch b/package/libabseil-cpp/0004-PR-1200-absl-debugging-CMakeLists-txt-link-with-libexecinfo-if-needed.patch
new file mode 100644
index 0000000000..4fbe8542ac
--- /dev/null
+++ b/package/libabseil-cpp/0004-PR-1200-absl-debugging-CMakeLists-txt-link-with-libexecinfo-if-needed.patch
@@ -0,0 +1,65 @@
+From 01cc6567cff77738e416a7ddc17de2d435a780ce Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+Date: Tue, 21 Jun 2022 12:27:47 -0700
+Subject: [PATCH] PR #1200: absl/debugging/CMakeLists.txt: link with
+ libexecinfo if needed
+
+Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1200
+
+`backtrace` and `execinfo.h` can be provided by libexecinfo on uclibc and musl resulting in the following build failure with any user of abseil-cpp (such as collectd):
+
+```
+/home/buildroot/autobuild/instance-0/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libabsl_stacktrace.so: undefined reference to `backtrace'
+```
+
+[...]
+
+```
+    libgrpc++ . . . . . . no (libgrpc++ not found)
+```
+
+[...]
+
+```
+configure: error: "Some plugins are missing dependencies - see the summary above for details"
+```
+
+Fixes:
+ - http://autobuild.buildroot.org/results/6a0484412f020e763ce3ad5bda48f09c78645bff
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+Merge dac52cd20efb672278dc64bcd74920172a599ac0 into 93ad4284ac12077b7bac07a4743df1c564e7c957
+
+Merging this change closes #1200
+
+COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1200 from ffontaine:master dac52cd20efb672278dc64bcd74920172a599ac0
+PiperOrigin-RevId: 456323163
+Change-Id: I3d2206761524d36e2b227c571e2e513f6840ff75
+[Retrieved from:
+https://github.com/abseil/abseil-cpp/commit/01cc6567cff77738e416a7ddc17de2d435a780ce]
+---
+ absl/debugging/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/absl/debugging/CMakeLists.txt b/absl/debugging/CMakeLists.txt
+index 329527344..d8207d6a2 100644
+--- a/absl/debugging/CMakeLists.txt
++++ b/absl/debugging/CMakeLists.txt
+@@ -14,6 +14,8 @@
+ # limitations under the License.
+ #
+ 
++find_library(EXECINFO_LIBRARY execinfo)
++
+ absl_cc_library(
+   NAME
+     stacktrace
+@@ -33,6 +35,8 @@ absl_cc_library(
+     "stacktrace.cc"
+   COPTS
+     ${ABSL_DEFAULT_COPTS}
++  LINKOPTS
++    $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>
+   DEPS
+     absl::debugging_internal
+     absl::config
diff --git a/package/libabseil-cpp/libabseil-cpp.mk b/package/libabseil-cpp/libabseil-cpp.mk
index 7c6bda7659..cc1be3ad95 100644
--- a/package/libabseil-cpp/libabseil-cpp.mk
+++ b/package/libabseil-cpp/libabseil-cpp.mk
@@ -9,6 +9,7 @@ LIBABSEIL_CPP_SITE = $(call github,abseil,abseil-cpp,$(LIBABSEIL_CPP_VERSION))
 LIBABSEIL_CPP_LICENSE = Apache-2.0
 LIBABSEIL_CPP_LICENSE_FILES = LICENSE
 LIBABSEIL_CPP_INSTALL_STAGING = YES
+LIBABSEIL_CPP_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBEXECINFO),libexecinfo)
 
 LIBABSEIL_CPP_CONF_OPTS = \
 	-DCMAKE_CXX_STANDARD=11 \
-- 
2.35.1




More information about the buildroot mailing list