[svn-r22879] Bug Fix: HDFFV 8017

dt_arith would fail in Lion and Mountain Lion system when GCC version 4.2.1
is used with --enable-production. Somehow the -O optimization will fail some of
the hard conversion code.

Solution:
This is just a temporary patch by detecting if this is a Lion or Mountain Lion
system using GCC 4.2.1, then just remove the any -O option from the PROD_CFLAGS.
A better fix should be deviced later.

Tested: Duck(lion) and Owl (mountain lion) tested with --enable-production.
Also tested in Fred and Tejeda, both Snow Leopard systems to verify there is
no undesired side effect.
This commit is contained in:
Albert Cheng 2012-10-10 00:03:36 -05:00
parent 990fdaed07
commit 10ab09069d

View File

@ -28,6 +28,22 @@ fi
# Figure out compiler flags
. $srcdir/config/gnu-flags
# temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not
# use -O option as it causes failures in test/dt_arith.
#echo host_os=$host_os
case "$host_os" in
darwin1[12].*) # lion & mountain lion
#echo cc_vendor=$cc_vendor'-'cc_version=$cc_version
case "$cc_vendor-$cc_version" in
gcc-4.2.1)
# Remove any -O flags
#echo PROD_CFLAGS=$PROD_CFLAGS
PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O[0-3]*//'`"
#echo new PROD_CFLAGS=$PROD_CFLAGS
;;
esac
;;
esac
. $srcdir/config/intel-flags
if test "X-" = "X-$FC"; then