1# Sample TOML configuration file for building Rust. 2# 3# To configure rustbuild, run `./configure` or `./x.py setup`. 4# See https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#create-a-configtoml for more information. 5# 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 10# system. 11 12# ============================================================================= 13# Global Settings 14# ============================================================================= 15 16# Use different pre-set defaults than the global defaults. 17# 18# See `src/bootstrap/defaults` for more information. 19# Note that this has no default value (x.py uses the defaults in `config.example.toml`). 20#profile = <none> 21 22# Keeps track of the last version of `x.py` used. 23# If `changelog-seen` does not match the version that is currently running, 24# `x.py` will prompt you to update it and to read the changelog. 25# See `src/bootstrap/CHANGELOG.md` for more information. 26changelog-seen = 2 27 28# ============================================================================= 29# Tweaking how LLVM is compiled 30# ============================================================================= 31[llvm] 32 33# Whether to use Rust CI built LLVM instead of locally building it. 34# 35# Unless you're developing for a target where Rust CI doesn't build a compiler 36# toolchain or changing LLVM locally, you probably want to leave this enabled. 37# 38# All tier 1 targets are currently supported; set this to `"if-available"` if 39# you are not sure whether you're on a tier 1 target. 40# 41# We also currently only support this when building LLVM for the build triple. 42# 43# Note that many of the LLVM options are not currently supported for 44# downloading. Currently only the "assertions" option can be toggled. 45#download-ci-llvm = if rust.channel == "dev" { "if-available" } else { false } 46 47# Indicates whether the LLVM build is a Release or Debug build 48#optimize = true 49 50# Indicates whether LLVM should be built with ThinLTO. Note that this will 51# only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++ 52# toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below). 53# More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap 54#thin-lto = false 55 56# Indicates whether an LLVM Release build should include debug info 57#release-debuginfo = false 58 59# Indicates whether the LLVM assertions are enabled or not 60# NOTE: When assertions are disabled, bugs in the integration between rustc and LLVM can lead to 61# unsoundness (segfaults, etc.) in the rustc process itself, not just in the generated code. 62#assertions = false 63 64# Indicates whether the LLVM testsuite is enabled in the build or not. Does 65# not execute the tests as part of the build as part of x.py build et al, 66# just makes it possible to do `ninja check-llvm` in the staged LLVM build 67# directory when doing LLVM development as part of Rust development. 68#tests = false 69 70# Indicates whether the LLVM plugin is enabled or not 71#plugins = false 72 73# Indicates whether ccache is used when building LLVM. Set to `true` to use the first `ccache` in 74# PATH, or set an absolute path to use a specific version. 75#ccache = false 76 77# When true, link libstdc++ statically into the rustc_llvm. 78# This is useful if you don't want to use the dynamic version of that 79# library provided by LLVM. 80#static-libstdcpp = false 81 82# Whether to use Ninja to build LLVM. This runs much faster than make. 83#ninja = true 84 85# LLVM targets to build support for. 86# Note: this is NOT related to Rust compilation targets. However, as Rust is 87# dependent on LLVM for code generation, turning targets off here WILL lead to 88# the resulting rustc being unable to compile for the disabled architectures. 89# 90# To add support for new targets, see https://rustc-dev-guide.rust-lang.org/building/new-target.html. 91#targets = "AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86" 92 93# LLVM experimental targets to build support for. These targets are specified in 94# the same format as above, but since these targets are experimental, they are 95# not built by default and the experimental Rust compilation targets that depend 96# on them will not work unless the user opts in to building them. 97#experimental-targets = "AVR;M68k" 98 99# Cap the number of parallel linker invocations when compiling LLVM. 100# This can be useful when building LLVM with debug info, which significantly 101# increases the size of binaries and consequently the memory required by 102# each linker process. 103# If set to 0, linker invocations are treated like any other job and 104# controlled by rustbuild's -j parameter. 105#link-jobs = 0 106 107# Whether to build LLVM as a dynamically linked library (as opposed to statically linked). 108# Under the hood, this passes `--shared` to llvm-config. 109# NOTE: To avoid performing LTO multiple times, we suggest setting this to `true` when `thin-lto` is enabled. 110#link-shared = llvm.thin-lto 111 112# When building llvm, this configures what is being appended to the version. 113# To use LLVM version as is, provide an empty string. 114#version-suffix = if rust.channel == "dev" { "-rust-dev" } else { "-rust-$version-$channel" } 115 116# On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass 117# with clang-cl, so this is special in that it only compiles LLVM with clang-cl. 118# Note that this takes a /path/to/clang-cl, not a boolean. 119#clang-cl = cc 120 121# Pass extra compiler and linker flags to the LLVM CMake build. 122#cflags = "" 123#cxxflags = "" 124#ldflags = "" 125 126# Use libc++ when building LLVM instead of libstdc++. This is the default on 127# platforms already use libc++ as the default C++ library, but this option 128# allows you to use libc++ even on platforms when it's not. You need to ensure 129# that your host compiler ships with libc++. 130#use-libcxx = false 131 132# The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake. 133#use-linker = <none> (path) 134 135# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES` 136#allow-old-toolchain = false 137 138# Whether to include the Polly optimizer. 139#polly = false 140 141# Whether to build the clang compiler. 142#clang = false 143 144# Whether to enable llvm compilation warnings. 145#enable-warnings = false 146 147# Custom CMake defines to set when building LLVM. 148#build-config = {} 149 150# ============================================================================= 151# General build configuration options 152# ============================================================================= 153[build] 154 155# The default stage to use for the `check` subcommand 156#check-stage = 0 157 158# The default stage to use for the `doc` subcommand 159#doc-stage = 0 160 161# The default stage to use for the `build` subcommand 162#build-stage = 1 163 164# The default stage to use for the `test` subcommand 165#test-stage = 1 166 167# The default stage to use for the `dist` subcommand 168#dist-stage = 2 169 170# The default stage to use for the `install` subcommand 171#install-stage = 2 172 173# The default stage to use for the `bench` subcommand 174#bench-stage = 2 175 176# Build triple for the pre-compiled snapshot compiler. If `rustc` is set, this must match its host 177# triple (see `rustc --version --verbose`; cross-compiling the rust build system itself is NOT 178# supported). If `rustc` is unset, this must be a platform with pre-compiled host tools 179# (https://doc.rust-lang.org/nightly/rustc/platform-support.html). The current platform must be 180# able to run binaries of this build triple. 181# 182# If `rustc` is present in path, this defaults to the host it was compiled for. 183# Otherwise, `x.py` will try to infer it from the output of `uname`. 184# If `uname` is not found in PATH, we assume this is `x86_64-pc-windows-msvc`. 185# This may be changed in the future. 186#build = "x86_64-unknown-linux-gnu" (as an example) 187 188# Which triples to produce a compiler toolchain for. Each of these triples will be bootstrapped from 189# the build triple themselves. In other words, this is the list of triples for which to build a 190# compiler that can RUN on that triple. 191# 192# Defaults to just the `build` triple. 193#host = [build.build] (list of triples) 194 195# Which triples to build libraries (core/alloc/std/test/proc_macro) for. Each of these triples will 196# be bootstrapped from the build triple themselves. In other words, this is the list of triples for 197# which to build a library that can CROSS-COMPILE to that triple. 198# 199# Defaults to `host`. If you set this explicitly, you likely want to add all 200# host triples to this list as well in order for those host toolchains to be 201# able to compile programs for their native target. 202#target = build.host (list of triples) 203 204# Use this directory to store build artifacts. Paths are relative to the current directory, not to 205# the root of the repository. 206#build-dir = "build" 207 208# Instead of downloading the src/stage0.json version of Cargo specified, use 209# this Cargo binary instead to build all Rust code 210# If you set this, you likely want to set `rustc` as well. 211#cargo = "/path/to/cargo" 212 213# Instead of downloading the src/stage0.json version of the compiler 214# specified, use this rustc binary instead as the stage0 snapshot compiler. 215# If you set this, you likely want to set `cargo` as well. 216#rustc = "/path/to/rustc" 217 218# Instead of downloading the src/stage0.json version of rustfmt specified, 219# use this rustfmt binary instead as the stage0 snapshot rustfmt. 220#rustfmt = "/path/to/rustfmt" 221 222# Whether to build documentation by default. If false, rustdoc and 223# friends will still be compiled but they will not be used to generate any 224# documentation. 225# 226# You can still build documentation when this is disabled by explicitly passing paths, 227# e.g. `x doc library`. 228#docs = true 229 230# Flag to specify whether CSS, JavaScript, and HTML are minified when 231# docs are generated. JSON is always minified, because it's enormous, 232# and generated in already-minified form from the beginning. 233#docs-minification = true 234 235# Flag to specify whether private items should be included in the library docs. 236#library-docs-private-items = false 237 238# Indicate whether to build compiler documentation by default. 239# You can still build documentation when this is disabled by explicitly passing a path: `x doc compiler`. 240#compiler-docs = false 241 242# Indicate whether git submodules are managed and updated automatically. 243#submodules = true 244 245# The path to (or name of) the GDB executable to use. This is only used for 246# executing the debuginfo test suite. 247#gdb = "gdb" 248 249# The node.js executable to use. Note that this is only used for the emscripten 250# target when running tests, otherwise this can be omitted. 251#nodejs = "node" 252 253# The npm executable to use. Note that this is used for rustdoc-gui tests, 254# otherwise this can be omitted. 255# 256# Under Windows this should be `npm.cmd` or path to it (verified on nodejs v18.06), or 257# error will be emitted. 258#npm = "npm" 259 260# Python interpreter to use for various tasks throughout the build, notably 261# rustdoc tests, the lldb python interpreter, and some dist bits and pieces. 262# 263# Defaults to the Python interpreter used to execute x.py. 264#python = "python" 265 266# The path to the REUSE executable to use. Note that REUSE is not required in 267# most cases, as our tooling relies on a cached (and shrunk) copy of the 268# REUSE output present in the git repository and in our source tarballs. 269# 270# REUSE is only needed if your changes caused the overall licensing of the 271# repository to change, and the cached copy has to be regenerated. 272# 273# Defaults to the "reuse" command in the system path. 274#reuse = "reuse" 275 276# Force Cargo to check that Cargo.lock describes the precise dependency 277# set that all the Cargo.toml files create, instead of updating it. 278#locked-deps = false 279 280# Indicate whether the vendored sources are used for Rust dependencies or not. 281# 282# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you 283# want to use vendoring. See 284# https://forge.rust-lang.org/infra/other-installation-methods.html#source-code. 285#vendor = false 286 287# Typically the build system will build the Rust compiler twice. The second 288# compiler, however, will simply use its own libraries to link against. If you 289# would rather to perform a full bootstrap, compiling the compiler three times, 290# then you can set this option to true. 291# 292# This is only useful for verifying that rustc generates reproducible builds. 293#full-bootstrap = false 294 295# Enable a build of the extended Rust tool set which is not only the compiler 296# but also tools such as Cargo. This will also produce "combined installers" 297# which are used to install Rust and Cargo together. This is disabled by 298# default. The `tools` option (immediately below) specifies which tools should 299# be built if `extended = true`. 300#extended = false 301 302# Set of tools to be included in the installation. 303# 304# If `extended = false`, the only one of these built by default is rustdoc. 305# 306# If `extended = true`, they're all included, with the exception of 307# rust-demangler which additionally requires `profiler = true` to be set. 308# 309# If any enabled tool fails to build, the installation fails. 310#tools = [ 311# "cargo", 312# "clippy", 313# "rustdoc", 314# "rustfmt", 315# "rust-analyzer", 316# "analysis", 317# "src", 318# "rust-demangler", # if profiler = true 319#] 320 321# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation 322#verbose = 0 323 324# Build the sanitizer runtimes 325#sanitizers = false 326 327# Build the profiler runtime (required when compiling with options that depend 328# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`). 329#profiler = false 330 331# Indicates whether the native libraries linked into Cargo will be statically 332# linked or not. 333#cargo-native-static = false 334 335# Run the build with low priority, by setting the process group's "nice" value 336# to +10 on Unix platforms, and by using a "low priority" job object on Windows. 337#low-priority = false 338 339# Arguments passed to the `./configure` script, used during distcheck. You 340# probably won't fill this in but rather it's filled in by the `./configure` 341# script. Useful for debugging. 342#configure-args = [] 343 344# Indicates that a local rebuild is occurring instead of a full bootstrap, 345# essentially skipping stage0 as the local compiler is recompiling itself again. 346# Useful for modifying only the stage2 compiler without having to pass `--keep-stage 0` each time. 347#local-rebuild = false 348 349# Print out how long each rustbuild step took (mostly intended for CI and 350# tracking over time) 351#print-step-timings = false 352 353# Print out resource usage data for each rustbuild step, as defined by the Unix 354# struct rusage. (Note that this setting is completely unstable: the data it 355# captures, what platforms it supports, the format of its associated output, and 356# this setting's very existence, are all subject to change.) 357#print-step-rusage = false 358 359# Always patch binaries for usage with Nix toolchains. If `true` then binaries 360# will be patched unconditionally. If `false` or unset, binaries will be patched 361# only if the current distribution is NixOS. This option is useful when using 362# a Nix toolchain on non-NixOS distributions. 363#patch-binaries-for-nix = false 364 365# Collect information and statistics about the current build and writes it to 366# disk. Enabling this or not has no impact on the resulting build output. The 367# schema of the file generated by the build metrics feature is unstable, and 368# this is not intended to be used during local development. 369#metrics = false 370 371# ============================================================================= 372# General install configuration options 373# ============================================================================= 374[install] 375 376# Where to install the generated toolchain. Must be an absolute path. 377#prefix = "/usr/local" 378 379# Where to install system configuration files. 380# If this is a relative path, it will get installed in `prefix` above 381#sysconfdir = "/etc" 382 383# Where to install documentation in `prefix` above 384#docdir = "share/doc/rust" 385 386# Where to install binaries in `prefix` above 387#bindir = "bin" 388 389# Where to install libraries in `prefix` above 390#libdir = "lib" 391 392# Where to install man pages in `prefix` above 393#mandir = "share/man" 394 395# Where to install data in `prefix` above 396#datadir = "share" 397 398# ============================================================================= 399# Options for compiling Rust code itself 400# ============================================================================= 401[rust] 402 403# Whether or not to optimize the compiler and standard library. 404# WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping, 405# building without optimizations takes much longer than optimizing. Further, some platforms 406# fail to build without this optimization (c.f. #65352). 407#optimize = true 408 409# Indicates that the build should be configured for debugging Rust. A 410# `debug`-enabled compiler and standard library will be somewhat 411# slower (due to e.g. checking of debug assertions) but should remain 412# usable. 413# 414# Note: If this value is set to `true`, it will affect a number of 415# configuration options below as well, if they have been left 416# unconfigured in this file. 417# 418# Note: changes to the `debug` setting do *not* affect `optimize` 419# above. In theory, a "maximally debuggable" environment would 420# set `optimize` to `false` above to assist the introspection 421# facilities of debuggers like lldb and gdb. To recreate such an 422# environment, explicitly set `optimize` to `false` and `debug` 423# to `true`. In practice, everyone leaves `optimize` set to 424# `true`, because an unoptimized rustc with debugging 425# enabled becomes *unusably slow* (e.g. rust-lang/rust#24840 426# reported a 25x slowdown) and bootstrapping the supposed 427# "maximally debuggable" environment (notably libstd) takes 428# hours to build. 429# 430#debug = false 431 432# Whether to download the stage 1 and 2 compilers from CI. 433# This is mostly useful for tools; if you have changes to `compiler/` or `library/` they will be ignored. 434# 435# Set this to "if-unchanged" to only download if the compiler and standard library have not been modified. 436# Set this to `true` to download unconditionally (useful if e.g. you are only changing doc-comments). 437#download-rustc = false 438 439# Number of codegen units to use for each compiler invocation. A value of 0 440# means "the number of cores on this machine", and 1+ is passed through to the 441# compiler. 442# 443# Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units 444#codegen-units = if incremental { 256 } else { 16 } 445 446# Sets the number of codegen units to build the standard library with, 447# regardless of what the codegen-unit setting for the rest of the compiler is. 448# NOTE: building with anything other than 1 is known to occasionally have bugs. 449# See https://github.com/rust-lang/rust/issues/83600. 450#codegen-units-std = codegen-units 451 452# Whether or not debug assertions are enabled for the compiler and standard library. 453# These can help find bugs at the cost of a small runtime slowdown. 454# 455# Defaults to rust.debug value 456#debug-assertions = rust.debug (boolean) 457 458# Whether or not debug assertions are enabled for the standard library. 459# Overrides the `debug-assertions` option, if defined. 460# 461# Defaults to rust.debug-assertions value 462#debug-assertions-std = rust.debug-assertions (boolean) 463 464# Whether or not to leave debug! and trace! calls in the rust binary. 465# 466# Defaults to rust.debug-assertions value 467# 468# If you see a message from `tracing` saying "some trace filter directives would enable traces that 469# are disabled statically" because `max_level_info` is enabled, set this value to `true`. 470#debug-logging = rust.debug-assertions (boolean) 471 472# Whether or not overflow checks are enabled for the compiler and standard 473# library. 474# 475# Defaults to rust.debug value 476#overflow-checks = rust.debug (boolean) 477 478# Whether or not overflow checks are enabled for the standard library. 479# Overrides the `overflow-checks` option, if defined. 480# 481# Defaults to rust.overflow-checks value 482#overflow-checks-std = rust.overflow-checks (boolean) 483 484# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`. 485# `0` - no debug info 486# `1` - line tables only - sufficient to generate backtraces that include line 487# information and inlined functions, set breakpoints at source code 488# locations, and step through execution in a debugger. 489# `2` - full debug info with variable and type information 490# Can be overridden for specific subsets of Rust code (rustc, std or tools). 491# Debuginfo for tests run with compiletest is not controlled by this option 492# and needs to be enabled separately with `debuginfo-level-tests`. 493# 494# Note that debuginfo-level = 2 generates several gigabytes of debuginfo 495# and will slow down the linking process significantly. 496#debuginfo-level = if rust.debug { 1 } else { 0 } 497 498# Debuginfo level for the compiler. 499#debuginfo-level-rustc = rust.debuginfo-level 500 501# Debuginfo level for the standard library. 502#debuginfo-level-std = rust.debuginfo-level 503 504# Debuginfo level for the tools. 505#debuginfo-level-tools = rust.debuginfo-level 506 507# Debuginfo level for the test suites run with compiletest. 508# FIXME(#61117): Some tests fail when this option is enabled. 509#debuginfo-level-tests = 0 510 511# Should rustc be build with split debuginfo? Default is platform dependent. 512# Valid values are the same as those accepted by `-C split-debuginfo` 513# (`off`/`unpacked`/`packed`). 514# 515# On Linux, split debuginfo is disabled by default. 516# 517# On Apple platforms, unpacked split debuginfo is used by default. Unpacked 518# debuginfo does not run `dsymutil`, which packages debuginfo from disparate 519# object files into a single `.dSYM` file. `dsymutil` adds time to builds for 520# no clear benefit, and also makes it more difficult for debuggers to find 521# debug info. The compiler currently defaults to running `dsymutil` to preserve 522# its historical default, but when compiling the compiler itself, we skip it by 523# default since we know it's safe to do so in that case. 524# 525# On Windows platforms, packed debuginfo is the only supported option, 526# producing a `.pdb` file. 527#split-debuginfo = if linux { off } else if windows { packed } else if apple { unpacked } 528 529# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE) 530#backtrace = true 531 532# Whether to always use incremental compilation when building rustc 533#incremental = false 534 535# Build a multi-threaded rustc 536# FIXME(#75760): Some UI tests fail when this option is enabled. 537# NOTE: This option is NOT SUPPORTED. See #48685. 538#parallel-compiler = false 539 540# The default linker that will be hard-coded into the generated 541# compiler for targets that don't specify a default linker explicitly 542# in their target specifications. Note that this is not the linker 543# used to link said compiler. It can also be set per-target (via the 544# `[target.<triple>]` block), which may be useful in a cross-compilation 545# setting. 546# 547# See https://doc.rust-lang.org/rustc/codegen-options/index.html#linker for more information. 548#default-linker = <none> (path) 549 550# The "channel" for the Rust build to produce. The stable/beta channels only 551# allow using stable features, whereas the nightly and dev channels allow using 552# nightly features 553#channel = "dev" 554 555# A descriptive string to be appended to `rustc --version` output, which is 556# also used in places like debuginfo `DW_AT_producer`. This may be useful for 557# supplementary build information, like distro-specific package versions. 558# 559# The Rust compiler will differentiate between versions of itself, including 560# based on this string, which means that if you wish to be compatible with 561# upstream Rust you need to set this to "". However, note that if you are not 562# actually compatible -- for example if you've backported patches that change 563# behavior -- this may lead to miscompilations or other bugs. 564#description = "" 565 566# The root location of the musl installation directory. The library directory 567# will also need to contain libunwind.a for an unwinding implementation. Note 568# that this option only makes sense for musl targets that produce statically 569# linked binaries. 570# 571# Defaults to /usr on musl hosts. Has no default otherwise. 572#musl-root = <platform specific> (path) 573 574# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix 575# platforms to ensure that the compiler is usable by default from the build 576# directory (as it links to a number of dynamic libraries). This may not be 577# desired in distributions, for example. 578#rpath = true 579 580# Indicates whether `rustc` should be stripped of symbols using `-Cstrip=symbols`. 581#strip = false 582 583# Indicates whether `rustc` should be compiled with stack protectors. 584# Valid options are : `none`(default),`basic`,`strong`, or `all`. 585#stack-protector = "none" 586 587# Prints each test name as it is executed, to help debug issues in the test harness itself. 588#verbose-tests = false 589 590# Flag indicating whether tests are compiled with optimizations (the -O flag). 591#optimize-tests = true 592 593# Flag indicating whether codegen tests will be run or not. If you get an error 594# saying that the FileCheck executable is missing, you may want to disable this. 595# Also see the target's llvm-filecheck option. 596#codegen-tests = true 597 598# Flag indicating whether git info will be retrieved from .git automatically. 599# Having the git information can cause a lot of rebuilds during development. 600# 601# FIXME(#76720): this can causes bugs if different compilers reuse the same metadata cache. 602#omit-git-hash = if rust.channel == "dev" { true } else { false } 603 604# Whether to create a source tarball by default when running `x dist`. 605# 606# You can still build a source tarball when this is disabled by explicitly passing `x dist rustc-src`. 607#dist-src = true 608 609# After building or testing an optional component (e.g. the nomicon or reference), append the 610# result (broken, compiling, testing) into this JSON file. 611#save-toolstates = <none> (path) 612 613# This is an array of the codegen backends that will be compiled for the rustc 614# that's being compiled. The default is to only build the LLVM codegen backend, 615# and currently the only standard options supported are `"llvm"`, `"cranelift"` 616# and `"gcc"`. The first backend in this list will be used as default by rustc 617# when no explicit backend is specified. 618#codegen-backends = ["llvm"] 619 620# Indicates whether LLD will be compiled and made available in the sysroot for 621# rustc to execute. 622#lld = false 623 624# Indicates whether LLD will be used to link Rust crates during bootstrap on 625# supported platforms. The LLD from the bootstrap distribution will be used 626# and not the LLD compiled during the bootstrap. 627# 628# LLD will not be used if we're cross linking. 629# 630# Explicitly setting the linker for a target will override this option when targeting MSVC. 631#use-lld = false 632 633# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the 634# sysroot. 635#llvm-tools = false 636 637# Whether to deny warnings in crates 638#deny-warnings = true 639 640# Print backtrace on internal compiler errors during bootstrap 641#backtrace-on-ice = false 642 643# Whether to verify generated LLVM IR 644#verify-llvm-ir = false 645 646# Compile the compiler with a non-default ThinLTO import limit. This import 647# limit controls the maximum size of functions imported by ThinLTO. Decreasing 648# will make code compile faster at the expense of lower runtime performance. 649#thin-lto-import-instr-limit = if incremental { 10 } else { LLVM default (currently 100) } 650 651# Map debuginfo paths to `/rust/$sha/...`. 652# Useful for reproducible builds. Generally only set for releases 653#remap-debuginfo = false 654 655# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator. 656# This option is only tested on Linux and OSX. 657#jemalloc = false 658 659# Run tests in various test suites with the "nll compare mode" in addition to 660# running the tests in normal mode. Largely only used on CI and during local 661# development of NLL 662#test-compare-mode = false 663 664# Global default for llvm-libunwind for all targets. See the target-specific 665# documentation for llvm-libunwind below. Note that the target-specific 666# option will override this if set. 667#llvm-libunwind = 'no' 668 669# Enable Windows Control Flow Guard checks in the standard library. 670# This only applies from stage 1 onwards, and only for Windows targets. 671#control-flow-guard = false 672 673# Enable symbol-mangling-version v0. This can be helpful when profiling rustc, 674# as generics will be preserved in symbols (rather than erased into opaque T). 675# When no setting is given, the new scheme will be used when compiling the 676# compiler and its tools and the legacy scheme will be used when compiling the 677# standard library. 678# If an explicit setting is given, it will be used for all parts of the codebase. 679#new-symbol-mangling = true|false (see comment) 680 681# Select LTO mode that will be used for compiling rustc. By default, thin local LTO 682# (LTO within a single crate) is used (like for any Rust crate). You can also select 683# "thin" or "fat" to apply Thin/Fat LTO to the `rustc_driver` dylib, or "off" to disable 684# LTO entirely. 685#lto = "thin-local" 686 687# Build compiler with the optimization enabled and -Zvalidate-mir, currently only for `std` 688#validate-mir-opts = 3 689 690# Copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain. 691# Only applies when the host or target is pc-windows-gnu. 692#include-mingw-linker = true 693 694# ============================================================================= 695# Options for specific targets 696# 697# Each of the following options is scoped to the specific target triple in 698# question and is used for determining how to compile each target. 699# ============================================================================= 700[target.x86_64-unknown-linux-gnu] 701 702# C compiler to be used to compile C code. Note that the 703# default value is platform specific, and if not specified it may also depend on 704# what platform is crossing to what platform. 705# See `src/bootstrap/cc_detect.rs` for details. 706#cc = "cc" (path) 707 708# C++ compiler to be used to compile C++ code (e.g. LLVM and our LLVM shims). 709# This is only used for host targets. 710# See `src/bootstrap/cc_detect.rs` for details. 711#cxx = "c++" (path) 712 713# Archiver to be used to assemble static libraries compiled from C/C++ code. 714# Note: an absolute path should be used, otherwise LLVM build will break. 715#ar = "ar" (path) 716 717# Ranlib to be used to assemble static libraries compiled from C/C++ code. 718# Note: an absolute path should be used, otherwise LLVM build will break. 719#ranlib = "ranlib" (path) 720 721# Linker to be used to bootstrap Rust code. Note that the 722# default value is platform specific, and if not specified it may also depend on 723# what platform is crossing to what platform. 724# Setting this will override the `use-lld` option for Rust code when targeting MSVC. 725#linker = "cc" (path) 726 727# Path to the `llvm-config` binary of the installation of a custom LLVM to link 728# against. Note that if this is specified we don't compile LLVM at all for this 729# target. 730#llvm-config = <none> (path) 731 732# Override detection of whether this is a Rust-patched LLVM. This would be used 733# in conjunction with either an llvm-config or build.submodules = false. 734#llvm-has-rust-patches = if llvm-config { false } else { true } 735 736# Normally the build system can find LLVM's FileCheck utility, but if 737# not, you can specify an explicit file name for it. 738#llvm-filecheck = "/path/to/llvm-version/bin/FileCheck" 739 740# Use LLVM libunwind as the implementation for Rust's unwinder. 741# Accepted values are 'in-tree' (formerly true), 'system' or 'no' (formerly false). 742# This option only applies for Linux and Fuchsia targets. 743# On Linux target, if crt-static is not enabled, 'no' means dynamic link to 744# `libgcc_s.so`, 'in-tree' means static link to the in-tree build of llvm libunwind 745# and 'system' means dynamic link to `libunwind.so`. If crt-static is enabled, 746# the behavior is depend on the libc. On musl target, 'no' and 'in-tree' both 747# means static link to the in-tree build of llvm libunwind, and 'system' means 748# static link to `libunwind.a` provided by system. Due to the limitation of glibc, 749# it must link to `libgcc_eh.a` to get a working output, and this option have no effect. 750#llvm-libunwind = 'no' if Linux, 'in-tree' if Fuchsia 751 752# If this target is for Android, this option will be required to specify where 753# the NDK for the target lives. This is used to find the C compiler to link and 754# build native code. 755# See `src/bootstrap/cc_detect.rs` for details. 756#android-ndk = <none> (path) 757 758# Build the sanitizer runtimes for this target. 759# This option will override the same option under [build] section. 760#sanitizers = build.sanitizers (bool) 761 762# Build the profiler runtime for this target(required when compiling with options that depend 763# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`). 764# This option will override the same option under [build] section. 765#profiler = build.profiler (bool) 766 767# This option supports enable `rpath` in each target independently, 768# and will override the same option under [rust] section. It only works on Unix platforms 769#rpath = rust.rpath (bool) 770 771# Force static or dynamic linkage of the standard library for this target. If 772# this target is a host for rustc, this will also affect the linkage of the 773# compiler itself. This is useful for building rustc on targets that normally 774# only use static libraries. If unset, the target's default linkage is used. 775#crt-static = <platform-specific> (bool) 776 777# The root location of the musl installation directory. The library directory 778# will also need to contain libunwind.a for an unwinding implementation. Note 779# that this option only makes sense for musl targets that produce statically 780# linked binaries. 781#musl-root = build.musl-root (path) 782 783# The full path to the musl libdir. 784#musl-libdir = musl-root/lib 785 786# The root location of the `wasm32-wasi` sysroot. Only used for the 787# `wasm32-wasi` target. If you are building wasm32-wasi target, make sure to 788# create a `[target.wasm32-wasi]` section and move this field there. 789#wasi-root = <none> (path) 790 791# Used in testing for configuring where the QEMU images are located, you 792# probably don't want to use this. 793#qemu-rootfs = <none> (path) 794 795# Skip building the `std` library for this target. Enabled by default for 796# target triples containing `-none`, `nvptx`, `switch`, or `-uefi`. 797#no-std = <platform-specific> (bool) 798 799# ============================================================================= 800# Distribution options 801# 802# These options are related to distribution, mostly for the Rust project itself. 803# You probably won't need to concern yourself with any of these options 804# ============================================================================= 805[dist] 806 807# This is the folder of artifacts that the build system will sign. All files in 808# this directory will be signed with the default gpg key using the system `gpg` 809# binary. The `asc` and `sha256` files will all be output into the standard dist 810# output folder (currently `build/dist`) 811# 812# This folder should be populated ahead of time before the build system is 813# invoked. 814#sign-folder = <none> (path) 815 816# The remote address that all artifacts will eventually be uploaded to. The 817# build system generates manifests which will point to these urls, and for the 818# manifests to be correct they'll have to have the right URLs encoded. 819# 820# Note that this address should not contain a trailing slash as file names will 821# be appended to it. 822#upload-addr = <none> (URL) 823 824# Whether to build a plain source tarball to upload 825# We disable that on Windows not to override the one already uploaded on S3 826# as the one built on Windows will contain backslashes in paths causing problems 827# on linux 828#src-tarball = true 829 830# Whether to allow failures when building tools 831#missing-tools = false 832 833# List of compression formats to use when generating dist tarballs. The list of 834# formats is provided to rust-installer, which must support all of them. 835# 836# This list must be non-empty. 837#compression-formats = ["gz", "xz"] 838 839# How much time should be spent compressing the tarballs. The better the 840# compression profile, the longer compression will take. 841# 842# Available options: fast, balanced, best 843#compression-profile = "fast" 844