Bug 785772 - Don't use -O0 during stage1 on darwin. r=rail.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Mon, 27 Aug 2012 10:20:46 -0400
changeset 105597 f400c8e5cea46069f4e68b2b801eb34ba810a250
parent 105596 5acb2a155d121f7686460c30e2dacd40cea315a4
child 105598 fd72dbbd692012224145be1bf13df1d7675fd277
child 105602 a6890a3b8f7287f642e72f7b8f7d8df85196b39d
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersrail
bugs785772
milestone17.0a1
Bug 785772 - Don't use -O0 during stage1 on darwin. r=rail. We only need to build stage1 with -O0 on linux because of a bug in the gcc 4.5 we use.
build/unix/build-clang/build-clang.py
--- a/build/unix/build-clang/build-clang.py
+++ b/build/unix/build-clang/build-clang.py
@@ -65,32 +65,33 @@ llvm_source_dir = source_dir + "/llvm"
 clang_source_dir = source_dir + "/clang"
 compiler_rt_source_dir = source_dir + "/compiler-rt"
 
 def build_one_stage(env, stage_dir, is_stage_one):
     def f():
         build_one_stage_aux(stage_dir, is_stage_one)
     with_env(env, f)
 
+isDarwin = platform.system() == "Darwin"
+
 def build_one_stage_aux(stage_dir, is_stage_one):
     os.mkdir(stage_dir)
 
     build_dir = stage_dir + "/build"
     inst_dir = stage_dir + "/clang"
 
     configure_opts = ["--enable-optimized",
                       "--disable-assertions",
                       "--prefix=%s" % inst_dir,
                       "--with-gcc-toolchain=/tools/gcc-4.5-0moz3"]
-    if is_stage_one:
+    if is_stage_one and not isDarwin:
         configure_opts.append("--with-optimize-option=-O0")
 
     build_package(llvm_source_dir, build_dir, configure_opts)
 
-isDarwin = platform.system() == "Darwin"
 if isDarwin:
     os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
 
 if not os.path.exists(source_dir):
     os.makedirs(source_dir)
     svn_co("http://llvm.org/svn/llvm-project/llvm/trunk",
            llvm_source_dir, llvm_revision)
     svn_co("http://llvm.org/svn/llvm-project/cfe/trunk",