Skip to content

Newer libc versions (0.2.113 or later) don't compile with Rust-GPU's rust-toolchain. #907

Closed
@Makogan

Description

@Makogan

Expected Behaviour

Following the steps described in the docs should work without errors in the supported platforms.

Example & Steps To Reproduce

  1. Create a new blanket rust project with cargo new
  2. Copy the rust tool-chain file from git onto the root of the project
  3. Add [build-dependencies] spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu" } to the toml file.
  4. Create a build.rs file, copy the snippet from the docs and replace the path to the shader and the target with the relevant strings.

System Info

  • Rust: rust version rustc 1.62.0-nightly (1f7fb6413 2022-04-10)
  • OS: Ubuntu 22.04
  • GPU: Nvidia GTX 1070
  • SPIR-V: vulkan

Backtrace

error[E0658]: `const extern fn` definitions are unstable
    --> /home/makogan/.cargo/registry/src/github.spider-man.dpdns.org-1ecc6299db9ec823/libc-0.2.131/src/macros.rs:188:17
     |
188  | /                 pub $($constness)* unsafe extern fn $i($($arg: $argty),*
189  | |                 ) -> $ret {
190  | |                     $($body);*
191  | |                 }
     | |_________________^
     |
    ::: /home/makogan/.cargo/registry/src/github.spider-man.dpdns.org-1ecc6299db9ec823/libc-0.2.131/src/unix/linux_like/mod.rs:1499:1
     |
1499 | / f! {
1500 | |     pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
1501 | |         if (*mhdr).msg_controllen as usize >= ::mem::size_of::<cmsghdr>() {
1502 | |             (*mhdr).msg_control as *mut cmsghdr
...    |
1545 | |     }
1546 | | }
     | |_- in this macro invocation
     |
     = note: see issue #64926 <https://github.com/rust-lang/rust/issues/64926> for more information
     = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable
     = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `const extern fn` definitions are unstable
    --> /home/makogan/.cargo/registry/src/github.spider-man.dpdns.org-1ecc6299db9ec823/libc-0.2.131/src/macros.rs:203:17
     |
203  | /                 pub $($constness)* extern fn $i($($arg: $argty),*
204  | |                 ) -> $ret {
205  | |                     $($body);*
206  | |                 }
     | |_________________^
     |
    ::: /home/makogan/.cargo/registry/src/github.spider-man.dpdns.org-1ecc6299db9ec823/libc-0.2.131/src/unix/linux_like/mod.rs:1548:1
     |
1548 | / safe_f! {
1549 | |     pub fn SIGRTMAX() -> ::c_int {
1550 | |         unsafe { __libc_current_sigrtmax() }
1551 | |     }
...    |
1615 | |     }
1616 | | }
     | |_- in this macro invocation
     |
     = note: see issue #64926 <https://github.com/rust-lang/rust/issues/64926> for more information
     = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable
     = note: this error originates in the macro `safe_f` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    t: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions