diff --git a/build/unix/build-clang/README b/build/unix/build-clang/README new file mode 100644 index 00000000000..58b3d7aa16f --- /dev/null +++ b/build/unix/build-clang/README @@ -0,0 +1,30 @@ +build-clang.py +============== + +A script to build clang from source. + +``` +usage: build-clang.py [-h] -c CONFIG [--clean] + +optional arguments: + -h, --help show this help message and exit + -c CONFIG, --config CONFIG + Clang configuration file + --clean Clean the build directory +``` + +Config file format +------------------ + +build-clang.py accepts a JSON config format with the following fields: + +* llvm_revision: The LLVM SVN revision to build. +* stages: Use 1, 2, or 3 to select different compiler stages. The default is 3. +* llvm_repo: SVN path to the LLVM repo. +* 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. +* 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. +* assertions: Whether to enable LLVM assertions. The default is false. diff --git a/build/unix/build-clang/clang-static-analysis-linux64.json b/build/unix/build-clang/clang-static-analysis-linux64.json new file mode 100644 index 00000000000..46bdfe5236e --- /dev/null +++ b/build/unix/build-clang/clang-static-analysis-linux64.json @@ -0,0 +1,16 @@ +{ + "llvm_revision": "247539", + "stages": "3", + "build_libcxx": false, + "build_type": "Release", + "assertions": false, + "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk", + "clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk", + "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk", + "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk", + "patches": { + "macosx64": ["llvm-debug-frame.patch"], + "linux64": ["llvm-debug-frame.patch"], + "linux32": ["llvm-debug-frame.patch"] + } +} diff --git a/build/unix/build-clang/clang-trunk.json b/build/unix/build-clang/clang-static-analysis-macosx64.json similarity index 86% rename from build/unix/build-clang/clang-trunk.json rename to build/unix/build-clang/clang-static-analysis-macosx64.json index 8b3f7c074fd..4335b248d04 100644 --- a/build/unix/build-clang/clang-trunk.json +++ b/build/unix/build-clang/clang-static-analysis-macosx64.json @@ -1,6 +1,9 @@ { "llvm_revision": "247539", "stages": "3", + "build_libcxx": true, + "build_type": "Release", + "assertions": false, "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk", "clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk", "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",