RazrFalcon/memmap2-rs

Doesn't compile for freebsd

Closed this issue · 3 comments

From my mac m1:

$ rustup target add x86_64-unknown-freebsd
$ cargo check  --target x86_64-unknown-freebsd
    Checking libc v0.2.151
    Checking memmap2 v0.9.1 (/Users/marcoieni/tmp/memmap2-rs)
error[E0425]: cannot find value `MAP_HUGETLB` in crate `libc`
    --> src/unix.rs:30:40
     |
30   | const MAP_HUGETLB: libc::c_int = libc::MAP_HUGETLB;
     |                                        ^^^^^^^^^^^ help: a constant with a similar name exists: `MFD_HUGETLB`
     |
    ::: /Users/marcoieni/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.151/src/unix/bsd/freebsdlike/freebsd/mod.rs:4503:1
     |
4503 | pub const MFD_HUGETLB: ::c_uint = 0x00000004;
     | ------------------------------- similarly named constant `MFD_HUGETLB` defined here

error[E0425]: cannot find value `MAP_HUGE_MASK` in crate `libc`
    --> src/unix.rs:33:42
     |
33   | const MAP_HUGE_MASK: libc::c_int = libc::MAP_HUGE_MASK;
     |                                          ^^^^^^^^^^^^^ help: a constant with a similar name exists: `MFD_HUGE_MASK`
     |
    ::: /Users/marcoieni/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.151/src/unix/bsd/freebsdlike/freebsd/mod.rs:4504:1
     |
4504 | pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000;
     | --------------------------------- similarly named constant `MFD_HUGE_MASK` defined here

error[E0425]: cannot find value `MAP_HUGE_SHIFT` in crate `libc`
  --> src/unix.rs:36:43
   |
36 | const MAP_HUGE_SHIFT: libc::c_int = libc::MAP_HUGE_SHIFT;
   |                                           ^^^^^^^^^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `memmap2` (lib) due to 3 previous errors

I got the same issue here.

One weird thing: I added the freebsd check in my CI and it's compiling there :/

Try now.

Now cargo check works, thanks! Can you release a new version so that I can run cargo update and fix my project? 🙏

Done.