Updated Branches:
  refs/heads/master bfdfdce66 -> 3bc42c746

Add '-fno-strict-aliasing' for gcc 4.4.*.

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


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

Branch: refs/heads/master
Commit: 5917bb926a10618923421f7b5b62bb46201896ab
Parents: 43a60ca
Author: Benjamin Hindman <[email protected]>
Authored: Wed Jul 31 17:55:52 2013 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Thu Aug 1 14:52:57 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/5917bb92/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 43f6d52..0a82558 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,6 +196,21 @@ AM_CONDITIONAL([OS_LINUX], [test "x$OS_NAME" = "xlinux"])
 AC_PROG_CXX([g++])
 AC_PROG_CC([gcc])
 
+# Check the version of gcc and add any flags as appropriate.
+GCC_VERSION="`gcc -dumpversion`"
+test $? = 0 || AC_MSG_ERROR([failed to determine version of gcc])
+case  "${GCC_VERSION}" in
+  4.4*)
+    echo ===========================================================
+    echo Setting up CXXFLAGS for gcc 4.4.*
+    echo ===========================================================
+    # We fail to build some protobuf generated code with gcc 4.4
+    # without setting -fno-strict-aliasing.
+    CFLAGS="$CFLAGS -fno-strict-aliasing"
+    CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
+  ;;
+esac
+
 
 # Check for pthreads (uses m4/acx_pthread.m4).
 ACX_PTHREAD([], [AC_MSG_ERROR([failed to find pthreads])])

Reply via email to