[
https://issues.apache.org/jira/browse/MESOS-4963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15199232#comment-15199232
]
Benjamin Bannier commented on MESOS-4963:
-----------------------------------------
If one turns off silent rules one could see
{code}
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
/bin/sh ../libtool --tag=CXX --mode=compile ccache g++-6
-DPACKAGE_NAME=\"mesos\" -DPACKAGE_TARNAME=\"mesos\"
-DPACKAGE_VERSION=\"0.29.0\" -DPACKAGE_STRING=\"mesos\ 0.29.0\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesos\"
-DVERSION=\"0.29.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
-DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1
-DHAVE_LIBZ=1 -DHAVE_LIBCURL=1 -DHAVE_APR_POOLS_H=1 -DHAVE_LIBAPR_1=1
-DHAVE_SVN_VERSION_H=1 -DHAVE_LIBSVN_SUBR_1=1 -DHAVE_SVN_DELTA_H=1
-DHAVE_LIBSVN_DELTA_1=1 -DHAVE_LIBSASL2=1 -I. -I../../src -Wall -Werror
-DLIBDIR=\"/usr/local/lib\" -DPKGLIBEXECDIR=\"/usr/local/libexec/mesos\"
-DPKGDATADIR=\"/usr/local/share/mesos\"
-DPKGMODULEDIR=\"/usr/local/lib/mesos/modules\" -I../../include
-I../../3rdparty/libprocess/include
-I../../3rdparty/libprocess/3rdparty/stout/include -I../include
-I../include/mesos -isystem ../3rdparty/libprocess/3rdparty/boost-1.53.0
-I../3rdparty/libprocess/3rdparty/picojson-1.3.0 -DPICOJSON_USE_INT64
-D__STDC_FORMAT_MACROS -I../3rdparty/libprocess/3rdparty/protobuf-2.5.0/src
-I../3rdparty/libprocess/3rdparty/glog-0.3.3/src
-I../3rdparty/libprocess/3rdparty/glog-0.3.3/src
-I../3rdparty/leveldb-1.4/include -I../3rdparty/zookeeper-3.4.5/src/c/include
-I../3rdparty/zookeeper-3.4.5/src/c/generated
-I../3rdparty/libprocess/3rdparty/protobuf-2.5.0/src
-I/Users/XYZ/src/homebrew/opt/openssl/include
-I/Users/XYZ/src/homebrew/opt/libevent/include
-I/Users/XYZ/src/homebrew/opt/subversion/include/subversion-1
-I/usr/include/apr-1 -I/usr/include/apr-1.0 -D_THREAD_SAFE -pthread -g -O2
-Wno-unused-local-typedefs -Wno-maybe-uninitialized -DGTEST_USE_OWN_TR1_TUPLE=1
-DGTEST_LANG_CXX11 -MT appc/libmesos_no_3rdparty_la-spec.lo -MD -MP -MF
appc/.deps/libmesos_no_3rdparty_la-spec.Tpo -c -o
appc/libmesos_no_3rdparty_la-spec.lo `test -f 'appc/spec.cpp' || echo
'../../src/'`appc/spec.cpp
libtool: compile: ccache g++-6 -DPACKAGE_NAME=\"mesos\"
-DPACKAGE_TARNAME=\"mesos\" -DPACKAGE_VERSION=\"0.29.0\"
"-DPACKAGE_STRING=\"mesos 0.29.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"
-DPACKAGE=\"mesos\" -DVERSION=\"0.29.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD_PRIO_INHERIT=1
-DHAVE_PTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_LIBCURL=1 -DHAVE_APR_POOLS_H=1
-DHAVE_LIBAPR_1=1 -DHAVE_SVN_VERSION_H=1 -DHAVE_LIBSVN_SUBR_1=1
-DHAVE_SVN_DELTA_H=1 -DHAVE_LIBSVN_DELTA_1=1 -DHAVE_LIBSASL2=1 -I. -I../../src
-Wall -Werror -DLIBDIR=\"/usr/local/lib\"
-DPKGLIBEXECDIR=\"/usr/local/libexec/mesos\"
-DPKGDATADIR=\"/usr/local/share/mesos\"
-DPKGMODULEDIR=\"/usr/local/lib/mesos/modules\" -I../../include
-I../../3rdparty/libprocess/include
-I../../3rdparty/libprocess/3rdparty/stout/include -I../include
-I../include/mesos -isystem ../3rdparty/libprocess/3rdparty/boost-1.53.0
-I../3rdparty/libprocess/3rdparty/picojson-1.3.0 -DPICOJSON_USE_INT64
-D__STDC_FORMAT_MACROS -I../3rdparty/libprocess/3rdparty/protobuf-2.5.0/src
-I../3rdparty/libprocess/3rdparty/glog-0.3.3/src
-I../3rdparty/libprocess/3rdparty/glog-0.3.3/src
-I../3rdparty/leveldb-1.4/include -I../3rdparty/zookeeper-3.4.5/src/c/include
-I../3rdparty/zookeeper-3.4.5/src/c/generated
-I../3rdparty/libprocess/3rdparty/protobuf-2.5.0/src
-I/Users/XYZ/src/homebrew/opt/openssl/include
-I/Users/XYZ/src/homebrew/opt/libevent/include
-I/Users/XYZ/src/homebrew/opt/subversion/include/subversion-1
-I/usr/include/apr-1 -I/usr/include/apr-1.0 -D_THREAD_SAFE -pthread -g -O2
-Wno-unused-local-typedefs -Wno-maybe-uninitialized -DGTEST_USE_OWN_TR1_TUPLE=1
-DGTEST_LANG_CXX11 -MT appc/libmesos_no_3rdparty_la-spec.lo -MD -MP -MF
appc/.deps/libmesos_no_3rdparty_la-spec.Tpo -c ../../src/appc/spec.cpp
-fno-common -DPIC -o appc/.libs/libmesos_no_3rdparty_la-spec.o
In file included from
../../3rdparty/libprocess/3rdparty/stout/include/stout/os/shell.hpp:22:0,
from
../../3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp:56,
from ../../src/appc/spec.cpp:17:
../../3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/shell.hpp: In
instantiation of 'int os::execlp(const char*, T ...) [with T = {const char*,
const char*, const char*, char*}]':
../../3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp:371:52:
required from here
../../3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/shell.hpp:151:18:
error: missing sentinel in function call [-Werror=format=]
return ::execlp(file, t...);
~~~~~~~~^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [appc/libmesos_no_3rdparty_la-spec.lo] Error 1
make: *** [all] Error 2
{code}
that we do not explicitly pass a flag {{--std=c++11}} to enable C++11 support.
Manually passing the flag lets us compile this file,
{code}
# Pass flags via AM_CXXFLAGS since the mesos build changes the user var CXXFLAGS
% make AM_CXXFLAGS=--std=c++11
{code}
Indeed scrolling back to the configure output I see
{code}
checking whether g++-6 support C++11 features by default... yes
{code}
This line is emitted by our [own
check|https://github.com/apache/mesos/blob/master/m4/ax_cxx_compile_stdcxx_11.m4#L174]
(note: same broken check exists in libprocess's {{m4}} include dir). It
appears g++-6 pulls in enough of C\+\+11 to make the testbody compile, but
e.g., does not add support for C\+\+11 variadic templates, making this look to
the compiler like a broken variadic C function.
> Compile error with GCC 6
> ------------------------
>
> Key: MESOS-4963
> URL: https://issues.apache.org/jira/browse/MESOS-4963
> Project: Mesos
> Issue Type: Bug
> Components: stout
> Reporter: Neil Conway
> Labels: mesosphere
>
> {noformat}
> $ head config.log
> [...]
> /mesos-2/configure --enable-optimize --disable-python CC=ccache
> /home/vagrant/local/gcc/bin/gcc CXX=ccache /home/vagrant/local/gcc/bin/g++
> $ ~/local/gcc/bin/g++ --version
> g++ (GCC) 6.0.0 20160227 (experimental)
> Copyright (C) 2016 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> $ make V=0
> make[2]: Entering directory '/home/vagrant/build-mesos-2-gcc6/src'
> CXX appc/libmesos_no_3rdparty_la-spec.lo
> In file included from
> /mesos-2/3rdparty/libprocess/3rdparty/stout/include/stout/os/shell.hpp:22:0,
> from
> /mesos-2/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp:56,
> from /mesos-2/src/appc/spec.cpp:17:
> /mesos-2/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/shell.hpp:
> In instantiation of ‘int os::execlp(const char*, T ...) [with T = {const
> char*, const char*, const char*, char*}]’:
> /mesos-2/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp:371:52:
> required from here
> /mesos-2/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/shell.hpp:151:18:
> error: missing sentinel in function call [-Werror=format=]
> return ::execlp(file, t...);
> ~~~~~~~~^~~~~~~~~~~~
> cc1plus: all warnings being treated as errors
> Makefile:5584: recipe for target 'appc/libmesos_no_3rdparty_la-spec.lo' failed
> {noformat}
> I'll verify this with a more recent GCC6 snapshot, but assuming it repros, I
> think we have a few options:
> * Have {{os::execlp}} *not* specify a NULL sentinel, and instead have the
> implementation of {{os::execlp}} always pass {{static_cast<T>(NULL)}} as the
> last argument to the {{execlp}} call.
> * Disable the GCC warning via a pragma or similar means.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)