François Garillot created MESOS-7396:
----------------------------------------
Summary: Build errors on a recent Linux (4.10.9)
Key: MESOS-7396
URL: https://issues.apache.org/jira/browse/MESOS-7396
Project: Mesos
Issue Type: Bug
Affects Versions: 1.2.0
Environment: ArchLinux
kernel 4.10.9-1-ARCH #1 SMP PREEMPT Sat Apr 8 12:39:59 CEST 2017 x86_64
GNU/Linux
gcc (GCC) 5.3.0 and gcc (GCC) 6.3.1 20170306 (same results for both)
I obtained the aliasing issue on 1.2.0
Reporter: François Garillot
A couple of issues building with the regular PKGBUILD for Archlinux:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mesos
The build script (simple and somewhat readable) includes the following notable
flags :
{code}
../configure \
--enable-optimize \
--prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/lib \
--exec-prefix=/usr \
--sbindir=/usr/bin \
--with-network-isolator
make
{code}
The first set of errors is :
{code}
In file included from ../../src/checks/health_checker.cpp:56:0:
../../src/linux/ns.hpp: In function ‘Try<int> ns::clone(pid_t, int, const
std::function<int()>&, int)’:
../../src/linux/ns.hpp:487:69: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
pid_t pid = ((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->pid;
^
../../src/linux/ns.hpp: In lambda function:
../../src/linux/ns.hpp:589:59: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->pid = ::getpid();
^
../../src/linux/ns.hpp:590:59: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->uid = ::getuid();
^
../../src/linux/ns.hpp:591:59: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->gid = ::getgid();
^
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:6848: checks/libmesos_no_3rdparty_la-health_checker.lo]
Error 1
make[2]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
make[1]: *** [Makefile:3476: all] Error 2
make[1]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
make: *** [Makefile:765: all-recursive] Error 1
==> ERROR: A failure occurred in build().
Aborting...
{code}
Full log: https://gist.github.com/7b01ff080d91780ad5e4825dff610517
This can be fixed by adding :
{code}
CPPFLAGS="-fno-strict-aliasing"
{code}
before the above call to {{confgure}}.
The following build error is :
{code}
../../src/linux/fs.cpp:273:13: error: In the GNU C Library, "makedev" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "makedev", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"makedev", you should undefine it after including <sys/types.h>. [-Werror]
entry.devno = makedev(major.get(), minor.get());
^
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:7716: linux/libmesos_no_3rdparty_la-fs.lo] Error 1
make[2]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
make[1]: *** [Makefile:3476: all] Error 2
make[1]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
make: *** [Makefile:765: all-recursive] Error 1
==> ERROR: A failure occurred in build().
Aborting...
{code}
Full log :
https://gist.github.com/be7ba7cd3251ae9ac1b63b09ee2a38cf
This is fixed by adding
{code}
#include <sys/sysmacros.h>
{code}
towards the end of external imports in {{src/mesos-1.2.0/src/linux/fs.cpp}}
Finally, the same error is triggered by the use of {{major}} and {{minor}} in
{{src/mesos-1.2.0/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp}}
and is fixed by the same import as well.
(If you want to reproduce under Archlinux, use {{makepkg -e}} after any
edition of the source, though Arch build scripts are not necessary)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)