fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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