mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject [3/3] mesos git commit: Rejected optimizing if we are working with a libcxx with UB.
Date Thu, 16 Feb 2017 19:27:33 GMT
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 <benjamin.bannier@mesosphere.io>
Authored: Thu Feb 16 18:06:17 2017 +0100
Committer: Till Toenshoff <toenshoff@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


Mime
View raw message