Bug 1481989 - Copy 32-bits libraries from gcc to clang. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 08 Aug 2018 14:03:17 +0900
changeset 430821 45b401d8443fe6b6ca4d08ec5a32cd56038a12f0
parent 430820 c8e81d19d4760b63638743c29a7d25d8dfceef8f
child 430822 3c4564c2f2d5b0b5fe4a0c1f80896484a0b0f5d7
push id106283
push usermh@glandium.org
push dateThu, 09 Aug 2018 20:54:52 +0000
treeherdermozilla-inbound@45b401d8443f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1481989
milestone63.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 1481989 - Copy 32-bits libraries from gcc to clang. r=froydnj We already copy the 64-bits libraries, but don't copy the 32-bits libraries, which prevents building for linux32 by default. Incidentally, this also makes the clang build system build the 32-bits compiler-rt libraries, allowing e.g. 32-bits PGO.
build/build-clang/build-clang.py
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -119,16 +119,19 @@ def install_libgcc(gcc_dir, clang_dir):
     clang_lib_dir = os.path.join(clang_dir, "lib", "gcc",
                                  "x86_64-unknown-linux-gnu",
                                  os.path.basename(libgcc_dir))
     mkdir_p(clang_lib_dir)
     copy_tree(libgcc_dir, clang_lib_dir)
     libgcc_dir = os.path.join(gcc_dir, "lib64")
     clang_lib_dir = os.path.join(clang_dir, "lib")
     copy_tree(libgcc_dir, clang_lib_dir)
+    libgcc_dir = os.path.join(gcc_dir, "lib32")
+    clang_lib_dir = os.path.join(clang_dir, "lib32")
+    copy_tree(libgcc_dir, clang_lib_dir)
     include_dir = os.path.join(gcc_dir, "include")
     clang_include_dir = os.path.join(clang_dir, "include")
     copy_tree(include_dir, clang_include_dir)
 
 
 def install_import_library(build_dir, clang_dir):
     shutil.copy2(os.path.join(build_dir, "lib", "clang.lib"),
                  os.path.join(clang_dir, "lib"))
@@ -289,17 +292,17 @@ def get_tool(config, key):
 #           * (nothing will be deleted here)
 #   share/
 #     clang/
 #       clang-format-diff.py
 #       clang-tidy-diff.py
 #       run-clang-tidy.py
 def prune_final_dir_for_clang_tidy(final_dir):
     # Make sure we only have what we expect.
-    dirs = ("bin", "include", "lib", "libexec", "msbuild-bin", "share", "tools")
+    dirs = ("bin", "include", "lib", "lib32", "libexec", "msbuild-bin", "share", "tools")
     for f in glob.glob("%s/*" % final_dir):
         if os.path.basename(f) not in dirs:
             raise Exception("Found unknown file %s in the final directory" % f)
         if not os.path.isdir(f):
             raise Exception("Expected %s to be a directory" % f)
 
     # In bin/, only keep clang-tidy and clang-apply-replacements. The last one
     # is used to auto-fix some of the issues detected by clang-tidy.