about summary refs log tree commit diff
path: root/src/bootstrap/native.rs
AgeCommit message (Collapse)AuthorLines
2018-05-18Add armv6-unknown-netbsd-eabihf targetJonathan A. Kollasch-0/+1
2018-05-18Add armv7-unknown-netbsd-eabihf targetJonathan A. Kollasch-0/+1
2018-05-09ci: Compile LLVM with Clang 6.0.0Alex Crichton-9/+59
Currently on CI we predominately compile LLVM with the default system compiler which means gcc on Linux, some version of Clang on OSX, MSVC on Windows, and gcc on MinGW. This commit switches Linux, OSX, and Windows to all use Clang 6.0.0 to build LLVM (aka the C/C++ compiler as part of the bootstrap). This looks to generate faster code according to #49879 which translates to a faster rustc (as LLVM internally is faster) The major changes here were to the containers that build Linux releases, basically adding a new step that uses the previous gcc 4.8 compiler to compile the next Clang 6.0.0 compiler. Otherwise the OSX and Windows scripts have been updated to download precompiled versions of Clang 6 and configure the build to use them. Note that `cc` was updated here to fix using `clang-cl` with `cc-rs` on MSVC, as well as an update to `sccache` on Windows which was needed to correctly work with `clang-cl`. Finally the MinGW compiler is entirely left out here intentionally as it's currently thought that Clang can't generate C++ code for MinGW and we need to use gcc, but this should be verified eventually.
2018-04-20Disable auto-detection of libxml2 when compiling llvm.Johannes Nixdorf-0/+1
2018-04-17Remove uses of Build across Builder stepsMark Simulacrum-73/+69
2018-04-03Fix a few accidental expectationsMark Simulacrum-0/+4
2018-04-03Avoid printing output when in dry run modeMark Simulacrum-8/+8
2018-04-03Refactor to use a dry-run config instead of cfg(test)Mark Simulacrum-6/+8
This ensures that each build will support the testing design of "dry running" builds. It's also checked that a dry run build is equivalent step-wise to a "wet" run build; the graphs we generate when running are directly compared node/node and edge/edge, both for order and contents.
2018-04-03Stub out various functions during testingMark Simulacrum-0/+12
2018-03-09rustbuild: Pass `-j1` to OpenSSL `make install`Alex Crichton-1/+1
We explicitly do this when compiling OpenSSL itself due to weird racy issues in its build system, and now we've started seeing issues in the `make install` step so let's try and see what ratcheting down the parallelism does here...
2018-03-09Auto merge of #48891 - alexcrichton:dist-osx-9.3, r=kennytmbors-2/+2
travis: Upgrade dist builders for OSX This commit upgrades the dist builders for OSX to Travis's new `xcode9.3-moar` image which has 3 cores available to it instead of 2. This should help us provide speedier builds on OSX and hit timeouts less in theory! Note that historically the dist builders for OSX have been a different version than the ones that are running tests. I had forgotten why this was the case and digging around brought up 307615567 where apparently Xcode 8 wasn't able to compile LLVM with `MACOSX_DEPLOYMENT_TARGET=10.7` which we desired. On a whim I gave this PR a spin and it [looks like][green] this has since been fixed (maybe in LLVM?). In any case those green builds should hopefully mean that we can safely upgrade and get faster infrastructure to boot. This commit also includes an upgrade of OpenSSL. This is not done for security reasons but rather build system reasons. Originally builds with the new image [did not succeed][red] due to weird build failures in OpenSSL, but upgrading seems to have made the spurious errors go away to here's to also hoping that's fixed! [green]: https://travis-ci.org/rust-lang/rust/builds/351353412 [red]: https://travis-ci.org/rust-lang/rust/builds/350969248
2018-03-09travis: Upgrade dist builders for OSXAlex Crichton-2/+2
This commit upgrades the dist builders for OSX to Travis's new `xcode9.3-moar` image which has 3 cores available to it instead of 2. This should help us provide speedier builds on OSX and hit timeouts less in theory! Note that historically the dist builders for OSX have been a different version than the ones that are running tests. I had forgotten why this was the case and digging around brought up 307615567 where apparently Xcode 8 wasn't able to compile LLVM with `MACOSX_DEPLOYMENT_TARGET=10.7` which we desired. On a whim I gave this PR a spin and it [looks like][green] this has since been fixed (maybe in LLVM?). In any case those green builds should hopefully mean that we can safely upgrade and get faster infrastructure to boot. This commit also includes an upgrade of OpenSSL. This is not done for security reasons but rather build system reasons. Originally builds with the new image [did not succeed][red] due to weird build failures in OpenSSL, but upgrading seems to have made the spurious errors go away to here's to also hoping that's fixed! [green]: https://travis-ci.org/rust-lang/rust/builds/351353412 [red]: https://travis-ci.org/rust-lang/rust/builds/350969248
2018-03-09rustbuild: Fix MSBuild location of `llvm-config.exe`Alex Crichton-3/+6
For LLD integration the path to `llvm-config` needed to change to inside the build directory itself (for whatever reason) but the build directory is different on MSBuild than it is on `ninja` for MSVC builds, so the path to `llvm-config.exe` was actually wrong and not working! This commit removes the `Build::llvm_config` function in favor of the source of truth, the `Llvm` build step itself. The build step was then updated to find the right build directory for MSBuild as well as `ninja` for where `llvm-config.exe` is located. Closes #48749
2018-03-03rustc: Tweak default linker selectionAlex Crichton-5/+8
This commit refactors how the path to the linker that we're going to invoke is selected. Previously all targets listed *both* a `LinkerFlavor` and a `linker` (path) option, but this meant that whenever you changed one you had to change the other. The purpose of this commit is to avoid coupling these where possible. Target specifications now only unconditionally define the *flavor* of the linker that they're using by default. If not otherwise specified each flavor now implies a particular default linker to run. As a result, this means that if you'd like to test out `ld` for example you should be able to do: rustc -Z linker-flavor=ld foo.rs whereas previously you had to do rustc -Z linker-flavor=ld -C linker=ld foo.rs This will hopefully make it a bit easier to tinker around with variants that should otherwise be well known to work, for example with LLD, `ld` on OSX, etc.
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-69/+129
This commit imports the LLD project from LLVM to serve as the default linker for the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently removed along with "binaryen linker" support in rustc. Moving to LLD brings with it a number of benefits for wasm code: * LLD is itself an actual linker, so there's no need to compile all wasm code with LTO any more. As a result builds should be *much* speedier as LTO is no longer forcibly enabled for all builds of the wasm target. * LLD is quickly becoming an "official solution" for linking wasm code together. This, I believe at least, is intended to be the main supported linker for native code and wasm moving forward. Picking up support early on should help ensure that we can help LLD identify bugs and otherwise prove that it works great for all our use cases! * Improvements to the wasm toolchain are currently primarily focused around LLVM and LLD (from what I can tell at least), so it's in general much better to be on this bandwagon for bugfixes and new features. * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which means a postprocessor is no longer needed to show off Rust's "small wasm binary size". LLD is added in a pretty standard way to rustc right now. A new rustbuild target was defined for building LLD, and this is executed when a compiler's sysroot is being assembled. LLD is compiled against the LLVM that we've got in tree, which means we're currently on the `release_60` branch, but this may get upgraded in the near future! LLD is placed into rustc's sysroot in a `bin` directory. This is similar to where `gcc.exe` can be found on Windows. This directory is automatically added to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd` linker which implements the interface that `wasm-ld`, LLD's frontend, expects. Like Emscripten the LLD target is currently only enabled for Tier 1 platforms, notably OSX/Windows/Linux, and will need to be installed manually for compiling to wasm on other platforms. LLD is by default turned off in rustbuild, and requires a `config.toml` option to be enabled to turn it on. Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD has a native option for controlling this. [gc]: https://reviews.llvm.org/D42511
2018-02-26bootstrap: Add openssl configuration for powerpc-unknown-linux-gnuspeJohn Paul Adrian Glaubitz-0/+1
2018-02-25Rollup merge of #48489 - glaubitz:x32-linux, r=alexcrichtonkennytm-0/+1
bootstrap: Add openssl configuration for x86_64-unknown-linux-gnux32 OpenSSL provides a native configuration for x86_64-unknown-linux-gnux32: > https://github.com/openssl/openssl/blob/master/Configurations/10-main.conf#L810 Let's use it.
2018-02-25Rollup merge of #48297 - glaubitz:sparc-linux, r=estebankkennytm-0/+1
Add missing pieces for sparc-linux-gnu support I noticed that while Rust has CABI support for 32-bit SPARC, there are still some pieces missing to be able to use Rust on a 32-Bit SPARC system like Gentoo which still defaults to a 32-bit port unlike Debian's sparc64 port. This PR is an attempt to add the missing pieces. I will send the necessary changes for libc in a separate PR. CC @jrtc27
2018-02-25Rollup merge of #48281 - jakllsch:netbsd-powerpc, r=alexcrichtonkennytm-0/+1
Add powerpc-unknown-netbsd target
2018-02-24Remove directory `src/rt`Vadim Petrochenkov-3/+3
2018-02-24bootstrap: Add openssl configuration for x86_64-unknown-linux-gnux32John Paul Adrian Glaubitz-0/+1
2018-02-23bootstrap: Add openssl configuration for sparc-unknown-linux-gnuJohn Paul Adrian Glaubitz-0/+1
2018-02-16Add powerpc-unknown-netbsd targetJonathan A. Kollasch-0/+1
2018-02-15Auto merge of #48203 - kennytm:rollup, r=kennytmbors-0/+8
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-14Rollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytmkennytm-0/+8
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: https://github.com/llvm-mirror/llvm/blob/b24a45d2e9f4fc10c3f9e16172104910b38637f2/cmake/config-ix.cmake#L612 - https://github.com/llvm-mirror/llvm/blob/b24a45d2e9f4fc10c3f9e16172104910b38637f2/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-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-10Add comment about the problem, and use provided path if availableroblabla-1/+8
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-29Work around LLVM OCAML binding installation failureroblabla-0/+1
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