You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2018/08/03 20:25:52 UTC

[mesos] 01/05: Fixed gRPC compilation with Clang when building Mesos.

This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 9fb936abdce72e313e77aa15f0b9fc95c7fea512
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Mon Jul 30 16:58:54 2018 -0700

    Fixed gRPC compilation with Clang when building Mesos.
    
    When compiling gRPC with Clang, there are some array-out-of-bound
    warnings due to the use of GLIBC's `__strcmp_cg` macro in the c-ares
    library. With `-Werror` on, these warnings would stop gRPC from
    compiling. This patch ignores such errors.
    
    Review: https://reviews.apache.org/r/68114
---
 3rdparty/Makefile.am | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am
index e7005fb..9508b0f 100644
--- a/3rdparty/Makefile.am
+++ b/3rdparty/Makefile.am
@@ -425,16 +425,20 @@ LIB_GRPC = $(GRPC)/libs/opt/libgrpc++$(GRPC_VARIANT).a	\
 
 $(LIB_GRPC): $(GRPC)-build-stamp
 
-# NOTE: We the include flags through the `CPPFLAGS` environment variable rather
-# than the command line because gRPC uses target-specific assignments to append
-# flags to `CPPFLAGS`, which will be overwritten by command line arguments. See:
+# NOTE: We include flags through the `CPPFLAGS` environment variable rather than
+# the command line because gRPC uses target-specific assignments to append flags
+# to `CPPFLAGS`, which will be overwritten by command line arguments. See:
 # https://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html
+#
+# NOTE: We ignore `array-bounds` errors generated by the GLIBC's `__strcmp_cg`
+# macro used in gRPC's c-ares library when compiled with Clang.
 $(GRPC)-build-stamp: $(GRPC)-stamp			\
                      $(PROTOBUF)-build-stamp
 	cd $(GRPC) &&					\
 	  CPPFLAGS="$(PROTOBUF_INCLUDE_FLAGS)		\
 	            $(SSL_INCLUDE_FLAGS)		\
-	            $(ZLIB_INCLUDE_FLAGS)"		\
+	            $(ZLIB_INCLUDE_FLAGS)		\
+	            -Wno-array-bounds"			\
 	  $(MAKE) $(AM_MAKEFLAGS)			\
 	    $(LIB_GRPC:%=$(abs_builddir)/%)		\
 	    CC="$(CC)"					\