You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2017/02/16 19:27:31 UTC

[1/3] mesos git commit: Rejected optimizing if we are working with a libcxx with UB.

Repository: mesos
Updated Branches:
  refs/heads/master 7012ee28a -> 3350bd5dc


Rejected optimizing if we are working with a libcxx with UB.

Review: https://reviews.apache.org/r/55771/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b26b4325
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b26b4325
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b26b4325

Branch: refs/heads/master
Commit: b26b4325e4c5c47ad43408e40abcfb4a4a214f9a
Parents: 7012ee2
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Feb 16 18:06:03 2017 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Thu Feb 16 18:06:03 2017 +0100

----------------------------------------------------------------------
 configure.ac | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b26b4325/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5e6719d..1e47bab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1885,6 +1885,38 @@ fi
 AM_CONDITIONAL([WITH_BUNDLED_ZOOKEEPER],
                [test "x$with_bundled_zookeeper" = "xyes"])
 
+
+# Once all CXXFLAGS are completely assembled, make sure the we are not
+# affected by libcxx undefined behavior,
+# https://llvm.org/bugs/show_bug.cgi?id=28469.
+AC_MSG_CHECKING([C++ standard library for undefined behaviour with selected optimization level])
+AC_LANG_PUSH([C++])
+AC_RUN_IFELSE([
+  AC_LANG_SOURCE([[
+    #include <functional>
+    #include <map>
+
+    struct F {
+      std::map<int, std::function<void()>> m;
+      F() { m[42] = []() {}; }
+    };
+
+    int main() {
+      F f;
+      f = F{};
+    }
+  ]])],
+  [
+    AC_MSG_RESULT([no])
+  ], [
+    AC_MSG_RESULT([yes])
+    AC_MSG_ERROR([Mesos cannot be built with optimizations against this version of libcxx (MESOS-5745).
+                  Consider building without optimizations, or changing the used C++ standard library.])
+  ]
+)
+AC_LANG_POP([C++])
+
+
 # NOTE: Do not update any compiler or linker settings (e.g. CXXFLAGS,
 # LDFLAGS, ...) beyond this line.
 


[2/3] mesos git commit: Rejected optimizing if we are working with a libcxx with UB.

Posted by ti...@apache.org.
Rejected optimizing if we are working with a libcxx with UB.

Review: https://reviews.apache.org/r/55772/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f91bece9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f91bece9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f91bece9

Branch: refs/heads/master
Commit: f91bece951076ac207baa6fa51c07698de7cc1fe
Parents: b26b432
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Feb 16 18:06:11 2017 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Thu Feb 16 18:06:11 2017 +0100

----------------------------------------------------------------------
 3rdparty/libprocess/configure.ac | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f91bece9/3rdparty/libprocess/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/configure.ac b/3rdparty/libprocess/configure.ac
index 48e3b14..1540006 100644
--- a/3rdparty/libprocess/configure.ac
+++ b/3rdparty/libprocess/configure.ac
@@ -1018,6 +1018,37 @@ you can get away without it by doing --disable-zlib.
 fi
 
 
+# Once all CXXFLAGS are completely assembled, make sure the we are not
+# affected by libcxx undefined behavior,
+# https://llvm.org/bugs/show_bug.cgi?id=28469.
+AC_MSG_CHECKING([C++ standard library for undefined behaviour with selected optimization level])
+AC_LANG_PUSH([C++])
+AC_RUN_IFELSE([
+  AC_LANG_SOURCE([[
+    #include <functional>
+    #include <map>
+
+    struct F {
+      std::map<int, std::function<void()>> m;
+      F() { m[42] = []() {}; }
+    };
+
+    int main() {
+      F f;
+      f = F{};
+    }
+  ]])],
+  [
+    AC_MSG_RESULT([no])
+  ], [
+    AC_MSG_RESULT([yes])
+    AC_MSG_ERROR([libprocess cannot be built with optimizations against this version of libcxx (MESOS-5745).
+                  Consider building without optimizations, or changing the used C++ standard library.])
+  ]
+)
+AC_LANG_POP([C++])
+
+
 # Also pass the flags to 3rdparty libraries.
 CONFIGURE_ARGS="$CONFIGURE_ARGS CXXFLAGS='$CXXFLAGS'"
 


[3/3] mesos git commit: Rejected optimizing if we are working with a libcxx with UB.

Posted by ti...@apache.org.
Rejected optimizing if we are working with a libcxx with UB.

Review: https://reviews.apache.org/r/55773/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3350bd5d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3350bd5d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3350bd5d

Branch: refs/heads/master
Commit: 3350bd5dc90747ea335c6f8ecac76609ff988e7b
Parents: f91bece
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Feb 16 18:06:17 2017 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Thu Feb 16 18:06:17 2017 +0100

----------------------------------------------------------------------
 3rdparty/stout/configure.ac | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3350bd5d/3rdparty/stout/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/stout/configure.ac b/3rdparty/stout/configure.ac
index cac1457..50c1f6f 100644
--- a/3rdparty/stout/configure.ac
+++ b/3rdparty/stout/configure.ac
@@ -706,4 +706,34 @@ case "$host_os" in
     ;;
 esac
 
+# Once all CXXFLAGS are completely assembled, make sure the we are not
+# affected by libcxx undefined behavior,
+# https://llvm.org/bugs/show_bug.cgi?id=28469.
+AC_MSG_CHECKING([C++ standard library for undefined behaviour with selected optimization level])
+AC_LANG_PUSH([C++])
+AC_RUN_IFELSE([
+  AC_LANG_SOURCE([[
+    #include <functional>
+    #include <map>
+
+    struct F {
+      std::map<int, std::function<void()>> m;
+      F() { m[42] = []() {}; }
+    };
+
+    int main() {
+      F f;
+      f = F{};
+    }
+  ]])],
+  [
+    AC_MSG_RESULT([no])
+  ], [
+    AC_MSG_RESULT([yes])
+    AC_MSG_ERROR([stout cannot be built with optimizations against this version of libcxx (MESOS-5745).
+                  Consider building without optimizations, or changing the used C++ standard library.])
+  ]
+)
+AC_LANG_POP([C++])
+
 AC_OUTPUT