1 # Sample TOML configuration file for building Rust.
3 # To configure rustbuild, copy this file to the directory from which you will be
4 # running the build, and name it config.toml.
6 # All options are commented out by default in this file, and they're commented
7 # out with their default values. The build system by default looks for
8 # `config.toml` in the current directory of a build for build configuration, but
9 # a custom configuration file can also be specified with `--config` to the build
12 # =============================================================================
13 # Tweaking how LLVM is compiled
14 # =============================================================================
17 # Indicates whether rustc will support compilation with LLVM
18 # note: rustc does not compile without LLVM at the moment
21 # Indicates whether the LLVM build is a Release or Debug build
24 # Indicates whether LLVM should be built with ThinLTO. Note that this will
25 # only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++
26 # toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below).
27 # More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap
30 # Indicates whether an LLVM Release build should include debug info
31 #release-debuginfo = false
33 # Indicates whether the LLVM assertions are enabled or not
36 # Indicates whether ccache is used when building LLVM
38 # or alternatively ...
39 #ccache = "/path/to/ccache"
41 # If an external LLVM root is specified, we automatically check the version by
42 # default to make sure it's within the range that we're expecting, but setting
43 # this flag will indicate that this version check should not be done.
46 # Link libstdc++ statically into the librustc_llvm instead of relying on a
47 # dynamic version to be available.
48 #static-libstdcpp = false
50 # Tell the LLVM build system to use Ninja instead of the platform default for
51 # the generated build system. This can sometimes be faster than make, for
55 # LLVM targets to build support for.
56 # Note: this is NOT related to Rust compilation targets. However, as Rust is
57 # dependent on LLVM for code generation, turning targets off here WILL lead to
58 # the resulting rustc being unable to compile for the disabled architectures.
59 # Also worth pointing out is that, in case support for new targets are added to
60 # LLVM, enabling them here doesn't mean Rust is automatically gaining said
61 # support. You'll need to write a target specification at least, and most
62 # likely, teach rustc about the C ABI of the target. Get in touch with the
63 # Rust team and file an issue if you need assistance in porting!
64 #targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon"
66 # LLVM experimental targets to build support for. These targets are specified in
67 # the same format as above, but since these targets are experimental, they are
68 # not built by default and the experimental Rust compilation targets that depend
69 # on them will not work unless the user opts in to building them. By default the
70 # `WebAssembly` and `RISCV` targets are enabled when compiling LLVM from scratch.
71 #experimental-targets = "WebAssembly;RISCV"
73 # Cap the number of parallel linker invocations when compiling LLVM.
74 # This can be useful when building LLVM with debug info, which significantly
75 # increases the size of binaries and consequently the memory required by
76 # each linker process.
77 # If absent or 0, linker invocations are treated like any other job and
78 # controlled by rustbuild's -j parameter.
81 # When invoking `llvm-config` this configures whether the `--shared` argument is
82 # passed to prefer linking to shared libraries.
85 # When building llvm, this configures what is being appended to the version.
86 # If absent, we let the version as-is.
87 #version-suffix = "-rust"
89 # On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
90 # with clang-cl, so this is special in that it only compiles LLVM with clang-cl
91 #clang-cl = '/path/to/clang-cl.exe'
93 # Pass extra compiler and linker flags to the LLVM CMake build.
94 #cflags = "-fextra-flag"
95 #cxxflags = "-fextra-flag"
96 #ldflags = "-Wl,extra-flag"
98 # Use libc++ when building LLVM instead of libstdc++. This is the default on
99 # platforms already use libc++ as the default C++ library, but this option
100 # allows you to use libc++ even on platforms when it's not. You need to ensure
101 # that your host compiler ships with libc++.
104 # The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.
107 # Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`
108 #allow-old-toolchain = false
110 # =============================================================================
111 # General build configuration options
112 # =============================================================================
115 # Build triple for the original snapshot compiler. This must be a compiler that
116 # nightlies are already produced for. The current platform must be able to run
117 # binaries of this build triple and the nightly will be used to bootstrap the
119 #build = "x86_64-unknown-linux-gnu" # defaults to your host platform
121 # In addition to the build triple, other triples to produce full compiler
122 # toolchains for. Each of these triples will be bootstrapped from the build
123 # triple and then will continue to bootstrap themselves. This platform must
124 # currently be able to run all of the triples provided here.
125 #host = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
127 # In addition to all host triples, other triples to produce the standard library
128 # for. Each host triple will be used to produce a copy of the standard library
129 # for each target triple.
130 #target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
132 # Instead of downloading the src/stage0.txt version of Cargo specified, use
133 # this Cargo binary instead to build all Rust code
134 #cargo = "/path/to/bin/cargo"
136 # Instead of downloading the src/stage0.txt version of the compiler
137 # specified, use this rustc binary instead as the stage0 snapshot compiler.
138 #rustc = "/path/to/bin/rustc"
140 # Flag to specify whether any documentation is built. If false, rustdoc and
141 # friends will still be compiled but they will not be used to generate any
145 # Indicate whether the compiler should be documented in addition to the standard
146 # library and facade crates.
147 #compiler-docs = false
149 # Indicate whether submodules are managed and updated automatically.
152 # Update submodules only when the checked out commit in the submodules differs
153 # from what is committed in the main rustc repo.
154 #fast-submodules = true
156 # The path to (or name of) the GDB executable to use. This is only used for
157 # executing the debuginfo test suite.
160 # The node.js executable to use. Note that this is only used for the emscripten
161 # target when running tests, otherwise this can be omitted.
164 # Python interpreter to use for various tasks throughout the build, notably
165 # rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
166 # Note that Python 2 is currently required.
168 # Defaults to python2.7, then python2. If neither executable can be found, then
169 # it defaults to the Python interpreter used to execute x.py.
170 #python = "python2.7"
172 # Force Cargo to check that Cargo.lock describes the precise dependency
173 # set that all the Cargo.toml files create, instead of updating it.
176 # Indicate whether the vendored sources are used for Rust dependencies or not
179 # Typically the build system will build the rust compiler twice. The second
180 # compiler, however, will simply use its own libraries to link against. If you
181 # would rather to perform a full bootstrap, compiling the compiler three times,
182 # then you can set this option to true. You shouldn't ever need to set this
184 #full-bootstrap = false
186 # Enable a build of the extended rust tool set which is not only the compiler
187 # but also tools such as Cargo. This will also produce "combined installers"
188 # which are used to install Rust and Cargo together. This is disabled by
192 # Installs chosen set of extended tools if enables. By default builds all.
193 # If chosen tool failed to build the installation fails.
194 #tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]
196 # Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
199 # Build the sanitizer runtimes
202 # Build the profiler runtime
205 # Indicates whether the native libraries linked into Cargo will be statically
207 #cargo-native-static = false
209 # Run the build with low priority, by setting the process group's "nice" value
210 # to +10 on Unix platforms, and by using a "low priority" job object on Windows.
211 #low-priority = false
213 # Arguments passed to the `./configure` script, used during distcheck. You
214 # probably won't fill this in but rather it's filled in by the `./configure`
218 # Indicates that a local rebuild is occurring instead of a full bootstrap,
219 # essentially skipping stage0 as the local compiler is recompiling itself again.
220 #local-rebuild = false
222 # Print out how long each rustbuild step took (mostly intended for CI and
223 # tracking over time)
224 #print-step-timings = false
226 # =============================================================================
227 # General install configuration options
228 # =============================================================================
231 # Instead of installing to /usr/local, install to this path instead.
232 #prefix = "/usr/local"
234 # Where to install system configuration files
235 # If this is a relative path, it will get installed in `prefix` above
238 # Where to install documentation in `prefix` above
239 #docdir = "share/doc/rust"
241 # Where to install binaries in `prefix` above
244 # Where to install libraries in `prefix` above
247 # Where to install man pages in `prefix` above
248 #mandir = "share/man"
250 # Where to install data in `prefix` above (currently unused)
253 # Where to install additional info in `prefix` above (currently unused)
254 #infodir = "share/info"
256 # Where to install local state (currently unused)
257 # If this is a relative path, it will get installed in `prefix` above
258 #localstatedir = "/var/lib"
260 # =============================================================================
261 # Options for compiling Rust code itself
262 # =============================================================================
265 # Whether or not to optimize the compiler and standard library.
267 # Note: the slowness of the non optimized compiler compiling itself usually
268 # outweighs the time gains in not doing optimizations, therefore a
269 # full bootstrap takes much more time with `optimize` set to false.
272 # Indicates that the build should be configured for debugging Rust. A
273 # `debug`-enabled compiler and standard library will be somewhat
274 # slower (due to e.g. checking of debug assertions) but should remain
277 # Note: If this value is set to `true`, it will affect a number of
278 # configuration options below as well, if they have been left
279 # unconfigured in this file.
281 # Note: changes to the `debug` setting do *not* affect `optimize`
282 # above. In theory, a "maximally debuggable" environment would
283 # set `optimize` to `false` above to assist the introspection
284 # facilities of debuggers like lldb and gdb. To recreate such an
285 # environment, explicitly set `optimize` to `false` and `debug`
286 # to `true`. In practice, everyone leaves `optimize` set to
287 # `true`, because an unoptimized rustc with debugging
288 # enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
289 # reported a 25x slowdown) and bootstrapping the supposed
290 # "maximally debuggable" environment (notably libstd) takes
295 # Number of codegen units to use for each compiler invocation. A value of 0
296 # means "the number of cores on this machine", and 1+ is passed through to the
300 # Sets the number of codegen units to build the standard library with,
301 # regardless of what the codegen-unit setting for the rest of the compiler is.
302 #codegen-units-std = 1
304 # Whether or not debug assertions are enabled for the compiler and standard
306 #debug-assertions = false
308 # Whether or not debuginfo is emitted
311 # Whether or not line number debug information is emitted
312 #debuginfo-lines = false
314 # Whether or not to only build debuginfo for the standard library if enabled.
315 # If enabled, this will not compile the compiler with debuginfo, just the
317 #debuginfo-only-std = false
319 # Enable debuginfo for the extended tools: cargo, rls, rustfmt
320 # Adding debuginfo makes them several times larger.
321 #debuginfo-tools = false
323 # Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
326 # Whether to always use incremental compilation when building rustc
329 # Build a multi-threaded rustc
330 #parallel-compiler = false
332 # The default linker that will be hard-coded into the generated compiler for
333 # targets that don't specify linker explicitly in their target specifications.
334 # Note that this is not the linker used to link said compiler.
335 #default-linker = "cc"
337 # The "channel" for the Rust build to produce. The stable/beta channels only
338 # allow using stable features, whereas the nightly and dev channels allow using
342 # By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
343 # platforms to ensure that the compiler is usable by default from the build
344 # directory (as it links to a number of dynamic libraries). This may not be
345 # desired in distributions, for example.
348 # Emits extraneous output from tests to ensure that failures of the test
349 # harness are debuggable just from logfiles.
350 #verbose-tests = false
352 # Flag indicating whether tests are compiled with optimizations (the -O flag) or
353 # with debuginfo (the -g flag)
354 #optimize-tests = true
355 #debuginfo-tests = true
357 # Flag indicating whether codegen tests will be run or not. If you get an error
358 # saying that the FileCheck executable is missing, you may want to disable this.
359 # Also see the target's llvm-filecheck option.
360 #codegen-tests = true
362 # Flag indicating whether git info will be retrieved from .git automatically.
363 # Having the git information can cause a lot of rebuilds during development.
364 # Note: If this attribute is not explicitly set (e.g. if left commented out) it
365 # will default to true if channel = "dev", but will default to false otherwise.
368 # When creating source tarballs whether or not to create a source tarball.
371 # Whether to also run the Miri tests suite when running tests.
372 # As a side-effect also generates MIR for all libraries.
375 # After building or testing extended tools (e.g. clippy and rustfmt), append the
376 # result (broken, compiling, testing) into this JSON file.
377 #save-toolstates = "/path/to/toolstates.json"
379 # This is an array of the codegen backends that will be compiled for the rustc
380 # that's being compiled. The default is to only build the LLVM codegen backend,
381 # but you can also optionally enable the "emscripten" backend for asm.js or
382 # make this an empty array (but that probably won't get too far in the
384 #codegen-backends = ["llvm"]
386 # This is the name of the directory in which codegen backends will get installed
387 #codegen-backends-dir = "codegen-backends"
389 # Flag indicating whether `libstd` calls an imported function to handle basic IO
390 # when targeting WebAssembly. Enable this to debug tests for the `wasm32-unknown-unknown`
391 # target, as without this option the test output will not be captured.
392 #wasm-syscall = false
394 # Indicates whether LLD will be compiled and made available in the sysroot for
398 # Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
402 # Indicates whether LLDB will be made available in the sysroot.
403 # This is only built if LLVM is also being built.
406 # Whether to deny warnings in crates
407 #deny-warnings = true
409 # Print backtrace on internal compiler errors during bootstrap
410 #backtrace-on-ice = false
412 # Whether to verify generated LLVM IR
413 #verify-llvm-ir = false
415 # Map all debuginfo paths for libstd and crates to `/rust/$sha/$crate/...`,
416 # generally only set for releases
417 #remap-debuginfo = false
419 # Link the compiler against `jemalloc`, where on Linux and OSX it should
420 # override the default allocator for rustc and LLVM.
423 # Run tests in various test suites with the "nll compare mode" in addition to
424 # running the tests in normal mode. Largely only used on CI and during local
426 #test-compare-mode = false
428 # =============================================================================
429 # Options for specific targets
431 # Each of the following options is scoped to the specific target triple in
432 # question and is used for determining how to compile each target.
433 # =============================================================================
434 [target.x86_64-unknown-linux-gnu]
436 # C compiler to be used to compiler C code. Note that the
437 # default value is platform specific, and if not specified it may also depend on
438 # what platform is crossing to what platform.
441 # C++ compiler to be used to compiler C++ code (e.g. LLVM and our LLVM shims).
442 # This is only used for host targets.
445 # Archiver to be used to assemble static libraries compiled from C/C++ code.
446 # Note: an absolute path should be used, otherwise LLVM build will break.
449 # Ranlib to be used to assemble static libraries compiled from C/C++ code.
450 # Note: an absolute path should be used, otherwise LLVM build will break.
453 # Linker to be used to link Rust code. Note that the
454 # default value is platform specific, and if not specified it may also depend on
455 # what platform is crossing to what platform.
458 # Path to the `llvm-config` binary of the installation of a custom LLVM to link
459 # against. Note that if this is specified we don't compile LLVM at all for this
461 #llvm-config = "../path/to/llvm/root/bin/llvm-config"
463 # Normally the build system can find LLVM's FileCheck utility, but if
464 # not, you can specify an explicit file name for it.
465 #llvm-filecheck = "/path/to/FileCheck"
467 # If this target is for Android, this option will be required to specify where
468 # the NDK for the target lives. This is used to find the C compiler to link and
470 #android-ndk = "/path/to/ndk"
472 # Force static or dynamic linkage of the standard library for this target. If
473 # this target is a host for rustc, this will also affect the linkage of the
474 # compiler itself. This is useful for building rustc on targets that normally
475 # only use static libraries. If unset, the target's default linkage is used.
478 # The root location of the MUSL installation directory. The library directory
479 # will also need to contain libunwind.a for an unwinding implementation. Note
480 # that this option only makes sense for MUSL targets that produce statically
484 # Used in testing for configuring where the QEMU images are located, you
485 # probably don't want to use this.
488 # =============================================================================
489 # Distribution options
491 # These options are related to distribution, mostly for the Rust project itself.
492 # You probably won't need to concern yourself with any of these options
493 # =============================================================================
496 # This is the folder of artifacts that the build system will sign. All files in
497 # this directory will be signed with the default gpg key using the system `gpg`
498 # binary. The `asc` and `sha256` files will all be output into the standard dist
499 # output folder (currently `build/dist`)
501 # This folder should be populated ahead of time before the build system is
503 #sign-folder = "path/to/folder/to/sign"
505 # This is a file which contains the password of the default gpg key. This will
506 # be passed to `gpg` down the road when signing all files in `sign-folder`
507 # above. This should be stored in plaintext.
508 #gpg-password-file = "path/to/gpg/password"
510 # The remote address that all artifacts will eventually be uploaded to. The
511 # build system generates manifests which will point to these urls, and for the
512 # manifests to be correct they'll have to have the right URLs encoded.
514 # Note that this address should not contain a trailing slash as file names will
516 #upload-addr = "https://example.com/folder"
518 # Whether to build a plain source tarball to upload
519 # We disable that on Windows not to override the one already uploaded on S3
520 # as the one built on Windows will contain backslashes in paths causing problems
525 # Whether to allow failures when building tools
526 #missing-tools = false