about summary refs log tree commit diff
path: root/src/rustc
AgeCommit message (Collapse)AuthorLines
2018-05-17Fix rustc binary metadata overwriting librustc metadataMark Simulacrum-1/+1
In #49289, rustc was changed to emit metadata for binaries, which made it so that the librustc.rmeta file created when compiling librustc was overwritten by the rustc-main compilation. This commit renames the rustc-main binary to avoid this problem. https://github.com/rust-lang/cargo/issues/5524 has also been filed to see if Cargo can learn to warn on this situation instead of leaving it for the user to debug.
2018-04-26Rename rustc_back::target to rustc_target::spec.Irina Popa-2/+2
2018-04-17Rollup merge of #49606 - varkor:pipe-repair, r=alexcrichtonkennytm-1/+4
Prevent broken pipes causing ICEs As the private `std::io::print_to` panics if there is an I/O error, which is used by `println!`, the compiler would ICE if one attempted to use a broken pipe (e.g. `rustc --help | false`). This introduces a new (private) macro `try_println!` which allows us to avoid this. As a side note, it seems this macro might be useful publicly (and actually there seems to be [a crate specifically for this purpose](https://crates.io/crates/try_print/)), though that can probably be left for a future discussion. One slight alternative approach would be to simply early exit without an error (i.e. exit code `0`), which [this comment](https://github.com/rust-lang/rust/issues/34376#issuecomment-377822526) suggests is the usual approach. I've opted not to take that approach initially, because I think it's more helpful to know when there is a broken pipe. Fixes #34376.
2018-04-12Update to most recent version of dlmallocAlex Crichton-1/+0
Inline the definition of `GlobalAlloc` for `dlmalloc` on wasm and don't rely on usage of unstable features in `dlmalloc` itself.
2018-04-11Prevent EPIPE causing ICEs in rustc and rustdocvarkor-1/+4
2018-04-10Allow incorrectly reported unused attribute warningMark Simulacrum-0/+1
2018-04-07Inject the `compiler_builtins` crate whenever the `core` crate is injectedOliver Schneider-0/+3
2018-04-05Rollup merge of #49563 - japaric:std-thumb, r=alexcrichtonkennytm-0/+1
add a dist builder to build rust-std components for the THUMB targets the rust-std component only contains the core and compiler-builtins (+c +mem) crates cc #49382 - I'm not entirely sure if this PR alone will produce rust-std components installable by rustup or if something else needs to be changed - I could have done the THUMB builds in an existing builder / image; I wasn't sure if that was a good idea so I added a new image - I could build other crates like alloc into the rust-std component but, AFAICT, that would require calling Cargo a second time (one for alloc and one for compiler-builtins), or have alloc depend on compiler-builtins (#49503 will perform that change) *and* have alloc resurface the "c" and "mem" Cargo features. r? @alexcrichton
2018-04-01add a dist-thumb builder to build rust-std for the THUMB targetsJorge Aparicio-0/+1
the rust-std component only contains the core and compiler-builtins (+c +mem) crates cc #49382
2018-03-28Set link args for rustdocTatsuyuki Ishi-0/+1
2018-03-18rustc_driver: get rid of extra thread on WindowsTatsuyuki Ishi-0/+9
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-3/+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.
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-0/+14
This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". --- Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is still getting LLVM bugs fixed to get that working and will take some time. Relatively simple programs all seem to work though! --- It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2017-10-11Bump cc to 1.01 to include x86_64-unknown-linux-gnux32 supportMarco A L Barbosa-1/+1
2017-10-06Trim and document compiler-builtins shimTamir Duberstein-10/+22
2017-09-30Update the libcompiler_builtins submoduleest31-1/+1
2017-09-21Trim and document libc shimTamir Duberstein-27/+23
2017-08-11Make librustc_driver work without librustc_transbjorn3-0/+1
2017-07-27Build rustdoc on-demand.Mark Simulacrum-20/+0
Rustdoc is no longer compiled in every stage, alongside rustc, instead it is only compiled when requested, and generally only for the last stage.
2017-07-05Switch to rust-lang-nursery/compiler-builtinsAlex Crichton-0/+42
This commit migrates the in-tree `libcompiler_builtins` to the upstream version at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version has a number of intrinsics written in Rust and serves as an in-progress rewrite of compiler-rt into Rust. Additionally it also contains all the existing intrinsics defined in `libcompiler_builtins` for 128-bit integers. It's been the intention since the beginning to make this transition but previously it just lacked the manpower to get done. As this PR likely shows it wasn't a trivial integration! Some highlight changes are: * The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes across platforms and also some refactorings to make the intrinsics easier to read. The additional testing added there also fixed a number of integration issues when pulling the repository into this tree. * LTO with the compiler-builtins crate was fixed to link in the entire crate after the LTO process as these intrinsics are excluded from LTO. * Treatment of hidden symbols was updated as previously the `#![compiler_builtins]` crate would mark all symbol *imports* as hidden whereas it was only intended to mark *exports* as hidden.
2017-03-28Fix plain_summary_line functionGuillaume Gomez-1/+0
2017-03-28Add feature for rustdoc binaryGuillaume Gomez-0/+1
2017-02-21test: Verify all sysroot crates are unstableAlex Crichton-94/+0
As we continue to add more crates to the compiler and use them to implement various features we want to be sure we're not accidentally expanding the API surface area of the compiler! To that end this commit adds a new `run-make` test which will attempt to `extern crate foo` all crates in the sysroot, verifying that they're all unstable. This commit discovered that the `std_shim` and `test_shim` crates were accidentally stable and fixes the situation by deleting those shims. The shims are no longer necessary due to changes in Cargo that have happened since they were originally incepted.
2017-02-08sanitizer supportJorge Aparicio-0/+4
2017-02-02Fixup crate versionsVadim Petrochenkov-2/+2
2017-01-16Expose a feature to force use of alloc_system, teach rustbuildAidan Hobson Sayers-0/+1
This fixes jemalloc-less local rebuilds, where we tell cargo that we're actually stage1
2016-12-30std: Don't build docs for misc facade cratesAlex Crichton-0/+2
Retain the same behavior as stable. Closes #38319
2016-11-30Update the bootstrap compilerAlex Crichton-33/+0
Now that we've got a beta build, let's use it!
2016-11-26Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichtonbors-0/+1
Add rustbuild command `bench` Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks. `./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates. Fixes #37897
2016-11-26rustbuild: Add bench = false to std shim cratesUlrik Sverdrup-0/+1
2016-11-23std: make compilation of libpanic_unwind optional via a Cargo featureJorge Aparicio-2/+3
with this feature disabled, you can (Cargo) compile std with "panic=abort" rustbuild will build std with this feature enabled, to maintain the status quo fixes #37252
2016-10-07Use workspaces and switch to a single Cargo.lock.Ahmed Charles-568/+0
This involves hacking the code used to run cargo test on various packages, because it reads Cargo.lock to determine which packages should be tested. This change implements a blacklist, since that will catch new crates when they are added in the future.
2016-10-06rustc: Rename rustc_macro to proc_macroAlex Crichton-10/+10
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-09-20rustc_metadata: replace RBML with a simple and type-safe scheme.Eduard Burtescu-1/+0
2016-09-20Remove librbml and the RBML-tagged auto-encoder/decoder.Eduard Burtescu-11/+0
2016-09-16Auto merge of #36441 - alexcrichton:rustbuild-target, r=brsonbors-0/+8
rustbuild: Fix cross-compiles to MinGW on Linux Closes #36290 Closes #36291
2016-09-12rustbuild: Fix cross-compiles to MinGW on LinuxAlex Crichton-0/+8
Closes #36290 Closes #36291
2016-09-12crate-ify compiler-rt into compiler-builtinsJorge Aparicio-0/+9
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-02rustc: Implement custom derive (macros 1.1)Alex Crichton-0/+10
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2016-08-29Fix rustbuildMichael Woerister-0/+1
2016-08-23Update cargo bootstrap rev and add fix for cargo#3005Brian Anderson-0/+4
2016-08-16Proc_macro is alivecgswords-0/+11
2016-07-30Update gcc crate dependency to 0.3.27.Timon Van Overveldt-3/+3
This is to pull in changes to support ARM MUSL targets. This change also commits a couple of other cargo-generated changes to other dependencies in the various Cargo.toml files.
2016-07-30Auto merge of #35051 - japaric:backtrace, r=alexcrichtonbors-0/+1
rustbuild: make backtraces (RUST_BACKTRACE) optional but keep them enabled by default to maintain the status quo. When disabled shaves ~56KB off every x86_64-unknown-linux-gnu binary. To disable backtraces you have to use a config.toml (see src/bootstrap/config.toml.example for details) when building rustc/std: $ python bootstrap.py --config=config.toml --- r? @alexcrichton cc rust-lang/rfcs#1417
2016-07-26rustbuild: make backtraces (RUST_BACKTRACE) optionalJorge Aparicio-0/+1
but keep them enabled by default to maintain the status quo. When disabled shaves ~56KB off every x86_64-unknown-linux-gnu binary. To disable backtraces you have to use a config.toml (see src/bootstrap/config.toml.example for details) when building rustc/std: $ python bootstrap.py --config=config.toml
2016-07-22refactor constant evaluation error reportingAriel Ben-Yehuda-0/+1
Refactor constant evaluation to use a single error reporting function that reports a type-error-like message. Also, unify all error codes with the "constant evaluation error" message to just E0080, and similarly for a few other duplicate codes. The old situation was a total mess, and now that we have *something* we can further iterate on the UX.
2016-07-13evaluate the array length of fixed size array types in rustdocOliver Schneider-0/+1
2016-06-28refactor rustc_metadata to use CamelCase names and IndexVecAriel Ben-Yehuda-0/+1
2016-06-27Update `src/rustc/Cargo.lock`Jeffrey Seyfried-0/+46
2016-06-09fix issuesAriel Ben-Yehuda-0/+1