From 10ab09069deccfcf24bc224932e0271c55a6e6b9 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 10 Oct 2012 00:03:36 -0500 Subject: [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. --- config/apple | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/apple b/config/apple index a2d6ae4..34085e0 100644 --- a/config/apple +++ b/config/apple @@ -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 -- cgit v0.12