summary refs log tree commit diff
path: root/src/bootstrap/native.rs
AgeCommit message (Collapse)AuthorLines
2018-02-11Change Step to be invoked with a path when in default mode.Mark Simulacrum-3/+1
Previously, a Step would be able to tell on its own when it was invoked "by-default" (that is, `./x.py test` was called instead of `./x.py test some/path`). This commit replaces that functionality, invoking each Step with each of the paths it has specified as "should be invoked by." For example, if a step calls `path("src/tools/cargo")` and `path("src/doc/cargo")` then it's make_run will be called twice, with "src/tools/cargo" and "src/doc/cargo." This makes it so that default handling logic is in builder, instead of spread across various Steps. However, this meant that some Step specifications needed to be updated, since for example `rustdoc` can be built by `./x.py build src/librustdoc` or `./x.py build src/tools/rustdoc`. A `PathSet` abstraction is added that handles this: now, each Step can not only list `path(...)` but also `paths(&[a, b, ...])` which will make it so that we don't invoke it with each of the individual paths, instead invoking it with the first path in the list (though this shouldn't be depended on). Future work likely consists of implementing a better/easier way for a given Step to work with "any" crate in-tree, especially those that want to run tests, build, or check crates in the std, test, or rustc crate trees. Currently this is rather painful to do as most of the logic is duplicated across should_run and make_run. It seems likely this can be abstracted away into builder somehow.
2018-02-09rustc: Upgrade to LLVM 6Alex Crichton-1/+1
The following submodules have been updated for a new version of LLVM: - `src/llvm` - `src/libcompiler_builtins` - transitively contains compiler-rt - `src/dlmalloc` This also updates the docker container for dist-i686-freebsd as the old 16.04 container is no longer capable of building LLVM. The compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without much interesting happening, but the LLVM update here is of particular note. Unlike previous updates I haven't cherry-picked all existing patches we had on top of our LLVM branch as we have a [huge amount][patches4] and have at this point forgotten what most of them are for. Instead I started from the current `release_60` branch in LLVM and only applied patches that were necessary to get our tests working and building. The current set of custom rustc-specific patches included in this LLVM update are: * rust-lang/llvm@1187443 - this is how we actually implement `cfg(target_feature)` for now and continues to not be upstreamed. While a hazard for SIMD stabilization this commit is otherwise keeping the status quo of a small rustc-specific feature. * rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't upstreamed, notably teaching LLVM about our allocation-related routines (which aren't malloc/free). Once we stabilize the global allocator routines we will likely want to upstream this patch, but for now it seems reasonable to keep it on our fork. * rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in our 32-bit linux container. I'm not really sure why it's necessary but my guess is that it's because of the absolutely ancient glibc that we're using. In any case it's only updating pieces we're not actually using in LLVM so I'm hoping it'll turn out alright. This doesn't seem like something we'll want to upstream.c * rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our i686-freebsd container, I'm not really sure what's going on but we for sure probably don't want to upstream this and otherwise it seems not too bad for now at least. * rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug] which although diagnosed to a particular revision isn't currently fixed upstream (and the bug itself doesn't seem too active). This commit is a partial revert of the suspected cause of this regression (found via a bisection). I'm sort of hoping that this eventually gets fixed upstream with a similar fix (which we can replace in our branch), but for now I'm also hoping it's a relatively harmless change to have. After applying these patches (plus one [backport] which should be [backported upstream][llvm-back]) I believe we should have all tests working on all platforms in our current test suite. I'm like 99% sure that we'll need some more backports as issues are reported for LLVM 6 when this propagates through nightlies, but that's sort of just par for the course nowadays! In any case though some extra scrutiny of the patches here would definitely be welcome, along with scrutiny of the "missing patches" like a [change to pass manager order](rust-lang/llvm@27174447533), [another change to pass manager order](rust-lang/llvm@c782febb7b9), some [compile fixes for sparc](rust-lang/llvm@1a83de63c42), and some [fixes for solaris](rust-lang/llvm@c2bfe0abb). [patches4]: https://github.com/rust-lang/llvm/compare/5401fdf23...rust-llvm-release-4-0-1 [backport]: https://github.com/rust-lang/llvm/commit/5c54c252db [llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114 [upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096 --- The update to LLVM 6 is desirable for a number of reasons, notably: * This'll allow us to keep up with the upstream wasm backend, picking up new features as they start landing. * Upstream LLVM has fixed a number of SIMD-related compilation errors, especially around AVX-512 and such. * There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed in the LLVM 4 branch we're using. * Overall it's not a great idea to stagnate with our codegen backend! This update is mostly powered by #47730 which is allowing us to update LLVM *independent* of the version of LLVM that Emscripten is locked to. This means that when compiling code for Emscripten we'll still be using the old LLVM 4 backend, but when compiling code for any other target we'll be using the new LLVM 6 target. Once Emscripten updates we may no longer need this distinction, but we're not sure when that will happen! Closes #43370 Closes #43418 Closes #47015 Closes #47683 Closes rust-lang-nursery/stdsimd#157 Closes rust-lang-nursery/rust-wasm#3
2018-01-28rustc: Split Emscripten to a separate codegen backendAlex Crichton-19/+56
This commit introduces a separately compiled backend for Emscripten, avoiding compiling the `JSBackend` target in the main LLVM codegen backend. This builds on the foundation provided by #47671 to create a new codegen backend dedicated solely to Emscripten, removing the `JSBackend` of the main codegen backend in the process. A new field was added to each target for this commit which specifies the backend to use for translation, the default being `llvm` which is the main backend that we use. The Emscripten targets specify an `emscripten` backend instead of the main `llvm` one. There's a whole bunch of consequences of this change, but I'll try to enumerate them here: * A *second* LLVM submodule was added in this commit. The main LLVM submodule will soon start to drift from the Emscripten submodule, but currently they're both at the same revision. * Logic was added to rustbuild to *not* build the Emscripten backend by default. This is gated behind a `--enable-emscripten` flag to the configure script. By default users should neither check out the emscripten submodule nor compile it. * The `init_repo.sh` script was updated to fetch the Emscripten submodule from GitHub the same way we do the main LLVM submodule (a tarball fetch). * The Emscripten backend, turned off by default, is still turned on for a number of targets on CI. We'll only be shipping an Emscripten backend with Tier 1 platforms, though. All cross-compiled platforms will not be receiving an Emscripten backend yet. This commit means that when you download the `rustc` package in Rustup for Tier 1 platforms you'll be receiving two trans backends, one for Emscripten and one that's the general LLVM backend. If you never compile for Emscripten you'll never use the Emscripten backend, so we may update this one day to only download the Emscripten backend when you add the Emscripten target. For now though it's just an extra 10MB gzip'd. Closes #46819
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-5/+0
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-11Add i586-unknown-linux-musl targetMarco A L Barbosa-0/+2
2017-11-28*: strip calls to cc::Build::compileTamir Duberstein-1/+1
The documentation states: "The name output should be the name of the library." and this is already done in more recently-added callers.
2017-11-25rustbuild: Enable WebAssembly backend by defaultAlex Crichton-4/+1
This commit alters how we compile LLVM by default enabling the WebAssembly backend. This then also adds the wasm32-unknown-unknown target to get compiled on the `cross` builder and distributed through rustup. Tests are not yet enabled for this target but that should hopefully be coming soon!
2017-11-04rustbuild: Update the OpenSSL version to linkAlex Crichton-2/+2
This updates the OpenSSL tarball download to reflect OpenSSL's newest release.
2017-10-29Support Dragonfly when building OpensslMichael Neumann-0/+1
2017-10-24bootstrap: Add openssl configuration for sparc64-unknown-linux-gnuJohn Paul Adrian Glaubitz-0/+1
2017-10-16bootstrap: update and enable the LLVM version-checkJosh Stone-4/+7
While the `config.toml.example` comments say "we automatically check the version by default," we actually didn't. That check was badly out of date, only allowing 3.5, 3.6, or 3.7. This it now updated to the new 3.9 minimum requirement, and truly enabled by default.
2017-10-15rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov-0/+7
2017-10-12rustbuild: Make openssl download more reliable.kennytm-20/+37
1. Add -f flag to curl, so when the server returns 403 or 500 it will fail immediately. 2. Moved the checksum part into the retry loop, assuming checksum failure is due to broken download that can be fixed by downloading again.
2017-09-29Rollup merge of #44320 - ↵Mark Simulacrum-2/+2
jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1aecbd570fab, r=Mark-Simulacrum Fix extended bootstrap issues with OpenSSL on NetBSD build hosts
2017-09-28Auto merge of #44785 - alexcrichton:update-cargo, r=nikomatsakisbors-2/+2
Update some minor dependencies * run `cargo update` * Update cargo submodule * Update to the `cc` crate from `gcc`
2017-09-28Update to the `cc` crateAlex Crichton-2/+2
This is the name the `gcc` crate has moved to
2017-09-27bootstrap: use tar -z on extractJonathan A. Kollasch-1/+1
Some tar(1) programs—such as NetBSD's—do not automatically decompress.
2017-09-27bootstrap: use shasum(1) on NetBSD build hostsJonathan A. Kollasch-1/+1
NetBSD doesn't ship with sha256sum. The openssl build will probably try to use perl anyway, so using perl's shasum is reasonable.
2017-09-23add aarch64-unknown-linux-musl targetBen Cressey-0/+1
Signed-off-by: Ben Cressey <bcressey@amazon.com> Signed-off-by: Tom Kirchner <tjk@amazon.com>
2017-09-16ci: Upload/download from a new S3 bucketAlex Crichton-1/+1
Moving buckets from us-east-1 to us-west-1 because us-west-1 is where rust-central-station itself runs and in general is where we have all our other buckets.
2017-09-14Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-SimulacrumCorey Farwell-1/+2
Explicitly run perl for OpenSSL Configure OpenSSL's Configure script is missing a shebang. On some platforms, execve falls back to execution with the shell. Some other platforms, like musl, will fail with an exec format error. Avoid this by calling perl explicitly (since it's a perl script).
2017-09-06Rollup merge of #44354 - ↵Mark Simulacrum-0/+10
jakllsch:jakllsch-85453197-a0cc-43f6-8c55-7bce6c4a4ebf, r=Mark-Simulacrum bootstrap: openssl for NetBSD/sparc64 in extended build r? @Mark-Simulacrum
2017-09-05bootstrap: avoid m4 -B for NetBSD-built sparc64 OpenSSLJonathan A. Kollasch-0/+5
2017-09-05bootstrap: add openssl config for sparc64-unknown-netbsdJonathan A. Kollasch-0/+5
2017-09-05disable gcc warningsRalf Jung-0/+1
2017-09-02update gcc crateRalf Jung-1/+1
Use gcc::Build rather than deprecated gcc::Config. Fixes #43973
2017-08-30bootstrap: add openssl configuration mapping for i686-unknown-netbsdJonathan A. Kollasch-0/+1
2017-08-28Explicitly run perl for OpenSSL ConfigureSamuel Holland-1/+2
OpenSSL's Configure script is missing a shebang. On some platforms, execve falls back to execution with the shell. Some other platforms, like musl, will fail with an exec format error. Avoid this by calling perl explicitly (since it's a perl script).
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-11Build support for no llvmbjorn3-0/+6
2017-08-04Use LLVM_LINK_LLVM_DYLIB only on linux-gnu and apple-darwinJosh Stone-2/+2
2017-08-03Exclude Windows from LLVM_LINK_LLVM_DYLIBJosh Stone-1/+9
2017-07-31Link LLVM tools dynamicallyJosh Stone-0/+1
Set `LLVM_LINK_LLVM_DYLIB=ON` -- "If enabled, tools will be linked with the libLLVM shared library." Rust doesn't ship any of the LLVM tools, and only needs a few at all for some test cases, so statically linking the tools is just a waste of space. I've also had memory issues on slower machines with LLVM debuginfo enabled, when several tools start linking in parallel consuming several GBs each. With the default configuration, `build/x86_64-unknown-linux-gnu/llvm` was 1.5GB before, now down to 731MB. The difference is more drastic with `--enable-llvm-release-debuginfo`, from 28GB to "only" 13GB. This does not change the linking behavior of `rustc_llvm`.
2017-07-30rustbuild: Remove `--enable-llvm-clean-rebuild`Alex Crichton-3/+0
This was intended for bots back in the day where we'd persist caches of LLVM builds across runs, but nowadays we don't do that on any of the bots so this option is no longer necessary
2017-07-29rustbuild: Enable building LLVMAlex Crichton-0/+4
I use this from time to time debugging LLVM builds, useful to have!
2017-07-28rustbuild: Tweak how we cross-compile LLVMAlex Crichton-0/+8
In preparation for upgrading to LLVM 5.0 it looks like we need to tweak how we cross compile LLVM slightly. It's using `CMAKE_SYSTEM_NAME` to infer whether to build libFuzzer which only works on some platforms, and then once we configure that it needs to apparently reach into the host build area to try to compile `llvm-config` as well. Once these are both configured, though, it looks like we can successfully cross-compile LLVM.
2017-07-20Change make_run signature to taking a RunConfig struct for refactorability.Mark Simulacrum-8/+3
2017-07-20Remove step.rs commentsMark Simulacrum-18/+1
2017-07-20Implement available paths list.Mark Simulacrum-7/+7
2017-07-20Require should_run to be implemented.Mark Simulacrum-0/+4
2017-07-20Utilize interning to allow Copy/Clone stepsMark Simulacrum-22/+25
2017-07-20Remove core_intrinsics feature gateMark Simulacrum-0/+3
2017-07-20Fixes warnings and errors introduced while moving code aroundMark Simulacrum-2/+3
2017-07-20Change code to work with the new systemMark Simulacrum-2/+16
2017-07-20Move code into Step trait implementations.Mark Simulacrum-288/+324
No changes are introduced to code body. This commit will not build; it is done to permit a better diff in later commits.
2017-07-20Move rule configs out of stepMark Simulacrum-0/+15
2017-07-04Use build.build instead of build.config.buildMark Simulacrum-4/+4
2017-06-22Make Build.cxx() return a Result instead of panickingIan Douglas Scott-1/+1
2017-06-16Add target to use LLVM wasm backendThomas Lively-0/+6
The new target is wasm32-experimental-emscripten. Adds a new configuration option to opt in to building experimental LLVM backends such as the WebAssembly backend. The target name was chosen to be similar to the existing wasm32-unknown-emscripten target so that the build and tests would work with minimal other code changes. When/if the new target replaces the old target, simply renaming it should just work.
2017-06-02Reduce sccache log level.Mark Simulacrum-1/+1