-
Notifications
You must be signed in to change notification settings - Fork 3
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
libc dependencies #13
Comments
This might be solved together with #1 IF we go the abstract_platform way. It might make sense to split some low-level primitives off into their own crate, such that you can depend on that instead of libc. |
@aturon's comment (rust-lang/rfcs#1783 (comment)) deciding to close rust-lang/rfcs#1783 actually has a fairly compatible plan:
|
Would the work happening on https://github.com/redox-os/relibc help or overlap at all? |
@jesselucas whoops, yes, I meant to link to that, thanks. |
Inevitably, when depending on a lot of crates, you'll find you have a dependency on
libc
. This issue tracks what can be done in such cases for platforms that don't have a nativelibc
.An implementation of the
libc
API in Rust: https://github.com/redox-os/relibclibc
crateSome crates might depend directly on the
libc
crate. That's probably the case becausestd
doesn't directly expose the needed functionality. Currently using this on a non-C platform this means you'll need to maintain a fork of those crates implementing the functionality another way, or just removing the affected functionality all together. You might have to maintain those forks too, since not all upstream crates are amenable to upstreaming such changes (see e.g. rand, chrono, yasna).C types only
Some crates depend on the
libc
crate only for platform-specific type definitions, such asc_void
orintptr_t
. These types are not really part oflibc
, but rather of the standard C ABI for a platform. Some, but not all, types are also defined instd::os::raw
, which has been mentioned as a candidate for deprecation. An RFC to pull such types into a separate crate failed, although the it seems likely that it could be revived now thatextern type
is implemented.C libraries
Other types of crates might depend on C libraries that themselves depend on
libc
. My strategy there so far has been tostrcmp
, etc.)connect
,printf
, etc.)#[no_mangle] extern "C" fn
s (malloc
, etc.)This is also a lot of work.
The text was updated successfully, but these errors were encountered: