Commit Graph

230 Commits

Author SHA1 Message Date
Matthias Krüger
23beda44ea
Rollup merge of #108581 - jfgoog:include-mingw-linker, r=petrochenkov
Add a new config flag, dist.include-mingw-linker.

The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain.

It applies only when the host or target is pc-windows-gnu.

The flag is true by default to preserve existing behavior.
2023-03-07 19:57:44 +01:00
Yuki Okushi
a7b9488599
Rollup merge of #108619 - jyn514:llvm-version-check, r=cuviper
Remove the option to disable `llvm-version-check`

We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range.

r? ``@cuviper`` on whether we want to do this or not, since you maintain rust on Fedora and touched this config last.
2023-03-07 23:06:21 +09:00
Joshua Nelson
8becfed1c9 Remove the option to disable llvm-version-check
We don't support old versions of LLVM; there's no reason to have an easy
way to force bootstrap to use them anyway. If someone really needs to
use an unsupported version, they can modify bootstrap to change the
version range.
2023-03-05 14:42:15 +00:00
Matthias Krüger
925baa8b37
Rollup merge of #108613 - jyn514:rm-skip-rebuild, r=Mark-Simulacrum
Remove `llvm.skip-rebuild` option

This was added to in 2019 to speed up rebuild times when LLVM was modified. Now that download-ci-llvm exists, I don't think it makes sense to support an unsound option like this that can lead to miscompiles; and the code cleanup is nice too.

r? `@Mark-Simulacrum` cc `@varkor` #65612
2023-03-05 14:29:08 +01:00
Alex Huang
00f98e6810 ./configure script should only show blocks (and associated comments) where it is not default 2023-03-03 17:27:29 -05:00
Joshua Nelson
daf99a437e Remove llvm.skip-rebuild option
This was added to in 2019 to speed up rebuild times when LLVM was
modified. Now that download-ci-llvm exists, I don't think it makes sense
to support an unsound option like this that can lead to miscompiles; and
the code cleanup is nice too.
2023-03-01 10:49:28 -06:00
James Farrell
848f6f9b0d Add a new config flag, dist.include-mingw-linker.
The flag controls whether to copy the linker, DLLs, and various
libraries from MinGW into the rustc toolchain.

It applies only when the host or target is pc-windows-gnu.

The flag is true by default to preserve existing behavior.
2023-02-28 20:37:05 +00:00
yukang
34813e2051 Test that the compiler/library builds with -Zmir-opt-level=3 -Zvalidate-mir 2023-02-24 08:07:43 +00:00
bors
f02439dea7 Auto merge of #107241 - clubby789:bootstrap-lto-off, r=simulacrum
Add `rust.lto=off` to bootstrap and set as compiler/library default

Closes #107202

The issue mentions `embed-bitcode=on`, but here c8e6a9e8b6/src/bootstrap/compile.rs (L379-L381)
it appears that this is always set for std stage 1+, so I'm unsure if changes are needed here.

`@rustbot` label +A-bootstrap
2023-02-03 01:19:04 +00:00
clubby789
2adf26fc72 Add rust.lto=off to bootstrap 2023-01-26 12:24:48 +00:00
Pietro Albini
bba274fabb
add option to include private items in library docs 2023-01-24 17:00:45 +01:00
David Tolnay
11e002a001
Make stage2 rustdoc and proc-macro-srv disableable in x.py install 2023-01-14 14:44:02 -08:00
Matthias Krüger
1ce18d2d65
Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-Simulacrum
Set `download-ci-llvm = "if-available"` by default when `channel = dev`

See https://github.com/rust-lang/compiler-team/issues/566. The motivation for changing the default is to avoid downloading and building LLVM when someone runs `x build` before running `x setup`. The motivation for only doing it on `channel = "dev"` is to avoid breaking distros or users installing from source. It works because `dev` is also the default channel.

The diff looks larger than it is; most of it is moving the `llvm` branch below the `rust` so `config.channel` is set.

r? `@Mark-Simulacrum` cc `@oli-obk` `@bjorn3` `@cuviper`
2022-12-10 09:24:41 +01:00
Pietro Albini
f8a7123b27
address review feedback 2022-11-24 17:25:35 +01:00
Joshua Nelson
ac672621c0 Set download-ci-llvm = "if-available" by default when channel = "dev"
See https://github.com/rust-lang/compiler-team/issues/566.
The motivation for changing the default is to avoid downloading and building LLVM when someone runs `x build` before running `x setup`.
The motivation for only doing it on `channel = "dev"` is to avoid breaking distros or users installing from source. It works because `dev` is also the default channel.

The diff looks larger than it is; most of it is moving the `llvm` branch below the `rust` so `config.channel` is set.
2022-11-19 22:13:22 -05:00
Pietro Albini
17ee25d775
add the build.reuse config option to choose the reuse binary 2022-11-15 10:22:17 +01:00
kubycsolutions
b8edf0213e Avoid runtime dependency on static libstdc++
Usually, we do want to use the static C++ library when building rustc_llvm, but do not want to have that dependency at compiler runtime. Change the defaults to Make It So.
2022-11-10 19:37:09 -05:00
Mark Rousskov
5984b1d86f Revert "Make the c feature for compiler-builtins opt-in instead of inferred"
This reverts commit 3acb505ee5
(PR #101833).

The changes in this commit caused several bugs or at least
incompatibilies. For now we're reverting this commit and will re-land it
alongside fixes for those bugs.
2022-10-29 10:49:05 -04:00
Jakub Beránek
c5c86806c8
Introduce dedicated -Zdylib-lto flag for enabling LTO on dylibs 2022-10-23 13:48:03 +02:00
Jakub Beránek
cba16819a1
Add rust.lto config option 2022-10-23 13:43:08 +02:00
bors
de692f1fae Auto merge of #100557 - dawnofmidnight:tarball-commit-info, r=Mark-Simulacrum
fix: use git-commit-info for version information

Fixes #33286.
Fixes #86587.

This PR changes the current `git-commit-hash` file that `./x.py` dist puts in the `rustc-{version}-src.tar.{x,g}z` to contain the hash, the short hash, and the commit date from which the tarball was created, assuming git was available when it was. It uses this for reading the version so that rustc has all the appropriate metadata.

# Testing

Testing this is kind of a pain. I did it with something like
```sh
./x.py dist # ensure that `ignore-git` is `false` in config.toml
cp ./build/dist/rustc-1.65.0-dev-src.tar.gz ../rustc-1.65.0-dev-src.tar.gz
cd .. && tar -xzf rustc-1.65.0-dev-src && cd rustc-1.65.0-dev-src
./x.py build
```

Then, the output of  `rustc -vV` with the stage1 compiler should have the `commit-hash` and `commit-date` fields filled, rather than be `unknown`. To be completely sure, you can use `rustc --sysroot` with the stdlib that the original `./x.py dist` made, which will require that the metadata matches.
2022-10-02 20:55:17 +00:00
dawnofmidnight
fdb39551dd fix: use git-commit-info for version information
This PR adds support for fetching version information from the
`git-commit-info` file when building the compiler from a source tarball.
2022-10-01 17:46:18 -04:00
Joshua Nelson
3acb505ee5 Make the c feature for compiler-builtins opt-in instead of inferred
The build script for `compiler_builtins` doesn't support cross-compilation. I tried fixing it, but the cc crate itself
doesn't appear to support cross-compiling to windows either unless you use the -gnu toolchain:
```
  error occurred: Failed to find tool. Is `lib.exe` installed?
```

Rather than trying to fix it or special-case the platforms without bugs,
make it opt-in instead of automatic.
2022-09-28 03:21:36 -05:00
Matthias Krüger
1c0561aca6
Rollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-Simulacrum
bootstrap: Add llvm-has-rust-patches target option

This is so you can check out an upstream commit in src/llvm-project and
have everything just work.

This simplifies the logic in `is_rust_llvm` a bit; it doesn't need to
check for download-ci-llvm because we would have already errored if both
that and llvm-config were specified on the host platform.
2022-09-01 21:37:09 +02:00
Tyler Mandry
e136e02fd9 bootstrap: Add llvm-has-rust-patches target option
This is so you can check out an upstream commit in src/llvm-project and
have everything just work.
2022-08-29 16:23:19 -07:00
Nicholas Bishop
61c8c0a0a1 Document the no-std target option in config.toml.example 2022-08-06 16:50:10 -04:00
bors
6dadfc06fe Auto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrum
Add build metrics to rustbuild

This PR adds a new module of rustbuild, `ci_profiler`, whose job is to gather as much information as possible about the CI build as possible and store it in a JSON file uploaded to `ci-artifacts`. Right now for each step it collects:

* Type name and debug representation of the `Step` object.
* Duration of the step (excluding child steps).
* Systemwide CPU stats for the duration of the step (both single core and all cores).
* Which child steps were executed.

This is capable of replacing both the scripts to collect CPU stats and the `[TIMING]` lines in build logs (not yet removed, until we port our tooling to use the CI profiler). The format is also extensible to be able in the future to collect more information.

r? `@Mark-Simulacrum`
2022-06-05 01:35:03 +00:00
Tyler Mandry
f1e3d40456 Make llvm-libunwind a per-target option 2022-05-24 15:58:45 -07:00
Joshua Nelson
5df276eef5 Turn on fast_submodules unconditionally
I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057).
Remove the option to do so, which makes bootstrap a little easier to maintain.

Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.
2022-05-23 21:17:09 -05:00
Pietro Albini
53965d3daf
add build metrics, to gather ci stats from x.py
This tool will generate a JSON file with statistics about each
individual step to disk. It will be used in rust-lang/rust's CI to
replace the mix of scripts and log scraping we currently have to gather
this data.
2022-05-02 21:33:01 +02:00
David Wood
1d207bbd51 bootstrap: disable split dwarf by default
Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-18 03:47:51 +01:00
David Wood
7593c50d43 bootstrap: add split-debuginfo config
Replace `run-dysutil` option with more general `split-debuginfo` option
that works on all platforms.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-18 03:47:51 +01:00
Jon Gjengset
ca82e6cf18 bootstrap: untangle static-libstdcpp & llvm-tools
Previously, the static-libstdcpp setting was tied to llvm-tools such
that enabling the latter always enabled the latter. This seems
unfortunate, since it is entirely reasonable for someone to want to
_not_ statically link stdc++, but _also_ want to build the llvm-tools.
This patch therefore separates the two settings such that neither
implies the other.

On its own, that would change the default behavior in a way that's
likely to surprise users. Specifically, users who build llvm-tools
_likely_ want those tools to be statically compiled against libstdc++,
since otherwise users with older GLIBCXX will be unable to run the
vended tools. So, we also flip the default for the `static-libstdcpp`
setting such that builds always link statically against libstdc++ by
default, but it's _possible_ to opt out.

See also #94719.
2022-03-10 18:04:38 -08:00
bjorn3
7ad4297a49 Use the first codegen backend in the config.toml as default
It is currently hard coded to llvm if enabled and cranelift otherwise.
This made some sense when cranelift was the only alternative codegen
backend. Since the introduction of the gcc backend this doesn't make
much sense anymore. Before this PR bootstrapping rustc using a backend
other than llvm or cranelift required changing the source of
rustc_interface. With this PR it becomes a matter of putting the right
backend as first enabled backend in config.toml.
2022-02-27 11:28:05 +01:00
Matthias Krüger
584948d1be
Rollup merge of #93756 - tmandry:llvm-build-config, r=Mark-Simulacrum
Support custom options for LLVM build

The LLVM build has a lot of options that rustbuild doesn't need to know about. We should allow the user to customize the LLVM build directly.

Here are some [example customizations][recipe] we'd like to do.

[recipe]: 90105e5e4e/recipes/contrib/clang_toolchain.py (579)
2022-02-10 12:09:56 +01:00
Tyler Mandry
69cd826a85 Add llvm.build-config option 2022-02-09 22:41:23 +00:00
Josh Triplett
34106f8935 Stabilize -Z instrument-coverage as -C instrument-coverage
Continue supporting -Z instrument-coverage for compatibility for now,
but show a deprecation warning for it.

Update uses and documentation to use the -C option.

Move the documentation from the unstable book to stable rustc
documentation.
2022-01-01 15:57:35 -08:00
Maxim Cournoyer
b1fbafddbb rustbuild: Add support for a per-target default-linker option. 2021-12-31 13:13:24 -05:00
bors
a3f7c4db03 Auto merge of #90054 - michaelwoerister:v0-mangling-in-compiler, r=Mark-Simulacrum
Make new symbol mangling scheme default for compiler itself.

As suggest in https://github.com/rust-lang/rust/pull/89917#issuecomment-945888574, this PR enables the new symbol mangling scheme for the compiler itself. The standard library is still compiled using the legacy mangling scheme so that the new symbol format does not show up in user code (yet).

r? `@Mark-Simulacrum`
2021-10-23 03:06:21 +00:00
Michael Woerister
456283c95d Make new symbol mangling scheme default for compiler itself. 2021-10-19 14:58:21 +02:00
Augie Fackler
f2a234e63c config: add the option to enable LLVM tests
I'm working on some LLVM patches in concert with a Rust patch, and it's
helping me quite a bit to have this as an option. It doesn't seem that
hard, so I figured I'd formalize it in x.py and send it upstream.
2021-10-18 20:19:13 -04:00
Yuki Okushi
d01cfe1bf1
Rollup merge of #89840 - wangkirin:master, r=jyn514
fix the stage0 tools config file path in `config.toml.example`

in  #88362  , the `stage0.txt ` have been switched to `stage0.json`  , but in `config.toml.example` the guide didn't change ,  this PR fix  this issue
2021-10-13 21:55:18 +09:00
Wang Qilin
4b4d3ee60b fix the stage0 tools config file path in config.toml.example 2021-10-13 15:47:15 +08:00
Hans Kratz
7a646df098 Add missing entries for overflow-checks to config.toml.example. 2021-10-12 21:49:00 +02:00
David Wood
e552c0d86b bootstrap: add config option for nix patching
On NixOS systems, bootstrap will patch rustc used in bootstrapping after
checking `/etc/os-release` (to confirm the current distribution is NixOS).
However, when using Nix on a non-NixOS system, it can be desirable for
bootstrap to patch rustc. In this commit, a `patch-binaries-for-nix`
option is added to `config.toml`, which allows for user opt-in to
bootstrap's Nix patching.

Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-02 20:01:43 +00:00
John Paul Adrian Glaubitz
df7ad3af21 bootstrap: Add LLVM target matching for M68k 2021-09-17 15:07:12 +00:00
Manuel Drehwald
8f6827ffb7 add two new build flags to build clang and enable llvm plugins 2021-07-31 23:14:54 +02:00
Adam Gemmell
24254d693b Fix download-ci-llvm help comment 2021-07-16 15:29:10 +01:00
Alexander Melentyev
e84c9aed6d Delete spaces 2021-06-21 12:11:37 +03:00
bors
f434217aab Auto merge of #79608 - alessandrod:bpf, r=nagisa
BPF target support

This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker.

I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
2021-06-06 01:02:32 +00:00