Backed out changeset 4191b252db9b (bug 1886734) for causing build bustages @netwerk...
[gecko.git] / build / build-clang / README
blob5b13edeeb91e21011df15594c1f2e9e370f52285
1 build-clang.py
2 ==============
4 A script to build clang from source.
6 ```
7 usage: build-clang.py [-h] -c CONFIG [--clean]
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 ```
16 Pre-requisites
17 --------------
18 * Working build toolchain.
19 * git
20 * CMake
21 * Ninja
22 * Python 2.7 and 3
24 Please use the latest available CMake for your platform to avoid surprises.
26 Config file format
27 ------------------
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/ci/fetch/toolchains.yml. They are usually commit sha1s corresponding to upstream tags.
48 Environment Variables
49 ---------------------
51 The following environment variables are used for cross-compile builds targeting OS X on Linux.
53 * CROSS_SYSROOT: Path to the OS X SDK directory for cross compile builds.