about summary refs log tree commit diff
path: root/src/bootstrap/compile.rs
AgeCommit message (Collapse)AuthorLines
2020-05-02Don't skip building LLVM if already builtMark Rousskov-3/+7
2020-05-02Auto merge of #71716 - alexcrichton:bitcode-follow-up, r=nnethercotebors-3/+3
Rename `bitcode-in-rlib` option to `embed-bitcode` This commit finishes work first pioneered in #70458 and started in #71528. The `-C bitcode-in-rlib` option, which has not yet reached stable, is renamed to `-C embed-bitcode` since that more accurately reflects what it does now anyway. Various tests and such are updated along the way as well. This'll also need to be backported to the beta channel to ensure we don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-05-01Rename `bitcode-in-rlib` option to `embed-bitcode`Alex Crichton-3/+3
This commit finishes work first pioneered in #70458 and started in #71528. The `-C bitcode-in-rlib` option, which has not yet reached stable, is renamed to `-C embed-bitcode` since that more accurately reflects what it does now anyway. Various tests and such are updated along the way as well. This'll also need to be backported to the beta channel to ensure we don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-04-25Handle build completion message from CargoMark Rousskov-0/+3
This was introduced in the recent bump to 1.43 bootstrap cargo
2020-04-22Build libstd with `-Cbitcode-in-rlib=yes`.Nicholas Nethercote-2/+14
So that the rlibs will work with both LTO and non-LTO builds.
2020-04-11Require compiler-rt root at ../src/llvm-project/compiler-rtLuca Barbieri-0/+2
2020-04-03Auto merge of #70726 - Centril:rollup-zrdkkpt, r=Centrilbors-1/+5
Rollup of 5 pull requests Successful merges: - #68334 (AArch64 bare-metal targets: Build rust-std) - #70224 (Clean up rustdoc js testers) - #70532 (Miri engine: stronger type-based sanity check for assignments) - #70698 (bootstrap: add `--json-output` for rust-analyzer) - #70715 (Fix typo in operands section) Failed merges: r? @ghost
2020-04-02bootstrap: add `--json-output` for rust-analyzerNiko Matsakis-1/+5
2020-04-02Translate the virtual `/rustc/$hash` prefix back to a real directory.Eduard-Mihai Burtescu-1/+25
2020-03-18Revert "Fix missing libLLVM.so in stage0 sysroot."Josh Stone-38/+0
This reverts commit 8b9c5396ca574fad9cc7b51d16c8c96e0ae74632.
2020-03-06fix various typosMatthias Krüger-1/+1
2020-02-03bootstrap: fix clippy warningsMatthias Krüger-10/+10
2020-01-09Add bootstrap step for building sanitizer runtimesTomasz Miąsko-40/+40
2020-01-01Clear out target directory if compiler has changedMark Rousskov-1/+0
Previously, we relied fully on Cargo to detect that the compiler had changed and it needed to rebuild the standard library (or later "components"). This used to not quite be the case prior to moving to LLVM be a separate cargo invocation; subsequent compiles would recompile std and friends if LLVM had changed (#67077 is the PR that changes things here). This PR moves us to clearing out libstd when it is being compiled if the rustc we're using has changed. We fairly harshly limit the cases in which we do this (e.g., ignoring dry run mode, and so forth, as well as rustdoc invocations). This is primarily because when we're not using the compiler directly, so clearing out in other cases is likely to lead to bugs, particularly as our deletion scheme is pretty blunt today (basically removing more than is needed, i.e., not just the rustc artifacts). In practice, this targeted fix does fix the known bug, though it may not fully resolve the problem here. It's also not clear that there is a full fix hiding here that doesn't involve a more major change (like -Zbinary-dep-depinfo was). As a drive-by fix, don't delete the compiler before calling Build::copy, as that also deletes the compiler.
2019-12-22Format the worldMark Rousskov-140/+132
2019-12-18Reenable static linking of libstdc++ on windows-gnuMateusz Mikuła-1/+1
2019-12-11Add comment explaining original `maybe_install_llvm_dylib` callAaron Hill-0/+3
2019-12-11Fix missing libLLVM.so in stage0 sysroot.Aaron Hill-0/+38
When we dynamically link against libLLVM.so (as opposed to statically linking LLVM), we need libLLVM.so to be present in the stage0 sysroot, so that stage1 tools (which are built against the stage0 compiler+sysroot) can see it at build time (when the linker is run) See the comment in the commit for more details
2019-12-11Fix some linking of LLVM's dynamic libraryAlex Crichton-20/+8
Ensure it shows up in the same places it did before so tools can find it at runtime.
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-218/+49
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-10-30Statically link libstdc++ on windows-gnuMateusz Mikuła-2/+2
2019-10-24Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, r=pietroalbinibors-22/+41
Split the rustc target libraries into separate rustc-dev component This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR. The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case.
2019-10-21Remove `src/llvm-emscripten` submoduleAlex Crichton-20/+7
With #65251 landed there's no need to build two LLVM backends and ship them with rustc, every target we have now uses the same LLVM backend! This removes the `src/llvm-emscripten` submodule and additionally removes all support from rustbuild for building the emscripten LLVM backend. Multiple codegen backend support is left in place for now, and this is intended to be an easy 10-15 minute win on CI times by avoiding having to build LLVM twice.
2019-10-15Package non-rust objectsJethro Beekman-22/+41
2019-09-23Move handling of `RUSTC_PARALLEL_COMPILER` to `compile.rs`Alex Crichton-1/+1
No longer needs to live in `rustc.rs`
2019-09-23Move handling of `{MUSL,WASI}_ROOT` to `compile.rs`Alex Crichton-2/+6
No longer any need for them to live in `rustc.rs`!
2019-09-23Allow adding `RUSTFLAGS` after `Builder::cargo`Alex Crichton-13/+12
This commit changes the return type of `Builder::cargo` to return a builder that allows dynamically adding more `RUSTFLAGS` values after-the-fact. While not used yet, this will later be used to delete more of `rustc.rs`
2019-09-05Better way of conditioning the sanitizer buildsXimin Luo-0/+1
Previously the build would take the presence of the LLVM_CONFIG envvar to mean that the sanitizers should be built, but this is a common envvar that could be set for reasons unrelated to the rustc sanitizers. This commit adds a new envvar RUSTC_BUILD_SANITIZERS and uses it instead.
2019-08-28Fix build src/libtestYuki Okushi-1/+1
2019-08-23bootstrap: Merge the libtest build step with libstdAlex Crichton-136/+3
Since its inception rustbuild has always worked in three stages: one for libstd, one for libtest, and one for rustc. These three stages were architected around crates.io dependencies, where rustc wants to depend on crates.io crates but said crates don't explicitly depend on libstd, requiring a sysroot assembly step in the middle. This same logic was applied for libtest where libtest wants to depend on crates.io crates (`getopts`) but `getopts` didn't say that it depended on std, so it needed `std` built ahead of time. Lots of time has passed since the inception of rustbuild, however, and we've since gotten to the point where even `std` itself is depending on crates.io crates (albeit with some wonky configuration). This commit applies the same logic to the two dependencies that the `test` crate pulls in from crates.io, `getopts` and `unicode-width`. Over the many years since rustbuild's inception `unicode-width` was the only dependency picked up by the `test` crate, so the extra configuration necessary to get crates building in this crate graph is unlikely to be too much of a burden on developers. After this patch it means that there are now only two build phasese of rustbuild, one for libstd and one for rustc. The libtest/libproc_macro build phase is all lumped into one now with `std`. This was originally motivated by rust-lang/cargo#7216 where Cargo was having to deal with synthesizing dependency edges but this commit makes them explicit in this repository.
2019-08-17Rollup merge of #63621 - jgalenson:dndebug, r=alexcrichtonMazdak Farrokhzad-0/+3
Modify librustc_llvm to pass -DNDEBUG while compiling. Currently, librustc_llvm builds are not reproducible because the LLVM files it compiles use the debug version of llvm_unreachable, which uses __FILE__. To fix this, we propagate NDEBUG from bootstrap if applicable and use it when compiling librustc_llvm. r? @alexcrichton
2019-08-16Auto merge of #63470 - Mark-Simulacrum:rustc-depdep, r=alexcrichtonbors-34/+1
Utilize -Zbinary-dep-depinfo in rustbuild We no longer utilize stamp-file mtimes at all inside rustbuild, and a future PR may be able to entirely eliminate them by eagerly copying to the appropriate sysroot. The only mtime-based dependency tracking left is for documentation because we lie to Cargo about the rustdoc binary, so Cargo does not track changes to the real binary, and codegen-backends because binary-dep-depinfo does not emit that information into the depfiles. Both of these are fixable in the longer term but this existing patch gives us the following benefits: * We no longer delete Cargo target directories manually within a stage. Cross-stage, changes to codegen backends will still clear out target directories. This means that incremental state persists across individual steps (e.g., rebuilding libstd does not clear out librustc incremental state). Fixes #54712. * Dependency tracking across steps within a given stage is now fully precise. We will not clear out all codegen backend dependencies due to changes in librustc_driver, for example, only deleting the final librustc_codegen_llvm crate. Fixes #54008, fixes #50481. * We properly track codegen backends as a dependency (equivalent to rustc) across changes. Fixes #53284, and fixes #52719. * Cross-stage dependency tracking of crates is also much more accurate and reliable. Most likely fixes #49979 (but no reproduction steps in that issue). Fixes #59105. cc #63012
2019-08-15Modify librustc_llvm to pass -DNDEBUG while compiling.Joel Galenson-0/+3
Currently, librustc_llvm builds are not reproducible because the LLVM files it compiles use the debug version of llvm_unreachable, which uses __FILE__. To fix this, we propagate NDEBUG from bootstrap if applicable and use it when compiling librustc_llvm.
2019-08-14Update error-format to match new Cargo flags for pipeliningAlex Crichton-14/+6
2019-08-13Utilize -Zbinary-dep-depinfo for dependency trackingMark Rousskov-34/+1
2019-07-25bootstrap: Build startup object for all windows-gnu targetHugo Beauzée-Luyssen-1/+1
So that uwp-windows-gnu also gets its startup objects built
2019-07-25rustc: codegen: Build import library for all windows targetsHugo Beauzée-Luyssen-0/+1
So far it is assumed that using a DLL as a -l parameter argument is ok, but the assumption doesn't hold when compiling the native code with llvm. In which case, an import library is required, so let's build one This also requires the cargo counterpart to add the import library in the stamp files, at least when compiling libstd. Otherwise, the files don't get uplifted
2019-07-15ci: Remove Travis/AppVeyor configurationAlex Crichton-4/+0
Now that we've fully moved to Azure Pipelines and bors has been updated to only gate on Azure this commit removes the remaining Travis/AppVeyor support contained in this repository. Most of the deletions here are related to producing better output on Travis by folding certain sections. This isn't supported by Azure so there's no need to keep it around, and if Azure ever adds support we can always add it back!
2019-06-10Pass LLVM linker flags to librustc_llvm buildPetr Hosek-0/+4
Some -L and -l flags may be needed even when building librustc_llvm, for example when using static libc++ on Linux we may need to manually specify the library search path and -ldl -lpthread as additional link dependencies. We pass LLVM linker flags from config to librustc_llvm build to make sure these cases are handled.
2019-06-05Utilize cfg(bootstrap) over cfg(stage0)Mark Rousskov-1/+1
Also removes stage1, stage2 cfgs being passed to rustc to ensure that stage1 and stage2 are only differentiated as a group (i.e., only through not bootstrap).
2019-05-30Auto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbinibors-13/+16
ci: Attempt to skip a full rustc compile on dist* Currently when we're preparing cross-compiled compilers it can take quite some time because we have to build the compiler itself three different times. The first is the normal bootstrap, the second is a second build for the build platform, and the third is the actual target architecture compiler. The second compiler was historically built exclusively for procedural macros, and long ago we didn't actually need it. This commit tries out avoiding that second compiled compiler, meaning we only compile rustc for the build platform only once. Some local testing shows that this is promising, but bors is of course the ultimate test!
2019-05-28rustbuild: Tweak how stage1 compilers are selectedAlex Crichton-13/+16
This commit furthers the previous one to ensure that we don't build an extra stage of the compiler in CI. A test has been added to rustbuild to ensure that this doesn't regress, and then in debugging this test it was hunted down that the `dist::Std` target was the one erroneously pulling in the wrong compiler. The `dist::Std` step was updated to instead account for the "full bootstrap" or not flag, ensuring that the correct compiler for compiling the final standard library was used. This was another use of the `force_use_stage1` function which was in theory supposed to be pretty central, so existing users were all evaluated and a new function, `Builder::compiler_for`, was introduced. All existing users of `force_use_stage1` have been updated to use `compiler_for`, where the semantics of `compiler_for` are similar to that of `compiler` except that it doesn't guarantee the presence of a sysroot for the arguments passed (as they may be modified). Perhaps one day we can unify `compiler` and `compiler_for`, but the usage of `Builder::compiler` is so ubiquitous it would take quite some time to evaluate whether each one needs the sysroot or not, so it's hoped that can be done in parallel.
2019-05-25Add clippy and fix commands to x.pyljedrz-1/+23
2019-05-24rustbuild: Simplify debuginfo configurationVadim Petrochenkov-7/+0
2019-05-22Bump compiler-builtins to 0.1.15Alex Crichton-1/+28
This commit bumps the `compiler-builtins` dependency to 0.1.15 which expects to have the source for `compiler-rt` provided externally if the `c` feature is enabled. This then plumbs through the necessary support in the build system to ensure that if the `llvm-project` directory is checked out and present that we enable the `c` feature of `compiler-builtins` and compile in all the C intrinsics.
2019-05-17Update the compiler_builtins crateAlex Crichton-1/+1
This updates to 0.1.13 for `compiler_builtins`, published to fix a few issues. The feature changes here are updated because `compiler_builtins` no longer enables the `c` feature by default but we want to do so through our build still. Closes #60747 Closes #60782
2019-05-09remove unneeded `extern crate`s from build toolsAndy Russell-1/+2
2019-04-12Revert PR #59401 to fix issue #59652 (a stable-to-beta regression).Felix S. Klock II-4/+0
This is result of squashing two revert commits: Revert "compile all crates under test w/ -Zemit-stack-sizes" This reverts commit 7d365cf27f4249fc9b61ba8abfc813abe43f1cb7. Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes" This reverts commit 8b8488ce8fc047282e7159343f30609417f9fa39.
2019-03-31Fix custom relative libdir.O01eg-4/+4
Uses relative libdir to place libraries on all stages. Adds verbose installation output.