Skip to content
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

Hard error compiling libc 0.2.36: #![feature(link_cfg)] missing ? #928

Closed
gnzlbg opened this issue Feb 27, 2018 · 8 comments
Closed

Hard error compiling libc 0.2.36: #![feature(link_cfg)] missing ? #928

gnzlbg opened this issue Feb 27, 2018 · 8 comments

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 27, 2018

 Compiling libc v0.2.36
error[E0658]: is feature gated (see issue #37406)
   --> /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/libc-0.2.36/src/unix/mod.rs:279:9
    |
279 |         #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add #![feature(link_cfg)] to the crate attributes to enable
@gnzlbg
Copy link
Contributor Author

gnzlbg commented Feb 27, 2018

Seems to only fail when building libc with --no-default-features on some targets:

  • arm-unknown-linux-musleabi
  • armv7-unknown-linux-musleabi
  • i686-unknown-linux-musl
  • x86_64-unknown-linux-musl

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Feb 27, 2018

Looks like libc's CI does not test building libc with --no-default-features... opening an issue about this: #929

@alexcrichton
Copy link
Member

Argh this definitely wasn't intentional. Although I'm not sure that the no_std build of the musl version of libc would work otherwise...

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Feb 27, 2018

They used to work last month just fine :/

@alexcrichton
Copy link
Member

I forget which PR caused this at this point but I think it's fine to fix whenever basically

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Feb 27, 2018

yeah I am working on a fix :)

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Feb 27, 2018

I don't know if we just need to enable the nightly feature and require nightly for no-std builds, or if there is something better that we can do like not using the link attribute somehow. Requiring nightly for libc is... probably a bad idea.

@alexcrichton
Copy link
Member

Yeah I don't think we should require nightly for no_std builds, but rather we just need to compile it differently when included in libstd and when included in cargo

bors added a commit that referenced this issue Feb 28, 2018
Fix --no-default-features builds

Closes #928 #929 #684
@bors bors closed this as completed in #930 Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants