comparison src/compiler.sml @ 1558:6fe6bda2b928

Disable C optimization in debug mode
author Adam Chlipala <adam@chlipala.net>
date Sun, 11 Sep 2011 11:37:26 -0400
parents 659a2f71f5e5
children 154cfe2eb366
comparison
equal deleted inserted replaced
1557:4a13e1b73641 1558:6fe6bda2b928
1320 val lib = if Settings.getStaticLinking () then 1320 val lib = if Settings.getStaticLinking () then
1321 #linkStatic proto ^ " " ^ Config.lib ^ "/../liburweb.a" 1321 #linkStatic proto ^ " " ^ Config.lib ^ "/../liburweb.a"
1322 else 1322 else
1323 "-L" ^ Config.lib ^ "/.. -lurweb " ^ #linkDynamic proto 1323 "-L" ^ Config.lib ^ "/.. -lurweb " ^ #linkDynamic proto
1324 1324
1325 val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value -O3 -I " ^ Config.includ 1325 val opt = if debug then
1326 ""
1327 else
1328 " -O3"
1329
1330 val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value"
1331 ^ opt ^ " -I " ^ Config.includ
1326 ^ " " ^ #compile proto 1332 ^ " " ^ #compile proto
1327 ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname 1333 ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname
1328 1334
1329 val link = Config.ccompiler ^ " -Werror -O3 -lm " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs 1335 val link = Config.ccompiler ^ " -Werror" ^ opt ^ " -lm " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs
1330 ^ " " ^ lib ^ " " ^ Config.openssl ^ " " ^ escapeFilename oname ^ " -o " ^ escapeFilename ename ^ " " ^ libs 1336 ^ " " ^ lib ^ " " ^ Config.openssl ^ " " ^ escapeFilename oname ^ " -o " ^ escapeFilename ename ^ " " ^ libs
1331 1337
1332 val (compile, link) = 1338 val (compile, link) =
1333 if profile then 1339 if profile then
1334 (compile ^ " -pg", link ^ " -pg") 1340 (compile ^ " -pg", link ^ " -pg")