From 4f8c7cc34dad6a963f70dfcf11e737fd44c31a42 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 4 May 2014 01:04:11 -0700 Subject: runtime: Disable optimization for OSX versions < 10.9 Optimization flags has led to segfaults at wrong locations throughout gluster code for versions < 10.9 Assuming this to be a compiler bug, disable optimization flags Change-Id: Ia2dc983dc5bb06935f03b68c07688ce41255d7da BUG: 1089172 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/7656 Reviewed-by: Justin Clift Tested-by: Justin Clift --- configure.ac | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 69fa0a71d71..b824cf92178 100644 --- a/configure.ac +++ b/configure.ac @@ -226,6 +226,18 @@ else CFLAGS="${CFLAGS} -g -O2" fi +case $host_os in + darwin*) + if ! test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -ge 7; then + AC_MSG_ERROR([You need at least OS X 10.7 (Lion) to build Glusterfs]) + fi + # OSX version lesser than 9 has llvm/clang optimization issues which leads to various segfaults + if test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -lt 9; then + CFLAGS="${CFLAGS} -g -O0 -DDEBUG" + fi + ;; +esac + AC_ARG_WITH(pkgconfigdir, [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@], [pkgconfigdir=$withval], @@ -313,14 +325,6 @@ AC_CHECK_HEADERS([linux/falloc.h]) AC_CHECK_HEADERS([libintl.h]) -case $host_os in - darwin*) - if ! test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -ge 7; then - AC_MSG_ERROR([You need at least OS X 10.7 (Lion) to build Glusterfs]) - fi - ;; -esac - dnl Mac OS X does not have spinlocks AC_CHECK_FUNC([pthread_spin_init], [have_spinlock=yes]) if test "x${have_spinlock}" = "xyes"; then -- cgit