summaryrefslogtreecommitdiff
path: root/src
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
commitb6ad8fe5b4adacea14831171734f954969a72e23 (patch)
treea0b300183c14a014f4c7f9ece41eb6998eb4e7bc /src
parent299943c475ee8fa62e353d4431a4365d9db2c0ca (diff)
Disable C optimization in debug mode
Diffstat (limited to 'src')
-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) =