Bug 1203388 - Add support for building clang targeted for CentOS6 build machines; r=rail
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 10 Sep 2015 00:28:13 -0400
changeset 261881 0f88a6861417daaf397c2b4714a8ebdfe6379e2c
parent 261880 d77d81aaff9922e759ef94409b151abb09a19f9d
child 261882 4c42d55c2455b134fbc72ad19a1036804a6f53d0
push id64867
push usereakhgari@mozilla.com
push dateFri, 11 Sep 2015 05:59:39 +0000
treeherdermozilla-inbound@4c42d55c2455 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrail
bugs1203388
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203388 - Add support for building clang targeted for CentOS6 build machines; r=rail
build/unix/build-clang/build-clang.py
--- a/build/unix/build-clang/build-clang.py
+++ b/build/unix/build-clang/build-clang.py
@@ -6,16 +6,18 @@
 import os
 import os.path
 import shutil
 import subprocess
 import platform
 import json
 import argparse
 
+centOS6 = False
+
 
 def check_run(args):
     r = subprocess.call(args)
     assert r == 0
 
 
 def run_in(path, args):
     d = os.getcwd()
@@ -89,21 +91,27 @@ def build_one_stage_aux(stage_dir, llvm_
     targets = ["x86", "x86_64"]
     # The Darwin equivalents of binutils appear to have intermittent problems
     # with objects in compiler-rt that are compiled for arm.  Since the arm
     # support is only necessary for iOS (which we don't support), only enable
     # arm support on Linux.
     if not is_darwin():
         targets.append("arm")
 
+    global centOS6
+    if centOS6:
+        python_path = "/usr/bin/python2.7"
+    else:
+        python_path = "/usr/local/bin/python2.7"
+
     configure_opts = ["--enable-optimized",
                       "--enable-targets=" + ",".join(targets),
                       "--disable-assertions",
                       "--disable-libedit",
-                      "--with-python=/usr/local/bin/python2.7",
+                      "--with-python=%s" % python_path,
                       "--prefix=%s" % inst_dir,
                       "--with-gcc-toolchain=%s" % gcc_toolchain_dir,
                       "--disable-compiler-version-checks"]
     build_package(llvm_source_dir, build_dir, configure_opts, [])
 
 if __name__ == "__main__":
     # The directories end up in the debug info, so the easy way of getting
     # a reproducible build is to run it in a know absolute directory.
@@ -114,17 +122,21 @@ if __name__ == "__main__":
     source_dir = base_dir + "/src"
     build_dir = base_dir + "/build"
 
     llvm_source_dir = source_dir + "/llvm"
     clang_source_dir = source_dir + "/clang"
     compiler_rt_source_dir = source_dir + "/compiler-rt"
     libcxx_source_dir = source_dir + "/libcxx"
 
-    gcc_dir = "/tools/gcc-4.7.3-0moz1"
+    global centOS6
+    if centOS6:
+        gcc_dir = "/home/worker/workspace/build/src/gcc"
+    else:
+        gcc_dir = "/tools/gcc-4.7.3-0moz1"
 
     if is_darwin():
         os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
 
     parser = argparse.ArgumentParser()
     parser.add_argument('-c', '--config', required=True,
                         type=argparse.FileType('r'),
                         help="Clang configuration file")