@@ -43,6 +43,7 @@ F: package/gstreamer1/gst1-vaapi/
F: package/imx-usb-loader/
F: package/janus-gateway/
F: package/json-for-modern-cpp/
+F: package/libabseil-cpp/
F: package/libcpprestsdk/
F: package/libcutl/
F: package/libodb/
@@ -1824,6 +1824,7 @@ menu "Other"
source "package/gtest/Config.in"
source "package/jemalloc/Config.in"
source "package/lapack/Config.in"
+ source "package/libabseil-cpp/Config.in"
source "package/libargtable2/Config.in"
source "package/libatomic_ops/Config.in"
source "package/libavl/Config.in"
new file mode 100644
@@ -0,0 +1,38 @@
+From d170b19e500d85381369e379771be8d7816bcc92 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <Aduskett@gmail.com>
+Date: Tue, 21 Jul 2020 13:08:50 -0700
+Subject: [PATCH] force position independent code
+
+Without this option, programs building for arm64 or x86-64 will fail when
+attempting to link to the built libraries with the following (abbreviated)
+error:
+
+"relocation against `.rodata' can not be used when making a shared object;
+recompile with -fPIC."
+
+Because libabseil-cpp builds static libraries, it is better to set the
+POSITION_INDEPENDENT_CODE to ON instead of forcing fPIC, as forcing fPIC may
+cause relocation errors when shared libraries link against the built static
+libraries.
+
+Signed-off-by: Adam Duskett <Aduskett@gmail.com>
+---
+ CMake/AbseilHelpers.cmake | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index 86ff9eb..bdb7a89 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -207,6 +207,8 @@ function(absl_cc_library)
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+
++ # Without this setting, other programs such as GRPC will fail when linking.
++ set_property(TARGET ${_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
+ # When being installed, we lose the absl_ prefix. We want to put it back
+ # to have properly named lib files. This is a no-op when we are not being
+ # installed.
+--
+2.26.2
+
new file mode 100644
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_LIBABSEIL_CPP
+ bool "libabseil-cpp"
+ depends on BR2_TOOLCHAIN_USES_GLIBC # execinfo.h
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ Abseil is an open-source collection of C++ library code
+ designed to augment the C++ standard library. The Abseil
+ library code is collected from Google's own C++ code base, has
+ been extensively tested and used in production, and is the
+ same code we depend on in our daily coding lives.
+
+ https://github.com/abseil/abseil-cpp
+
+comment "grpc needs a glibc toolchain w/ C++, threads"
+ depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP || \
+ !BR2_TOOLCHAIN_HAS_THREADS
new file mode 100644
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 728a813291bdec2aa46eab8356ace9f75ac2ed9dfe2df5ab603c4e6c09f1c353 libabseil-cpp-20200225.tar.gz
+sha256 c79a7fea0e3cac04cd43f20e7b648e5a0ff8fa5344e644b0ee09ca1162b62747 LICENSE
new file mode 100644
@@ -0,0 +1,24 @@
+################################################################################
+#
+# libabseil-cpp
+#
+################################################################################
+
+LIBABSEIL_CPP_VERSION = 20200225
+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_CONF_OPTS = \
+ -DABSL_ENABLE_INSTALL=ON \
+ -DABSL_USE_GOOGLETEST_HEAD=OFF \
+ -DABSL_RUN_TESTS=OFF
+
+HOST_LIBABSEIL_CPP_CONF_OPTS = \
+ -DABSL_ENABLE_INSTALL=ON \
+ -DABSL_USE_GOOGLETEST_HEAD=OFF \
+ -DABSL_RUN_TESTS=OFF
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))