Skip to contentSkip to conversation

package/libabseil-cpp: enforce C++11

PATCH New Michael Nosthoff 2 participants 3 messages Oct 30, 2020 – Oct 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/libabseil-cpp: enforce C++11

Abseil needs at least c++11 but removed the fallback when not set in [0]. So we need to do this.

[0] https://github.com/abseil/abseil-cpp/commit/c6954897f7ece5011f0126db9117361dc1a6ff36

Fixes:
http://autobuild.buildroot.net/results/5780d5e21e5e9c0ba86cc422ef995f45dc83cc4c
http://autobuild.buildroot.net/results/8138c63fc13940e1b97f07f24752b199f88ccfa8
http://autobuild.buildroot.net/results/f8eda966c6400c242680db378c8944444d89d5c5
http://autobuild.buildroot.net/results/38e9427d995e16bc4876f9fdc890c42e4fd04c06
http://autobuild.buildroot.net/results/4e99415728a6f3c6b396a9872924262652f77996
http://autobuild.buildroot.net/results/1830577843772bdfd6e310b4d361aa1edf5969d6

---
 package/libabseil-cpp/libabseil-cpp.mk | 2 ++
 1 file changed, 2 insertions(+)
package/libabseil-cpp/libabseil-cpp.mk +2 -0
index dfcf892f65..9cff8f0ff4 100644
@@ -11,11 +11,13 @@ LIBABSEIL_CPP_LICENSE_FILES = LICENSE
 LIBABSEIL_CPP_INSTALL_STAGING = YES
 
 LIBABSEIL_CPP_CONF_OPTS = \
+	-DCMAKE_CXX_STANDARD=11 \
 	-DABSL_ENABLE_INSTALL=ON \
 	-DABSL_USE_GOOGLETEST_HEAD=OFF \
 	-DABSL_RUN_TESTS=OFF
 
 HOST_LIBABSEIL_CPP_CONF_OPTS = \
+	-DCMAKE_CXX_STANDARD=11 \
 	-DABSL_ENABLE_INSTALL=ON \
 	-DABSL_USE_GOOGLETEST_HEAD=OFF \
 	-DABSL_RUN_TESTS=OFF
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/2 package/libabseil-cpp: depend on (host) gcc >= 4.9

abseil depends on gcc >= 4.9 according to [0] and actually doesn't compile anymore with the latest version bump.
This didn't show in the autobuilders as the C++11 issue fixed in the previous commit shadowed it.

also update dependency in package/grpc.

fixes:
https://github.com/abseil/abseil-cpp/issues/795

[0] https://abseil.io/docs/cpp/platforms/platforms#linux

---
 package/grpc/Config.in          | 8 +++++---
 package/libabseil-cpp/Config.in | 5 +++--
 2 files changed, 8 insertions(+), 5 deletions(-)
package/grpc/Config.in +5 -3
index 0270b38c35..6151f4b3d1 100644
@@ -3,7 +3,8 @@ config BR2_PACKAGE_GRPC
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS # protobuf, re2
 	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
-	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf, re2
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # protobuf, re2, libabseil-cpp
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # host-libabseil-cpp
 	depends on !BR2_STATIC_LIBS # protobuf, libabseil-cpp
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
@@ -19,9 +20,10 @@ config BR2_PACKAGE_GRPC
 
 	  http://github.com/grpc/grpc
 
-comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8"
+comment "grpc needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.9"
 	depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
-		|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+		|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 \
+		|| !BR2_HOST_GCC_AT_LEAST_4_9
 	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
package/libabseil-cpp/Config.in +3 -2
index 8018e7b264..222e3a092a 100644
@@ -14,6 +14,7 @@ config BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
 config BR2_PACKAGE_LIBABSEIL_CPP
 	bool "libabseil-cpp"
 	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on !BR2_STATIC_LIBS # uses dlfcn.h
 	depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
@@ -26,7 +27,7 @@ config BR2_PACKAGE_LIBABSEIL_CPP
 
 	  https://github.com/abseil/abseil-cpp
 
-comment "libabseil-cpp needs a toolchain w/ C++, threads, dynamic library"
+comment "libabseil-cpp needs a toolchain w/ gcc >= 4.9, C++, threads, dynamic library"
 	depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
-		BR2_STATIC_LIBS
+		BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 1/2 package/libabseil-cpp: enforce C++11

In reply to Michael Nosthoff
Quoted 13 lines · On Fri, 30 Oct 2020 12:25:04 +0100 Michael Nosthoff via buildroot…

Abseil needs at least c++11 but removed the fallback when not set in [0]. So we need to do this.

[0] https://github.com/abseil/abseil-cpp/commit/c6954897f7ece5011f0126db9117361dc1a6ff36

Fixes:
http://autobuild.buildroot.net/results/5780d5e21e5e9c0ba86cc422ef995f45dc83cc4c
http://autobuild.buildroot.net/results/8138c63fc13940e1b97f07f24752b199f88ccfa8
http://autobuild.buildroot.net/results/f8eda966c6400c242680db378c8944444d89d5c5
http://autobuild.buildroot.net/results/38e9427d995e16bc4876f9fdc890c42e4fd04c06
http://autobuild.buildroot.net/results/4e99415728a6f3c6b396a9872924262652f77996
http://autobuild.buildroot.net/results/1830577843772bdfd6e310b4d361aa1edf5969d6

Quoted 4 lines
---
 package/libabseil-cpp/libabseil-cpp.mk | 2 ++
 1 file changed, 2 insertions(+)

Both applied to master. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com