[m-rev.] diff: avoid excessive compilation times on Mac OS X in debug grades

Julien Fischer juliensf at csse.unimelb.edu.au
Mon May 17 18:18:52 AEST 2010


On Mac OS X force the debug grades to be compiled by GCC at -O0.
Using -O2 (the default), results in excessive compilation times.
(There is at least one open GCC bug, #26854, concerning excessive
compilation times on Darwin - it is likely we are also bumping
into this.)

(I will update mmc --make separately.)

scripts/mgnuc.in:
 	On Darwin compile debug grades at -O0 when using GCC.
 	This avoid excessive compilation times due to performance
 	bugs in GCC.

Julien.

Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.127
diff -u -r1.127 mgnuc.in
--- scripts/mgnuc.in	11 Feb 2010 04:36:11 -0000	1.127
+++ scripts/mgnuc.in	17 May 2010 07:53:50 -0000
@@ -610,6 +610,18 @@
      esac
  esac

+# At -O2 compilation times on Mac OS X are extremely slow for
+# Apple GCC 4.{0,2}.  We must force GCC to use -O0 here in order
+# to get acceptable compilation times.
+
+case $FULLARCH in *apple*darwin*)
+    case $debug in true)
+        case $COMPILER in gcc)
+            OVERRIDE_OPTS="$OVERRIDE_OPTS -O0"
+        esac
+    esac
+esac
+
  case $assemble in true)
      case $verbose in true)
          echo $AS $AS_OPTS "$@" ;;

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list