-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Replace the in-tree libc with the external copy #29546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
15b73e3
to
ac14743
Compare
r=me |
Tagging this with relnotes to remind myself to mention the libc rewrite in the notes. |
f08e189
to
fafb135
Compare
@alexcrichton thanks to cc me yes, it seems to break openbsd, but it seems related to new-libc code. I will take a look. |
I have made a PR for make openbsd (and bitrig, I hope) be able to build libc rust-lang/libc#39 But I still have a weird error while trying to build rustc with my PR (stop in stage1 libstd building):
whereas a version with "plain" liblibc build fine. |
#![allow(unused_attributes)] | ||
#![cfg_attr(stage0, allow(unused_features))] | ||
#![cfg_attr(stage0, allow(unused_attributes))] | ||
#![cfg_attr(stage0, allow(improper_ctypes))] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton why this ? it breaks at least the openbsd build.
src/libstd/lib.rs
has drop_in_place
feature, but it used only on some targets. So removing unused_attributes
will break stage1/stage2 for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'll look into fixing, I'm not a huge fan of allowing lints like this which are intentionally here to help clean up some code!
586481d
to
c30a40d
Compare
⌛ Testing commit c30a40d with merge 4c0cd18... |
💔 Test failed - auto-mac-64-nopt-t |
c30a40d
to
29ddae2
Compare
@bors: r=brson 29ddae2 |
⌛ Testing commit 29ddae2 with merge 8ace105... |
💔 Test failed - auto-linux-musl-64-opt |
ecd4a29
to
615c345
Compare
@bors: r=brson 615c345 |
⌛ Testing commit 615c345 with merge 7612930... |
💔 Test failed - auto-linux-cross-opt |
615c345
to
9da29e0
Compare
@bors: r=brson 9da29e0813aa051b15cfd97874bd163ee52ac859 |
⌛ Testing commit 9da29e0 with merge 31ae76d... |
💔 Test failed - auto-linux-64-x-android-t |
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
9da29e0
to
3d28b8b
Compare
This commit replaces the in-tree liblibc with the [external clone](https://github.com/rust-lang-nursery/libc) which has no evolved beyond the in-tree version in light of its [recent redesign](rust-lang/rfcs#1291). The primary changes here are: * `src/liblibc/lib.rs` was deleted * `src/liblibc` is now a submodule pointing at the external repository * `src/libstd/sys/unix/{c.rs,sync.rs}` were both deleted having all bindings folded into the external liblibc. * Many ad-hoc `extern` blocks in the standard library were removed in favor of bindings now being in the external liblibc. * Many functions/types were added to `src/libstd/sys/windows/c.rs`, and the scattered definitions throughout the standard library were consolidated here. At the API level this commit is **not a breaking change**, although it is only very lightly tested on the *BSD variants and is probably going to break almost all of their builds! Follow-up commits to liblibc should in theory be all that's necessary to get the build working on the *BSDs again.
I've been in London at MozFest. I'm trying to catch up now. |
@dhuseby : One thing you have to fix for FreeBSD is to define SIGSTKSZ. I did it for DragonFly (rust-lang/libc#60), but didn't know the exact value for FreeBSD. |
@mneumann thanks, i believe it's fixed now. |
This commit replaces the in-tree liblibc with the external clone which has no evolved beyond the in-tree version in light of its recent redesign.
The primary changes here are:
src/liblibc/lib.rs
was deletedsrc/liblibc
is now a submodule pointing at the external repositorysrc/libstd/sys/unix/{c.rs,sync.rs}
were both deleted having all bindings folded into the external liblibc.extern
blocks in the standard library were removed in favor of bindings now being in the external liblibc.src/libstd/sys/windows/c.rs
, and the scattered definitions throughout the standard library were consolidated here.At the API level this commit is not a breaking change, although it is only very lightly tested on the *BSD variants and is probably going to break almost all of their builds! Follow-up commits to liblibc should in theory be all that's necessary to get the build working on the *BSDs again.