summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/grpc/Config.in2
-rw-r--r--package/grpc/grpc.mk6
2 files changed, 8 insertions, 0 deletions
diff --git a/package/grpc/Config.in b/package/grpc/Config.in
index 3b17400612..2765d0fb40 100644
--- a/package/grpc/Config.in
+++ b/package/grpc/Config.in
@@ -6,6 +6,7 @@ config BR2_PACKAGE_GRPC
depends on BR2_HOST_GCC_AT_LEAST_4_8 # protobuf
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
depends on !BR2_STATIC_LIBS # protobuf
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
select BR2_PACKAGE_C_ARES
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_PROTOBUF
@@ -17,6 +18,7 @@ config BR2_PACKAGE_GRPC
http://github.com/grpc/grpc
comment "grpc needs a toolchain w/ C++, threads, dynamic library, host and target gcc >= 4.8"
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
|| BR2_STATIC_LIBS || !BR2_HOST_GCC_AT_LEAST_4_8 \
|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
diff --git a/package/grpc/grpc.mk b/package/grpc/grpc.mk
index 6ca6536fff..6c804429ff 100644
--- a/package/grpc/grpc.mk
+++ b/package/grpc/grpc.mk
@@ -23,6 +23,12 @@ GRPC_CONF_OPTS = \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_NATIVE_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin
+# grpc can use __atomic builtins, so we need to link with
+# libatomic when available
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
HOST_GRPC_CONF_OPTS = \
-D_gRPC_CARES_LIBRARIES=cares \
-DgRPC_CARES_PROVIDER=none \
OpenPOWER on IntegriCloud