Commit Graph

53 Commits

Author SHA1 Message Date
bjorn3 e152a1620b
Build support for no llvm 2017-08-11 10:38:29 +02:00
Josh Stone 6c46f4f11c Use LLVM_LINK_LLVM_DYLIB only on linux-gnu and apple-darwin 2017-08-04 00:13:11 -07:00
Josh Stone ced1fda565 Exclude Windows from LLVM_LINK_LLVM_DYLIB 2017-08-03 15:42:05 -07:00
Josh Stone 1636a2cf41 Link LLVM tools dynamically
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-31 15:34:05 -07:00
Alex Crichton eb1c44b6ed rustbuild: Remove `--enable-llvm-clean-rebuild`
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-30 13:50:19 -07:00
Alex Crichton ad1f19479c rustbuild: Enable building LLVM
I use this from time to time debugging LLVM builds, useful to have!
2017-07-29 13:39:43 -07:00
Alex Crichton 069a1b3c8f rustbuild: Tweak how we cross-compile LLVM
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-28 12:20:47 -07:00
Mark Simulacrum 6a67a050c6 Change make_run signature to taking a RunConfig struct for refactorability. 2017-07-20 17:51:07 -06:00
Mark Simulacrum e9c2242050 Remove step.rs comments 2017-07-20 16:41:26 -06:00
Mark Simulacrum 56128fb3ac Implement available paths list. 2017-07-20 11:24:37 -06:00
Mark Simulacrum 681b12316c Require should_run to be implemented. 2017-07-20 11:24:36 -06:00
Mark Simulacrum 528646e127 Utilize interning to allow Copy/Clone steps 2017-07-20 11:24:32 -06:00
Mark Simulacrum e7b1a60ad7 Remove core_intrinsics feature gate 2017-07-20 11:24:00 -06:00
Mark Simulacrum 60388303c7 Fixes warnings and errors introduced while moving code around 2017-07-20 11:23:58 -06:00
Mark Simulacrum 6b3413d825 Change code to work with the new system 2017-07-20 11:23:57 -06:00
Mark Simulacrum 001e9f3490 Move code into Step trait implementations.
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-20 11:23:57 -06:00
Mark Simulacrum 0a1b5e8bc0 Move rule configs out of step 2017-07-20 11:23:57 -06:00
Mark Simulacrum 1654a2f5ac Use build.build instead of build.config.build 2017-07-04 07:39:47 -06:00
Ian Douglas Scott f98ffb5bc3
Make Build.cxx() return a Result instead of panicking 2017-06-22 11:51:32 -07:00
Thomas Lively a1981a64a2 Add target to use LLVM wasm backend
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-16 15:43:43 -07:00
Mark Simulacrum 98dc118c72 Reduce sccache log level. 2017-06-02 11:44:54 -06:00
kennytm e6e5dc0e9c
ci: Improve log output (mainly Travis).
* Bring back colors on Travis, which was disabled since #39036.
  Append --color=always to cargo when running in CI environment.
* Removed `set -x` in the shell scripts. The `retry` function already
  prints which command it is running, add `-x` just add noise to the
  output.
* Support travis_fold/travis_time. Matching pairs of these allow Travis CI
  to collapse the output in between. This greatly cut down the unnecessary
  "successful" output one need to scroll through before finding the failed
  statement.
2017-06-02 01:14:26 +08:00
Liran Ringel 1163f2cc23 Pass static crt to llvm cmake configuration 2017-05-13 17:12:19 +02:00
Marco A L Barbosa 3acfa81e6b bootstrap: openssl android support 2017-05-05 17:12:05 -03:00
Alex Crichton 2e72bcb934 appveyor: Use Ninja/sccache on MSVC
Now that the final bug fixes have been merged into sccache we can start
leveraging sccache on the MSVC builders on AppVeyor instead of relying on the
ad-hoc caching strategy of trigger files and whatnot.
2017-04-27 07:19:34 -07:00
bors 6e0c5af9de Auto merge of #41567 - arielb1:rollup, r=arielb1
Rollup of 9 pull requests

- Successful merges: #41370, #41456, #41493, #41499, #41501, #41524, #41546, #41550, #41552
- Failed merges:
2017-04-27 00:04:03 +00:00
Aidan Hobson Sayers 367e90775b Make sure openssl compiles with only one core
Fixes #40417
2017-04-26 21:21:27 +01:00
Michael Wu 22eb3c69b9 Enable building the LLVM Hexagon target 2017-04-26 12:00:16 -04:00
Aidan Hobson Sayers f297767b2c Make sccache a bit quieter 2017-04-11 00:22:26 +01:00
Alex Crichton 7305ca3852 travis: Don't set `RUST_LOG` globally
I have a suspicion that this caused a large regression in cycle times by forcing
the compiler to perform more checks on every `debug!` statement, so let's test
this out by removing the `RUST_LOG` env var globally.

This regression in cycle time was witnessed between [two] [builds] where the
[PR] in question didn't do much suspicious. Judging by how the stage0 times
*also* regressed though then this is my best guess.

[two]: https://travis-ci.org/rust-lang/rust/builds/210149932
[builds]: https://travis-ci.org/rust-lang/rust/builds/210179995
[PR]: https://github.com/rust-lang/rust/pull/40446
2017-03-20 14:32:36 -07:00
Alex Crichton 5de04060ba rustbuild: Retry downloads of OpenSSL source
We need this to compile Cargo and we download it at build time, but as like all
other network requests it has a chance of failing. This commit moves the source
of the tarball to a mirror (S3 seems semi-more-reliable most of the time) and
also wraps the download in a retry loop.

cc #40474
2017-03-15 07:13:59 -07:00
Alex Crichton 4cda4d67f1 Allow cleaning llvm build dir to fail
It may not exist, so we don't want to spuriously generate an error.
2017-03-12 14:02:49 +03:00
Vadim Petrochenkov 9b8b3b2b03 rustbuild: Add option for enabling partial LLVM rebuilds 2017-03-12 14:02:49 +03:00
Robin Kruppe 58ff4f67e3 rustbuild: expose LLVM_PARALLEL_LINK_JOBS
This allows limiting the number of linker jobs to avoid swapping when
linking LLVM with debug info.
2017-03-09 15:07:42 +01:00
Vadim Petrochenkov c652a4fb56 Do not purge LLVM build directory on rebuild
Add some comments
2017-03-04 21:38:26 +03:00
Alex Crichton 44a01b8a54 rustbuild: Add support for compiling Cargo
This commit adds support to rustbuild for compiling Cargo as part of the release
process. Previously rustbuild would simply download a Cargo snapshot and
repackage it. With this change we should be able to turn off artifacts from the
rust-lang/cargo repository and purely rely on the artifacts Cargo produces here.

The infrastructure added here is intended to be extensible to other components,
such as the RLS. It won't exactly be a one-line addition, but the addition of
Cargo didn't require too much hooplah anyway.

The process for release Cargo will now look like:

* The rust-lang/rust repository has a Cargo submodule which is used to build a
  Cargo to pair with the rust-lang/rust release
* Periodically we'll update the cargo submodule as necessary on rust-lang/rust's
  master branch
* When branching beta we'll create a new branch of Cargo (as we do today), and
  the first commit to the beta branch will be to update the Cargo submodule to
  this exact revision.
* When branching stable, we'll ensure that the Cargo submodule is updated and
  then make a stable release.

Backports to Cargo will look like:

* Send a PR to cargo's master branch
* Send a PR to cargo's release branch (e.g. rust-1.16.0)
* Send a PR to rust-lang/rust's beta branch updating the submodule
* Eventually send a PR to rust-lang/rust's master branch updating the submodule

For reference, the process to add a new component to the rust-lang/rust release
would look like:

* Add `$foo` as a submodule in `src/tools`
* Add a `tool-$foo` step which compiles `$foo` with the specified compiler,
  likely mirroring what Cargo does.
* Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output
  to create a rust-installer package for `$foo` likely mirroring what Cargo
  does.
* Update the `dist-extended` step with a new dependency on `dist-$foo`
* Update `src/tools/build-manifest` for the new component.
2017-03-03 07:29:31 -08:00
Alex Crichton c02c44db72 rustc: Link statically to the MSVCRT
This commit changes all MSVC rustc binaries to be compiled with
`-C target-feature=+crt-static` to link statically against the MSVCRT instead of
dynamically (as it does today). This also necessitates compiling LLVM in a
different fashion, ensuring it's compiled with `/MT` instead of `/MD`.

cc #37406
2017-02-15 19:36:29 -08:00
Vadim Petrochenkov a5b603b1bf Build libbacktrace/jemalloc only when their timestamps are older than sources 2017-02-02 22:40:42 +03:00
Alex Crichton ebea2ea34f Merge branch 'rustbuild-llvm-targets' of https://github.com/xen0n/rust into rollup 2016-12-29 17:28:19 -08:00
Wang Xuerui 0f8e931475
rustbuild: allow overriding list of LLVM targets to build
A new option is introduced under the `[llvm]` section of `config.toml`,
`targets`, for overriding the list of LLVM targets to build support for.
The option is passed through to LLVM configure script. Also notes are
added about the implications of (ab)using the option; since the default
is not changed, and users of the option are expected to know what
they're doing anyway (as every porter should), the impact should be
minimal.

Fixes #38200.
2016-12-29 02:31:26 +08:00
Jorge Aparicio 18d49288d5 PTX support
- `--emit=asm --target=nvptx64-nvidia-cuda` can be used to turn a crate
  into a PTX module (a `.s` file).

- intrinsics like `__syncthreads` and `blockIdx.x` are exposed as
  `"platform-intrinsics"`.

- "cabi" has been implemented for the nvptx and nvptx64 architectures.
  i.e. `extern "C"` works.

- a new ABI, `"ptx-kernel"`. That can be used to generate "global"
  functions. Example: `extern "ptx-kernel" fn kernel() { .. }`. All
  other functions are "device" functions.
2016-12-26 21:06:23 -05:00
Jorge Aparicio bea6ab23f9 enable LLVM's SPARC backend 2016-12-19 12:23:37 -05:00
Alex Crichton 96a5fc76dc rustbuild: Add sccache support
This commit adds support for sccache, a ccache-like compiler which works on MSVC
and stores results into an S3 bucket. This also switches over all Travis and
AppVeyor automation to using sccache to ensure a shared and unified cache over
time which can be shared across builders.

The support for sccache manifests as a new `--enable-sccache` option which
instructs us to configure LLVM differently to use a 'sccache' binary instead of
a 'ccache' binary. All docker images for Travis builds are updated to download
Mozilla's tooltool builds of sccache onto various containers and systems.
Additionally a new `rust-lang-ci-sccache` bucket is configured to hold all of
our ccache goodies.
2016-12-14 15:40:18 -08:00
Alex Crichton 0e272de69f mk: Switch rustbuild to the default build system
This commit switches the default build system for Rust from the makefiles to
rustbuild. The rustbuild build system has been in development for almost a year
now and has become quite mature over time. This commit is an implementation of
the proposal on [internals] which slates deletion of the makefiles on
2016-01-02.

[internals]: https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368

This commit also updates various documentation in `README.md`,
`CONTRIBUTING.md`, `src/bootstrap/README.md`, and throughout the source code of
rustbuild itself.

Closes #37858
2016-12-07 00:30:23 -08:00
Jorge Aparicio 7b55936869 oops, forgot to commit a rustbuild related file 2016-11-12 17:33:35 -05:00
Tim Neumann 0254f12224 rustbuild: support RelWithDebInfo for llvm 2016-11-10 17:30:06 +01:00
Alex Crichton 06d173adb7 Add AppVeyor configuration to the repo
We hope to move to AppVeyor in the near future off of Buildbot + EC2. This adds
an `appveyor.yml` configuration file which is ready to run builds on the auto
branch. This is also accompanied with a few minor fixes to the build system and
such to accomodate AppVeyor.

The intention is that we're not switching over to AppVeyor entirely just yet,
but rather we'll watch the builds for a week or so. If everything checks out
then we'll start gating on AppVeyor instead of Buildbot!
2016-10-14 20:33:20 -07:00
Jan-Erik Rediger 939bd47339 Configure LLVM to use js backend
Initialize the asmjs backend for LLVM
2016-09-30 14:02:39 -07:00
Jorge Aparicio 3fd5fdd8d3 crate-ify compiler-rt into compiler-builtins
libcompiler-rt.a is dead, long live libcompiler-builtins.rlib

This commit moves the logic that used to build libcompiler-rt.a into a
compiler-builtins crate on top of the core crate and below the std crate.
This new crate still compiles the compiler-rt instrinsics using gcc-rs
but produces an .rlib instead of a static library.

Also, with this commit rustc no longer passes -lcompiler-rt to the
linker. This effectively makes the "no-compiler-rt" field of target
specifications a no-op. Users of `no_std` will have to explicitly add
the compiler-builtins crate to their crate dependency graph *if* they
need the compiler-rt intrinsics. Users of the `std` have to do nothing
extra as the std crate depends on compiler-builtins.

Finally, this a step towards lazy compilation of std with Cargo as the
compiler-rt intrinsics can now be built by Cargo instead of having to
be supplied by the user by some other method.

closes #34400
2016-09-12 21:22:15 -07:00
Jorge Aparicio 027eab2f87 initial support for s390x
A new target, `s390x-unknown-linux-gnu`, has been added to the compiler
and can be used to build no_core/no_std Rust programs.

Known limitations:

- librustc_trans/cabi_s390x.rs is missing. This means no support for
  `extern "C" fn`.
- No support for this arch in libc. This means std can be cross compiled
  for this target.
2016-08-26 21:05:50 -05:00