summary refs log tree commit diff
path: root/src/libstd/build.rs
AgeCommit message (Collapse)AuthorLines
2018-03-13rustc: Embed LLVM bitcode by default on iOSAlex Crichton-1/+2
This commit updates rustc to embed bitcode in each object file generated by default when compiling for iOS. This was determined in #35968 as a step towards better compatibility with the iOS toolchain, so let's give it a spin and see how it turns out! Note that this also updates the `cc` dependency which should propagate this change of embedding bitcode for C dependencies as well.
2018-03-13rustbuild: Tweak CFLAGS to various libstd piecesAlex Crichton-1/+1
* Pass `opt_level(2)` when calculating CFLAGS to get the right flags on iOS * Unconditionally pass `-O2` when compiling libbacktrace This should... Close #48903 Close #48906
2017-12-29Add proper library dependencies for libstd on CloudABI.Ed Schouten-1/+8
Don't attempt to build libunwind on CloudABI, as libunwind is already provided by the system by default.
2017-12-27Revert "Add a file to trivially disable tool building or testing"kennytm-6/+3
This reverts commit ab018c76e14b87f3c9e0b7384cc9b02d94779cd5. This also adds the `ToolBuild::is_ext_tool` field to replace the previous `ToolBuild::expectation` field, to indicate whether a build-failure of certain tool is essential.
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-2/+6
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-15rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov-11/+1
2017-09-28Update to the `cc` crateAlex Crichton-2/+2
This is the name the `gcc` crate has moved to
2017-09-24The Magenta kernel is now called Zircon.P.Y. Laligand-2/+2
2017-09-17Add a file to trivially disable tool building or testingOliver Schneider-3/+6
2017-09-09Auto merge of #44251 - kennytm:osx-backtrace, r=alexcrichtonbors-1/+1
Add libbacktrace support for Apple platforms (resubmitted) Resubmitting #43422 rebased on the current master (cc @JohnColanduoni). I have added an additional commit to fallback to `dladdr`-based `resolve_symbol` if `libbacktrace` returns `None`, otherwise the stack trace will be full of `<unknown>` when you forget to pass the `-g` flag (actually it seems — at least on macOS — the `dladdr` symbol is more accurate than the `libbacktrace` one).
2017-09-02update gcc crateRalf Jung-1/+1
Use gcc::Build rather than deprecated gcc::Config. Fixes #43973
2017-09-02Add libbacktrace support for Apple platformsJohn Colanduoni-1/+1
2017-08-22Remove incorrect special case of mips-muslSamuel Holland-1/+1
The libdl/librt/libpthread provided by musl are no-op (empty static libraries) on all architectures, mips included.
2017-08-03Make backtraces work on Redox, copying Unix implementationIan Douglas Scott-1/+1
2017-07-24DNS functions are in libresolv on Solaris, just like on MacOSDanek Duvall-0/+1
2017-07-07Fix Rustbuild linking on IllumosNikita Baksalyar-0/+4
Illumos (an OpenSolaris fork) expects to get several extra library references for some system functions used by Rust standard library. This commit adds required linker options to rustbuild, which is currently doesn't work on Illumos-based operating systems.
2017-05-04Reload nameserver information on lookup failureJon Gjengset-0/+5
As discussed in #41570, UNIX systems often cache the contents of /etc/resolv.conf, which can cause lookup failures to persist even after a network connection becomes available. This patch modifies lookup_host to force a reload of the nameserver entries following a lookup failure. This is in line with what many C programs already do (see #41570 for details). On systems with nscd, this should not be necessary, but not all systems run nscd. Introduces an std linkage dependency on libresolv on macOS/iOS (which also makes it necessary to update run-make/tools.mk). Fixes #41570. Depends on rust-lang/libc#585.
2017-03-04Automate timestamp creation and build skipping for native librariesVadim Petrochenkov-11/+4
Add comments
2017-03-04Build compiler-rt and sanitizers only onceVadim Petrochenkov-20/+12
2017-03-04Add/remove `rerun-if-changed` when necessaryVadim Petrochenkov-2/+0
2017-02-17Follow rename of mx_handle_wait Magenta syscallsRaph Levien-0/+4
The mx_handle_wait_* syscalls in Magenta were renamed to mx_object_wait. The syscall is used in the Magenta/Fuchsia implementation of std::process, to wait on child processes. In addition, this patch enables the use of the system provided libbacktrace library on Fuchsia targets. Symbolization is not yet working, but at least it allows printing hex addresses in a backtrace and makes building succeed when the backtrace feature is not disabled.
2017-02-06std: Remove cfg(cargobuild) annotationsAlex Crichton-1/+0
These are all now no longer needed that we've only got rustbuild in tree.
2017-02-02Build libbacktrace/jemalloc only when their timestamps are older than sourcesVadim Petrochenkov-7/+12
2017-02-02Fix build in cross-compilation scenariosVadim Petrochenkov-1/+1
2017-02-02rustbuild: Build jemalloc and libbacktrace only once (take 2)Vadim Petrochenkov-16/+10
2017-01-26std: Compile libbacktrace with -fvisibility=hiddenAlex Crichton-2/+3
We don't want these symbols exported from the standard library, this is just an internal implementation detail of the standard library currently. Closes #34984
2016-12-23Auto merge of #38401 - redox-os:redox_cross, r=brsonbors-1/+1
Redox Cross Compilation I will admit - there are things here that I wish I did not have to do. This completes the ability to create a cross compiler from the rust repository for `x86_64-unknown-redox`. I will document this PR with inline comments explaining some things. [View this gist to see how a cross compiler is built](https://gist.github.com/jackpot51/6680ad973986e84d69c79854249f2b7e) Prior discussion of a smaller change is here: https://github.com/rust-lang/rust/pull/38366
2016-12-22Remove start functions, use newlib instead of openlibm + rallocJeremy Soller-2/+0
2016-12-21Update liblibc, go back to lazy linking openlibmJeremy Soller-1/+1
2016-12-20Static link openlibmJeremy Soller-1/+1
2016-12-20Link openlibm only in libstdJeremy Soller-0/+2
2016-12-17let BSD to use gmake for GNU-makeSébastien Marie-1/+1
the diff extends build_helper to provide an function to return the expected name of GNU-make on the host: "make" or "gmake". Fixes #38429
2016-12-15WIP: Cross-compilation for Redox targetJeremy Soller-1/+1
2016-11-22Fuchsia support for std::process via liblaunchpad.Theodore DeRego-0/+2
2016-10-28Auto merge of #37385 - raphlinus:fuchsia_random, r=alexcrichtonbors-0/+2
Add support for kernel randomness for Fuchsia Wire up cprng syscall as provider for rand::os::OsRng on Fuchsia.
2016-10-24Add support for kernel randomness for FuchsiaRaph Levien-0/+2
Wire up cprng syscall as provider for rand::os::OsRng on Fuchsia.
2016-10-22Add Fuchsia supportRaph Levien-1/+1
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
2016-09-25Report which required build-time environment variable is not setJake Goulding-3/+3
2016-08-30for mips-musl pass -ldl and co to the linkerJorge Aparicio-1/+1
2016-08-30rustbuild: fix building std for musl targetsJorge Aparicio-1/+1
closes #36143
2016-07-26rustbuild: make backtraces (RUST_BACKTRACE) optionalJorge Aparicio-1/+2
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-06-16Fix issue where rustbuild expected msvc to have arPeter Atashian-1/+2
Signed-off-by: Peter Atashian <retep998@gmail.com>
2016-05-10rustbuild: Tighten dependencies of build scriptsAlex Crichton-3/+13
Ensure that `rerun-if-changed` is printed for all build scripts to ensure that they've all got the right list of dependencies.
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-20/+1
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-03-21std: Link to gcc_s on NetBSDAlex Crichton-1/+3
Currently the nightlies we're producing fail when linking some C code into a Rust application with the error message: libgcc_s.so.1: error adding symbols: DSO missing from command line By linking `gcc_s` instead of `gcc` this error goes away. I haven't tested this on NetBSD itself, but should help get the Linux cross-compile image moreso up and working!
2016-03-08cover more linux targets in libstd cargobuildarcnmx-5/+5
2016-03-06rustbuild: fix cross compilation of libstd to i686-unknown-linux-muslJorge Aparicio-1/+1
- make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target.
2016-03-03[rustbuild] fix cross compilation of std for mips(el)-linux-muslJorge Aparicio-1/+1
These targets don't link statically to libunwind or libc
2016-03-02Fix compiling libstd with emscripten target.ashleysommer-1/+1
Was getting error: ``` running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu" ... Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized ``` Undo change to libbacktrace configure script. Modify libstd build.rs to not build libbacktrace in the case of targeting emscripten.
2016-02-11bootstrap: Add directives to not double-link libsAlex Crichton-0/+2
Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate `#[cfg]` definitions to all crates to avoid linking anything if this is passed. This should help allow libstd to compile with both the makefiles and with Cargo.