Bug 1331957 - Part 11: Specify the path to the cross-compiler toolchain libtool for OS X static analysis builds; r=froydnj
☠☠ backed out by 2a51c94218f2 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 23 Jan 2017 00:27:53 -0500
changeset 332379 82c98214febe19e2e75ae0552af6f3c932cf3525
parent 332378 f74c7a543525d772ca744c06b5523cda5178cd09
child 332380 a10f7732a754f14706b1ebb3a6158445bacfd427
push id31304
push usercbook@mozilla.com
push dateFri, 03 Feb 2017 12:25:47 +0000
treeherdermozilla-central@9f17a6fc04f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1331957
milestone54.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 1331957 - Part 11: Specify the path to the cross-compiler toolchain libtool for OS X static analysis builds; r=froydnj
build/build-clang/README
build/build-clang/build-clang.py
build/build-clang/clang-static-analysis-macosx64.json
--- a/build/build-clang/README
+++ b/build/build-clang/README
@@ -36,17 +36,18 @@ build-clang.py accepts a JSON config for
 * libcxx_repo: SVN path to the libcxx repo.
 * libcxxabi_repo: SVN path to the libcxxabi repo.
 * python_path: Path to the Python 2.7 installation on the machine building clang.
 * gcc_dir: Path to the gcc toolchain installation, only required on Linux.
 * cc: Path to the bootsraping C Compiler.
 * cxx: Path to the bootsraping C++ Compiler.
 * as: Path to the assembler tool.
 * ar: Path to the library archiver tool.
-* ranlib: Path to the ranlib tool.
+* ranlib: Path to the ranlib tool (optional).
+* libtool: Path to the libtool tool (optional).
 * ld: Path to the linker.
 * patches: Optional list of patches to apply per platform.  Supported platforms: macosx64, linux32, linux64.  The default is Release.
 * build_type: The type of build to make.  Supported types: Release, Debug, RelWithDebInfo or MinSizeRel.
 * build_libcxx: Whether to build with libcxx.  The default is false.
 * build_clang_tidy: Whether to build clang-tidy with the Mozilla checks imported.  The default is false.
 * osx_cross_compile: Whether to invoke CMake for OS X cross compile builds.
 * assertions: Whether to enable LLVM assertions.  The default is false.
 
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -195,17 +195,17 @@ def is_darwin():
 def is_linux():
     return platform.system() == "Linux"
 
 
 def is_windows():
     return platform.system() == "Windows"
 
 
-def build_one_stage(cc, cxx, asm, ld, ar, ranlib,
+def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
                     src_dir, stage_dir, build_libcxx,
                     osx_cross_compile, build_type, assertions,
                     python_path, gcc_dir, libcxx_include_dir):
     if not os.path.exists(stage_dir):
         os.mkdir(stage_dir)
 
     build_dir = stage_dir + "/build"
     inst_dir = stage_dir + "/clang"
@@ -241,16 +241,18 @@ def build_one_stage(cc, cxx, asm, ld, ar
                   "-DLLVM_TOOL_LIBCXX_BUILD=%s" % ("ON" if build_libcxx else "OFF"),
                   "-DLIBCXX_LIBCPPABI_VERSION=\"\"",
                   src_dir];
     if is_windows():
         cmake_args.insert(-1, "-DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON")
         cmake_args.insert(-1, "-DLLVM_USE_CRT_RELEASE=MT")
     if ranlib is not None:
         cmake_args += ["-DCMAKE_RANLIB=%s" % slashify_path(ranlib)]
+    if libtool is not None:
+        cmake_args += ["-DCMAKE_LIBTOOL=%s" % slashify_path(libtool)]
     if osx_cross_compile:
         cmake_args += ["-DCMAKE_SYSTEM_NAME=Darwin",
                        "-DCMAKE_SYSTEM_VERSION=10.10",
                        "-DLLVM_ENABLE_THREADS=OFF",
                        "-DLIBCXXABI_LIBCXX_INCLUDES=%s" % libcxx_include_dir,
                        "-DCMAKE_OSX_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
                        "-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")),
                        "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER",
@@ -464,16 +466,19 @@ if __name__ == "__main__":
     if is_linux() and gcc_dir is None:
         raise ValueError("Config file needs to set gcc_dir")
     cc = get_tool(config, "cc")
     cxx = get_tool(config, "cxx")
     asm = get_tool(config, "ml" if is_windows() else "as")
     ld = get_tool(config, "link" if is_windows() else "ld")
     ar = get_tool(config, "lib" if is_windows() else "ar")
     ranlib = None if is_windows() else get_tool(config, "ranlib")
+    libtool = None
+    if "libtool" in config:
+        libtool = get_tool(config, "libtool")
 
     if not os.path.exists(source_dir):
         os.makedirs(source_dir)
 
     def checkout_or_update(repo, checkout_dir):
         if os.path.exists(checkout_dir):
             svn_update(checkout_dir, llvm_revision)
         else:
@@ -574,48 +579,48 @@ if __name__ == "__main__":
         extra_ldflags = ["-Wl,-syslibroot,%s" % os.getenv("CROSS_SYSROOT"),
                          "-Wl,-dead_strip"]
 
     build_one_stage(
         [cc] + extra_cflags,
         [cxx] + extra_cxxflags,
         [asm] + extra_asmflags,
         [ld] + extra_ldflags,
-        ar, ranlib,
+        ar, ranlib, libtool,
         llvm_source_dir, stage1_dir, build_libcxx, osx_cross_compile,
         build_type, assertions, python_path, gcc_dir, libcxx_include_dir)
 
     if stages > 1:
         stage2_dir = build_dir + '/stage2'
         stage2_inst_dir = stage2_dir + '/clang'
         final_stage_dir = stage2_dir
         build_one_stage(
             [stage1_inst_dir + "/bin/%s%s" %
                 (cc_name, exe_ext)] + extra_cflags2,
             [stage1_inst_dir + "/bin/%s%s" %
                 (cxx_name, exe_ext)] + extra_cxxflags2,
             [stage1_inst_dir + "/bin/%s%s" %
                 (cc_name, exe_ext)] + extra_asmflags,
             [ld] + extra_ldflags,
-            ar, ranlib,
+            ar, ranlib, libtool,
             llvm_source_dir, stage2_dir, build_libcxx, osx_cross_compile,
             build_type, assertions, python_path, gcc_dir, libcxx_include_dir)
 
     if stages > 2:
         stage3_dir = build_dir + '/stage3'
         final_stage_dir = stage3_dir
         build_one_stage(
             [stage2_inst_dir + "/bin/%s%s" %
                 (cc_name, exe_ext)] + extra_cflags2,
             [stage2_inst_dir + "/bin/%s%s" %
                 (cxx_name, exe_ext)] + extra_cxxflags2,
             [stage2_inst_dir + "/bin/%s%s" %
                 (cc_name, exe_ext)] + extra_asmflags,
             [ld] + extra_ldflags,
-            ar, ranlib,
+            ar, ranlib, libtool,
             llvm_source_dir, stage3_dir, build_libcxx, osx_cross_compile,
             build_type, assertions, python_path, gcc_dir, libcxx_include_dir)
 
     package_name = "clang"
     if build_clang_tidy:
         prune_final_dir_for_clang_tidy(os.path.join(final_stage_dir, "clang"))
         package_name = "clang-tidy"
 
--- a/build/build-clang/clang-static-analysis-macosx64.json
+++ b/build/build-clang/clang-static-analysis-macosx64.json
@@ -12,16 +12,17 @@
     "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_390/final",
     "python_path": "/usr/bin/python2.7",
     "gcc_dir": "/home/worker/workspace/build/src/gcc",
     "cc": "/home/worker/workspace/build/src/clang/bin/clang",
     "cxx": "/home/worker/workspace/build/src/clang/bin/clang++",
     "as": "/home/worker/workspace/build/src/clang/bin/clang",
     "ar": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ar",
     "ranlib": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ranlib",
+    "libtool": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-libtool",
     "ld": "/home/worker/workspace/build/src/clang/bin/clang",
     "patches": {
         "macosx64": [
           "llvm-debug-frame.patch",
           "compiler-rt-cross-compile.patch",
           "pr28831-r280042.patch",
           "r277806.patch",
           "r285657.patch"