1.0: Remove all instances of `link(name = ...)` and delete the `std` feature

Open
#5,265 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start at src/unix/mod.rs, especially the link attributes around the section linked in the issue, and search the repository for link(name = ...) and the std feature. Done means those link directives and the std feature are removed while no-std users can still use the bindings without libc emitting them.

Written by the indexing model from the issue text.

Description

Currently, libc expects std to provide all link directives necessary. If the std feature is disabled, instead libc emits link attributes: https://github.com/rust-lang/libc/blob/f24764dc460a26c90b2d967fcffb7b341f8393f3/src/unix/mod.rs#L439-L624

We discussed at rustweek 2025 that we should remove this and expect users to add their own link attributes when building in no-std environments. This way you can still use the bindings even if some of the libraries aren't available.

Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/libc

All issues in rust-lang/libc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.