Commit Graph

140 Commits

Author SHA1 Message Date
Vadim Petrochenkov aafebbcba9 Remove directory `src/rt` 2018-02-24 16:45:39 +03:00
John Paul Adrian Glaubitz 0b6583ed97 bootstrap: Add openssl configuration for x86_64-unknown-linux-gnux32 2018-02-24 01:08:02 +01:00
John Paul Adrian Glaubitz 871e82e7a4 bootstrap: Add openssl configuration for sparc-unknown-linux-gnu 2018-02-23 11:20:23 +01:00
Jonathan A. Kollasch ebec5e3906 Add powerpc-unknown-netbsd target 2018-02-16 14:29:24 -06:00
bors 1670a532dd Auto merge of #48203 - kennytm:rollup, r=kennytm
Rollup of 23 pull requests

- Successful merges: #47784, #47806, #47846, #48005, #48033, #48065, #48087, #48114, #48126, #48130, #48133, #48151, #48154, #48156, #48162, #48163, #48165, #48167, #48181, #48186, #48195, #48035, #48210
- Failed merges:
2018-02-15 13:35:20 +00:00
kennytm 2be44ceaa2
Rollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytm
Work around LLVM OCAML binding installation failure

Hello,

I have OCaml installed on my machine, and compiling rust systematically fails when LLVM attempts installing the OCaml bindings in `/usr/lib/ocaml`, which is write-protected. Here are the logs: https://gist.github.com/roblabla/3f147914c5df627c9d97ab311ba133ad

Some digging around the issue reveals:

- The code that finds if OCaml is installed, and sets the bindings to be compiled/installed: b24a45d2e9/cmake/config-ix.cmake (L612)
- b24a45d2e9/bindings/ocaml/llvm/CMakeLists.txt Some code that does the installation.

The problem seems to be that `LLVM_OCAML_INSTALL_PATH` is set to `OCAML_STDLIB_PATH` by default, which is in `/usr/lib/ocaml`, instead of the prefix.

This PR "fixes" the issue by setting `LLVM_OCAML_INSTALL_PATH` to `usr/lib/ocaml`. I haven't found a way to make LLVM not build OCaml, which would probably be a superior fix.
2018-02-14 16:14:29 +08:00
Mark Simulacrum f104b12059 Change Step to be invoked with a path when in default mode.
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-11 10:03:16 -07:00
roblabla 3c01dea03e Add comment about the problem, and use provided path if available 2018-02-10 21:29:10 +01:00
Alex Crichton 6b7b6b63a9 rustc: Upgrade to LLVM 6
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@2717444753), [another change to pass manager
order](rust-lang/llvm@c782febb7b), some [compile fixes for
sparc](rust-lang/llvm@1a83de63c4), 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-02-09 17:13:14 -08:00
roblabla c04d86deeb Work around LLVM OCAML binding installation failure 2018-01-29 11:07:11 +01:00
Alex Crichton c6daea7c9a rustc: Split Emscripten to a separate codegen backend
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-28 18:32:45 -08:00
Alex Crichton 884715c654 rustc: Load the `rustc_trans` crate at runtime
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-27 19:16:21 -08:00
Marco A L Barbosa 882cd3cf0b Add i586-unknown-linux-musl target 2018-01-11 15:57:28 -02:00
Tamir Duberstein 94d02b896c
*: strip calls to cc::Build::compile
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-28 18:15:30 -05:00
Alex Crichton 48996f9e75 rustbuild: Enable WebAssembly backend by default
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-25 06:44:35 -08:00
Alex Crichton c11ac9441a rustbuild: Update the OpenSSL version to link
This updates the OpenSSL tarball download to reflect OpenSSL's newest release.
2017-11-04 08:05:46 -07:00
Michael Neumann aa4726cd37 Support Dragonfly when building Openssl 2017-10-29 18:42:04 +01:00
John Paul Adrian Glaubitz 929a8bc13f bootstrap: Add openssl configuration for sparc64-unknown-linux-gnu 2017-10-24 08:53:22 +02:00
Josh Stone 6f33108e4d bootstrap: update and enable the LLVM version-check
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-16 13:10:16 -07:00
Vadim Petrochenkov 9e0fc5ccd0 rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
kennytm 90d58a362a
rustbuild: Make openssl download more reliable.
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-10-12 01:20:55 +08:00
Mark Simulacrum 20f892f549 Rollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1aecbd570fab, r=Mark-Simulacrum
Fix extended bootstrap issues with OpenSSL on NetBSD build hosts
2017-09-29 17:58:53 -06:00
bors 688a858391 Auto merge of #44785 - alexcrichton:update-cargo, r=nikomatsakis
Update some minor dependencies

* run `cargo update`
* Update cargo submodule
* Update to the `cc` crate from `gcc`
2017-09-28 16:19:58 +00:00
Alex Crichton 7694ca419b Update to the `cc` crate
This is the name the `gcc` crate has moved to
2017-09-28 07:45:50 -07:00
Jonathan A. Kollasch 90aa66bfc2 bootstrap: use tar -z on extract
Some tar(1) programs—such as NetBSD's—do not automatically decompress.
2017-09-27 11:17:42 -05:00
Jonathan A. Kollasch b53b853129 bootstrap: use shasum(1) on NetBSD build hosts
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-27 11:17:42 -05:00
Ben Cressey f94bd36fd1 add aarch64-unknown-linux-musl target
Signed-off-by: Ben Cressey <bcressey@amazon.com>
Signed-off-by: Tom Kirchner <tjk@amazon.com>
2017-09-23 14:46:33 -07:00
Alex Crichton 5cfee9b854 ci: Upload/download from a new S3 bucket
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-16 08:35:47 -07:00
Corey Farwell 76799d1ea3 Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
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-14 22:32:31 -04:00
Mark Simulacrum 48dcebd586 Rollup merge of #44354 - jakllsch:jakllsch-85453197-a0cc-43f6-8c55-7bce6c4a4ebf, r=Mark-Simulacrum
bootstrap: openssl for NetBSD/sparc64 in extended build

r? @Mark-Simulacrum
2017-09-06 18:28:05 -06:00
Jonathan A. Kollasch 847d1ffbe9 bootstrap: avoid m4 -B for NetBSD-built sparc64 OpenSSL 2017-09-05 16:31:14 -05:00
Jonathan A. Kollasch 2047a0d083 bootstrap: add openssl config for sparc64-unknown-netbsd 2017-09-05 16:31:14 -05:00
Ralf Jung 13cf229037 disable gcc warnings 2017-09-05 18:46:26 +02:00
Ralf Jung 12d84cc009 update gcc crate
Use gcc::Build rather than deprecated gcc::Config.
Fixes #43973
2017-09-02 21:51:18 +02:00
Jonathan A. Kollasch 0c2a9d6917 bootstrap: add openssl configuration mapping for i686-unknown-netbsd 2017-08-30 18:22:46 -05:00
Samuel Holland adfebed9db 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-08-28 11:22:11 -05:00
Fourchaux c7104be1a3 Fix typos & us spellings 2017-08-15 21:56:30 +02:00
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
Alan Somers 8604c5494e Follow-up to 1afb17ed5f
Disable gcc_personality_v0.c in rustbuild as well as the normal build.
Rustbuild now gets further on FreeBSD, but it still fails due to other problems.
2016-07-24 18:03:01 +00:00
Alex Crichton ee6011fc71 mk: Stop using cmake for compiler-rt
The compiler-rt build system has been a never ending cause of pain for Rust
unfortunately:

* The build system is very difficult to invoke and configure to only build
  compiler-rt, especially across platforms.
* The standard build system doesn't actually do what we want, not working for
  some of our platforms and requiring a significant number of patches on our end
  which are difficult to apply when updating compiler-rt.
* Compiling compiler-rt requires LLVM to be compiled, which... is a big
  dependency! This also means that over time compiler-rt is not guaranteed to
  build against older versions of LLVM (or newer versions), and we often want to
  work with multiple versions of LLVM simultaneously.

The makefiles and rustbuild already know how to compile C code, the code here is
far from the *only* C code we're compiling. This patch jettisons all logic to
work with compiler-rt's build system and just goes straight to the source. We
just list all files manually (copied from compiler-rt's
lib/builtins/CMakeLists.txt) and compile them into an archive.

It's likely that this means we'll fail to pick up new files when we upgrade
compiler-rt, but that seems like a much less significant cost to pay than what
we're currently paying.

cc #34400, first steps towards that
2016-07-20 13:22:20 -07:00
Alex Crichton 48a07bfb95 rustbuild: Remove the `build` directory
The organization in rustbuild was a little odd at the moment where the `lib.rs`
was quite small but the binary `main.rs` was much larger. Unfortunately as well
there was a `build/` directory with the implementation of the build system, but
this directory was ignored by GitHub on the file-search prompt which was a
little annoying.

This commit reorganizes rustbuild slightly where all the library files (the
build system) is located directly inside of `src/bootstrap` and all the binaries
now live in `src/bootstrap/bin` (they're small). Hopefully this should allow
GitHub to index and allow navigating all the files while maintaining a
relatively similar layout to the other libraries in `src/`.
2016-07-05 21:58:20 -07:00