Commit 29ec9b13 authored by Wander Lairson Costa's avatar Wander Lairson Costa
Browse files

Bug 1273981 part 1: Add libc++ to clang. r=glandium

We need to rebuild clang with libc++ to get compatible headers for cross
builds. libc++abi is a dependency of libc++, as the build instructions
says [0].

[0] http://libcxx.llvm.org/docs/BuildingLibcxx.html
parent 67a7df95
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ build-clang.py accepts a JSON config format with the following fields:
* clang_repo: SVN path to the Clang repo.
* compiler_repo: SVN path to the compiler-rt repo.
* 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.
+11 −2
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ if __name__ == "__main__":
    clang_source_dir = source_dir + "/clang"
    compiler_rt_source_dir = source_dir + "/compiler-rt"
    libcxx_source_dir = source_dir + "/libcxx"
    libcxxabi_source_dir = source_dir + "/libcxxabi"

    if is_darwin():
        os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
@@ -251,6 +252,7 @@ if __name__ == "__main__":
    clang_repo = config["clang_repo"]
    compiler_repo = config["compiler_repo"]
    libcxx_repo = config["libcxx_repo"]
    libcxxabi_repo = config.get("libcxxabi_repo")
    stages = 3
    if "stages" in config:
        stages = int(config["stages"])
@@ -303,6 +305,8 @@ if __name__ == "__main__":
        svn_co(source_dir, clang_repo, clang_source_dir, llvm_revision)
        svn_co(source_dir, compiler_repo, compiler_rt_source_dir, llvm_revision)
        svn_co(source_dir, libcxx_repo, libcxx_source_dir, llvm_revision)
        if libcxxabi_repo:
            svn_co(source_dir, libcxxabi_repo, libcxxabi_source_dir, llvm_revision)
        for p in config.get("patches", {}).get(get_platform(), []):
            patch(p, source_dir)
    else:
@@ -310,13 +314,17 @@ if __name__ == "__main__":
        svn_update(clang_source_dir, llvm_revision)
        svn_update(compiler_rt_source_dir, llvm_revision)
        svn_update(libcxx_source_dir, llvm_revision)
        if libcxxabi_repo:
            svn_update(libcxxabi_source_dir, llvm_revision)

    symlinks = [(source_dir + "/clang",
                 llvm_source_dir + "/tools/clang"),
                (source_dir + "/compiler-rt",
                 llvm_source_dir + "/projects/compiler-rt"),
                (source_dir + "/libcxx",
                 llvm_source_dir + "/projects/libcxx")]
                 llvm_source_dir + "/projects/libcxx"),
                (source_dir + "/libcxxabi",
                 llvm_source_dir + "/projects/libcxxabi")]
    for l in symlinks:
        # On Windows, we have to re-copy the whole directory every time.
        if not is_windows() and os.path.islink(l[1]):
@@ -325,6 +333,7 @@ if __name__ == "__main__":
            shutil.rmtree(l[1])
        elif os.path.exists(l[1]):
            os.unlink(l[1])
        if os.path.exists(l[0]):
            symlink(l[0], l[1])

    if not os.path.exists(build_dir):
+2 −1
Original line number Diff line number Diff line
{
    "llvm_revision": "262557",
    "stages": "3",
    "build_libcxx": false,
    "build_libcxx": true,
    "build_type": "Release",
    "assertions": false,
    "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_380/final",
    "clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_380/final",
    "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_380/final",
    "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_380/final",
    "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_380/final",
    "python_path": "/usr/bin/python2.7",
    "gcc_dir": "/home/worker/workspace/build/src/gcc",
    "cc": "/home/worker/workspace/build/src/gcc/bin/gcc",