changeset 1558:6fe6bda2b928

Disable C optimization in debug mode
author Adam Chlipala <adam@chlipala.net>
date Sun, 11 Sep 2011 11:37:26 -0400
parents 4a13e1b73641
children df6a7a22760a
files src/compiler.sml
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/compiler.sml	Sat Sep 03 12:56:05 2011 -0400
+++ b/src/compiler.sml	Sun Sep 11 11:37:26 2011 -0400
@@ -1322,11 +1322,17 @@
                   else
                       "-L" ^ Config.lib ^ "/.. -lurweb " ^ #linkDynamic proto
 
-        val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value -O3 -I " ^ Config.includ
+        val opt = if debug then
+                      ""
+                  else
+                      " -O3"
+
+        val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value"
+                      ^ opt ^ " -I " ^ Config.includ
                       ^ " " ^ #compile proto
                       ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname
 
-        val link = Config.ccompiler ^ " -Werror -O3 -lm " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs
+        val link = Config.ccompiler ^ " -Werror" ^ opt ^ " -lm " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs
                    ^ " " ^ lib ^ " " ^ Config.openssl ^ " " ^ escapeFilename oname ^ " -o " ^ escapeFilename ename ^ " " ^ libs
 
         val (compile, link) =