summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-09-11 11:37:26 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-09-11 11:37:26 -0400
commit51fb2f2d7baa17462ec6962d3a64375fb143bc11 (patch)
treea0b300183c14a014f4c7f9ece41eb6998eb4e7bc
parent31c42f8c88e6c280119813d68a70ad522a6b94a2 (diff)
Disable C optimization in debug mode
-rw-r--r--src/compiler.sml10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index de6b14b4..3fbc6008 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1322,11 +1322,17 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
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) =