summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-05-04 01:04:11 -0700
committerAnand Avati <avati@redhat.com>2014-05-08 20:13:50 -0700
commit4f8c7cc34dad6a963f70dfcf11e737fd44c31a42 (patch)
treec1886528be8018de710c64d85aea9e55eb39ed84 /configure.ac
parent75baf16c01b7cc09fbf14e3c9ecf447c3c793c5b (diff)
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 <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7656 Reviewed-by: Justin Clift <justin@gluster.org> Tested-by: Justin Clift <justin@gluster.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 12 insertions, 8 deletions
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