Debian Codegraph @

build/build-clang/README

raw
1 build-clang.py
2 ==============
3
4 A script to build clang from source.
5
6 ```
7 usage: build-clang.py [-h] -c CONFIG [--clean]
8
9 optional 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
16 Pre-requisites
17 --------------
18 * Working build toolchain.
19 * git
20 * CMake
21 * Ninja
22 * Python 2.7 and 3
23
24 Please use the latest available CMake for your platform to avoid surprises.
25
26 Config file format
27 ------------------
28
29 build-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 * 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.
45
46 The revisions are defined in taskcluster/kinds/fetch/toolchains.yml. They are usually commit sha1s corresponding to upstream tags.
47
48 Environment Variables
49 ---------------------
50
51 The following environment variables are used for cross-compile builds targeting OS X on Linux.
52
53 * OSX_SYSROOT: Path to the OS X SDK directory for cross compile builds.