README
1build-clang.py
2==============
3
4A script to build clang from source.
5
6```
7usage: build-clang.py [-h] -c CONFIG [--clean]
8
9optional arguments:
10 -h, --help show this help message and exit
11 -c CONFIG, --config CONFIG
12 Clang configuration file
13 --clean Clean the build directory
14```
15
16Pre-requisites
17--------------
18* Working build toolchain.
19* git
20* CMake
21* Ninja
22* Python 2.7 and 3
23
24Please use the latest available CMake for your platform to avoid surprises.
25
26Config file format
27------------------
28
29build-clang.py accepts a JSON config format with the following fields:
30
31* stages: Use 1, 2, 3 or 4 to select different compiler stages. The default is 2.
32* cc: Path to the bootsraping C Compiler.
33* cxx: Path to the bootsraping C++ Compiler.
34* as: Path to the assembler tool.
35* ar: Path to the library archiver tool.
36* ranlib: Path to the ranlib tool (optional).
37* libtool: Path to the libtool tool (optional).
38* ld: Path to the linker.
39* patches: Optional list of patches to apply.
40* build_type: The type of build to make. Supported types: Release, Debug, RelWithDebInfo or MinSizeRel.
41* build_libcxx: Whether to build with libcxx. The default is false.
42* build_clang_tidy: Whether to build clang-tidy with the Mozilla checks imported. The default is false.
43* osx_cross_compile: Whether to invoke CMake for OS X cross compile builds.
44* assertions: Whether to enable LLVM assertions. The default is false.
45* pgo: Whether to build with PGO (requires stages == 4). The default is false.
46
47The revisions are defined in taskcluster/ci/fetch/toolchains.yml. They are usually commit sha1s corresponding to upstream tags.
48
49Environment Variables
50---------------------
51
52The following environment variables are used for cross-compile builds targeting OS X on Linux.
53
54* CROSS_CCTOOLS_PATH: Path to the cctools directory where the cross compiler toolchain is located.
55* CROSS_SYSROOT: Path to the OS X SDK directory for cross compile builds.
56