Skip to content

Cannot build rust stdlib for VxWorks #148125

@hax0kartik

Description

@hax0kartik

It seems like building rust stdlib for vxworks on master is broken:

   Compiling cfg-if v1.0.1
   Compiling unwind v0.0.0 (/home/karthik/rust-m/library/unwind)
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/karthik/rust-m/library/rustc-std-workspace-alloc)
   Compiling panic_unwind v0.0.0 (/home/karthik/rust-m/library/panic_unwind)
   Compiling gimli v0.32.0
   Compiling std_detect v0.1.5 (/home/karthik/rust-m/library/std_detect)
   Compiling miniz_oxide v0.8.9
   Compiling hashbrown v0.15.5
   Compiling addr2line v0.25.0
error[E0425]: cannot find value `AT_SYMLINK_NOFOLLOW` in crate `libc`
    --> library/std/src/sys/fs/unix.rs:2162:63
     |
2162 |             let flags = if follow_symlinks { 0 } else { libc::AT_SYMLINK_NOFOLLOW };
     |                                                               ^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `utimensat` in crate `libc`
    --> library/std/src/sys/fs/unix.rs:2181:32
     |
2181 |             cvt(unsafe { libc::utimensat(libc::AT_FDCWD, p.as_ptr(), times.as_ptr(), flags) })?;
     |                                ^^^^^^^^^ help: a function with a similar name exists: `futimens`
     |
    ::: /home/karthik/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.177/src/vxworks/mod.rs:1273:5
     |
1273 |     pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
     |     ------------------------------------------------------------------- similarly named function `futimens` defined here

error[E0425]: cannot find value `AT_FDCWD` in crate `libc`
    --> library/std/src/sys/fs/unix.rs:2181:48
     |
2181 |             cvt(unsafe { libc::utimensat(libc::AT_FDCWD, p.as_ptr(), times.as_ptr(), flags) })?;
     |                                                ^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `O_NOFOLLOW` in crate `libc`
   --> library/std/src/sys/fs/mod.rs:136:36
    |
136 |         options.custom_flags(libc::O_NOFOLLOW);
    |                                    ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `_SC_HOST_NAME_MAX` in crate `libc`
 --> library/std/src/sys/net/hostname/unix.rs:8:60
  |
8 |     let host_name_max = match unsafe { libc::sysconf(libc::_SC_HOST_NAME_MAX) } {
  |                                                            ^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `strnlen` in crate `libc`
    --> library/std/src/sys/net/hostname/unix.rs:37:42
     |
  37 |                 let len = unsafe { libc::strnlen(buf.as_ptr().cast(), buf.capacity()) };
     |                                          ^^^^^^^ help: a function with a similar name exists: `strlen`
     |
    ::: /home/karthik/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.177/src/vxworks/mod.rs:1190:5
     |
1190 |     pub fn strlen(cs: *const c_char) -> size_t;
     |     ------------------------------------------- similarly named function `strlen` defined here

Most of these defines/functions are present in VxWorks but have not been added in libc which is causing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-vxworksTarget: when they made us, they called us Curiosity, and Spirit, and told us to tell you helloT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions