4 A script to build clang from source.
7 usage: build-clang.py [-h] -c CONFIG [--clean]
10 -h, --help show this help message and exit
11 -c CONFIG, --config CONFIG
12 Clang configuration file
13 --clean Clean the build directory
18 * Working build toolchain.
24 Please use the latest available CMake for your platform to avoid surprises.
29 build-clang.py accepts a JSON config format with the following fields:
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 * ld: Path to the linker.
38 * patches: Optional list of patches to apply.
39 * build_type: The type of build to make. Supported types: Release, Debug, RelWithDebInfo or MinSizeRel.
40 * targets: The targets supported by the final stage LLVM/clang.
41 * build_clang_tidy: Whether to build clang-tidy with the Mozilla checks imported. The default is false.
42 * osx_cross_compile: Whether to invoke CMake for OS X cross compile builds.
43 * assertions: Whether to enable LLVM assertions. The default is false.
44 * pgo: Whether to build with PGO (requires stages == 4). The default is false.
46 The revisions are defined in taskcluster/kinds/fetch/toolchains.yml. They are usually commit sha1s corresponding to upstream tags.
51 The following environment variables are used for cross-compile builds targeting OS X on Linux.
53 * OSX_SYSROOT: Path to the OS X SDK directory for cross compile builds.