about summary refs log tree commit diff
path: root/src/liblibc
AgeCommit message (Collapse)AuthorLines
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-0/+0
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-07Add x86_64-fortanix-unknown-sgx target to libstd and dependenciesJethro Beekman-0/+0
The files src/libstd/sys/sgx/*.rs are mostly copied/adapted from the wasm target. This also updates the dlmalloc submodule to the very latest version.
2018-10-18Revert liblibc submodule urljD91mZM2-0/+0
2018-08-24Update libc to include Fuchsia fixesTaylor Cramer-0/+0
2018-08-08Update libc and activate align featureLinus Färnstrand-0/+0
2018-07-01Update liblibcest31-0/+0
2018-03-26Update liblibc submodule to the 0.2.40 releaseFrancis Gagné-0/+0
2018-03-12Update libc to 0.2.39Bryan Drewery-0/+0
CC #42681
2018-01-24Update libcMarco A L Barbosa-0/+0
2018-01-08Upgrade liblibc to latest upstream version.Ed Schouten-0/+0
This version of liblibc is a prerequisite for getting libstd to build on CloudABI.
2017-12-17add aarch64-unknown-openbsd supportSébastien Marie-0/+0
- make liblibc to point to libc with aarch64-unknown-openbsd - make c_char (in std::os::raw) to point to right value
2017-11-26Update libc to include latest Fuchsia fixTaylor Cramer-0/+0
2017-11-16Update libc to include Fuchsia changesTaylor Cramer-0/+0
2017-11-14Update libc (new const definitions for Linux sparc64)Marco A L Barbosa-0/+0
2017-11-09Use getrandom syscall for all Linux and Android targets.Marco A L Barbosa-0/+0
2017-10-31Bump libc to 0.2.33Marco A L Barbosa-0/+0
2017-10-19Update libc to include linux gnux32 fixesMarco A L Barbosa-0/+0
2017-09-24bump liblibc to 0.2.31James Tucker-0/+0
2017-09-21Trim and document libc shimTamir Duberstein-0/+0
2017-09-08Update liblibc submodule to include latest uclibc changesTobias Schaffner-0/+0
2017-08-30Update libc to fix sparc compilesAlex Crichton-0/+0
2017-08-28Update the libc submoduleAlex Crichton-0/+0
Brings in a few fixes for wasm/asmjs
2017-08-07addrinfo hint in lookup_host() needs clean initialization on all platformsDanek Duvall-0/+0
Fixes #43649
2017-07-18Update liblibcJeremy Soller-0/+0
2017-06-20Update libc to 0.2.24Malo Jaffré-0/+0
Fixes #42427.
2017-05-04Reload nameserver information on lookup failureJon Gjengset-0/+0
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-04-20Update libc to include x86_64-linux-android supportMarco A L Barbosa-0/+0
2017-03-25Update libc to 0.2.21Marco A L Barbosa-0/+0
2017-02-22Update name_bytes, scoop up latest libcRaph Levien-0/+0
Update the implementation of name_bytes to use the owned string (which is thread safe). Also bump the src/liblibc submodule now that's merged.
2017-02-06liblibc: Update to include aarch64-unknown-freebsd supportJean-Sébastien Pédron-0/+0
2017-02-04libstd/net: Add `peek` APIs to UdpSocket and TcpStreamTyler Julian-0/+0
These methods enable socket reads without side-effects. That is, repeated calls to peek() return identical data. This is accomplished by providing the POSIX flag MSG_PEEK to the underlying socket read operations. This also moves the current implementation of recv_from out of the platform-independent sys_common and into respective sys/windows and sys/unix implementations. This allows for more platform-dependent implementations.
2017-01-03Properly ban the negation of unsigned integers in type-checking.Eduard-Mihai Burtescu-0/+0
2016-12-30sparc64-linux supportJorge Aparicio-0/+0
2016-12-21Update liblibc, go back to lazy linking openlibmJeremy Soller-0/+0
2016-12-03update src/liblibc to include i686-unknown-openbsd libc definitionSébastien Marie-0/+0
2016-11-16rustc: Implement #[link(cfg(..))] and crt-staticAlex Crichton-0/+0
This commit is an implementation of [RFC 1721] which adds a new target feature to the compiler, `crt-static`, which can be used to select how the C runtime for a target is linked. Most targets dynamically linke the C runtime by default with the notable exception of some of the musl targets. [RFC 1721]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md This commit first adds the new target-feature, `crt-static`. If enabled, then the `cfg(target_feature = "crt-static")` will be available. Targets like musl will have this enabled by default. This feature can be controlled through the standard target-feature interface, `-C target-feature=+crt-static` or `-C target-feature=-crt-static`. Next this adds an gated and unstable `#[link(cfg(..))]` feature to enable the `crt-static` semantics we want with libc. The exact behavior of this attribute is a little squishy, but it's intended to be a forever-unstable implementation detail of the liblibc crate. Specifically the `#[link(cfg(..))]` annotation means that the `#[link]` directive is only active in a compilation unit if that `cfg` value is satisfied. For example when compiling an rlib, these directives are just encoded and ignored for dylibs, and all staticlibs are continued to be put into the rlib as usual. When placing that rlib into a staticlib, executable, or dylib, however, the `cfg` is evaluated *as if it were defined in the final artifact* and the library is decided to be linked or not. Essentially, what'll happen is: * On MSVC with `-C target-feature=-crt-static`, the `msvcrt.lib` library will be linked to. * On MSVC with `-C target-feature=+crt-static`, the `libcmt.lib` library will be linked to. * On musl with `-C target-feature=-crt-static`, the object files in liblibc.rlib are removed and `-lc` is passed instead. * On musl with `-C target-feature=+crt-static`, the object files in liblibc.rlib are used and `-lc` is not passed. This commit does **not** include an update to the liblibc module to implement these changes. I plan to do that just after the 1.14.0 beta release is cut to ensure we get ample time to test this feature. cc #37406
2016-10-24Support for aarch64 architecture on FuchsiaRaph Levien-0/+0
This patch adds support for the aarch64-unknown-fuchsia target. Also updates src/liblibc submodule to include required libc change.
2016-10-22Update libc submodule with corresponding fuchsia changesRaph Levien-0/+0
Also trim os::fuchsia::raw architectures.
2016-10-11std: Update liblibc submoduleAlex Crichton-0/+0
This fixes compilation on the s390x target
2016-10-09use MSG_NOSIGNAL on all relevant platformsMathieu Poumeyrol-0/+0
2016-09-28use MSG_NOSIGNAL from liblibcMathieu Poumeyrol-0/+0
2016-09-26When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.Tomasz Miąsko-0/+0
Fixes issue #36546. This change also updates libc to earliest version that includes EAI_SYSTEM constant.
2016-09-09Add s390x supportUlrich Weigand-0/+0
This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-08-29update libc submoduleJorge Aparicio-0/+0
2016-08-27update libcJorge Aparicio-0/+0
2016-07-30point the libc submodule back to rust-lang/libcJorge Aparicio-0/+0
2016-07-30arm-musl targets now use cfg(env = "musl")Jorge Aparicio-0/+0
2016-07-11libc: fast-forward for solaris `RTLD_DEFAULT`Josh Stone-0/+0
2016-06-02Update libc to bring in pthread mutex type definitionsAmanieu d'Antras-0/+0
2016-05-17std: Update libc submoduleAlex Crichton-0/+0
Brings in a fix where `-lutil` is no longer passed for musl targets, lifting the need for a musl toolchain to be installed again. Closes #33608