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

Cross compilation to arm-linux-androideabi is broken #1467

Closed
Darksonn opened this issue Mar 4, 2021 · 8 comments
Closed

Cross compilation to arm-linux-androideabi is broken #1467

Darksonn opened this issue Mar 4, 2021 · 8 comments

Comments

@Darksonn
Copy link
Contributor

Darksonn commented Mar 4, 2021

The CI setup in Tokio has broken due to libc not providing an accept4 function on that platform. See e.g. this run

error[E0425]: cannot find function `accept4` in crate `libc`
Error:    --> /cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.9/src/sys/unix/tcp.rs:446:18
    |
446 |           syscall!(accept4(
    |                    ^^^^^^^ help: a function with a similar name exists: `accept`
    | 
   ::: /cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.87/src/unix/mod.rs:686:5
    |
686 | /     pub fn accept(
687 | |         socket: ::c_int,
688 | |         address: *mut sockaddr,
689 | |         address_len: *mut socklen_t,
690 | |     ) -> ::c_int;
    | |_________________- similarly named function `accept` defined here

error[E0425]: cannot find function `accept4` in crate `libc`
Error:    --> /cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.9/src/sys/unix/uds/listener.rs:55:18
    |
55  |           syscall!(accept4(
    |                    ^^^^^^^ help: a function with a similar name exists: `accept`
    | 
   ::: /cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.87/src/unix/mod.rs:686:5
    |
686 | /     pub fn accept(
687 | |         socket: ::c_int,
688 | |         address: *mut sockaddr,
689 | |         address_len: *mut socklen_t,
690 | |     ) -> ::c_int;
    | |_________________- similarly named function `accept` defined here

Refs: #1465

@dndll
Copy link

dndll commented Mar 5, 2021

Can confirm same for me on libc 0.2.87

@RoastVeg
Copy link

RoastVeg commented Mar 5, 2021

Likewise for armv7-linux-androideabi using libc 0.2.87.

@Thomasdezeeuw
Copy link
Collaborator

This seems like a regression in libc..? The CI for #1468 now also fails on Android arm, which passed before.

@Thomasdezeeuw
Copy link
Collaborator

Thomasdezeeuw commented Mar 5, 2021

Confirmed that this is a regression between libc 0.2.86 and 0.2.87.

@Thomasdezeeuw
Copy link
Collaborator

I created rust-lang/libc#2101.

@Thomasdezeeuw
Copy link
Collaborator

Re-posting from #1469.

For a quick fix add the following to your Cargo.toml:

[dependencies]
libc = "=0.2.86" # Note the `=` here.

@RoastVeg
Copy link

RoastVeg commented Mar 5, 2021

In our cross-compilation heavy project we were more specific:

[target.'cfg(target_arch="arm", target_os="android", target_pointer_width="32")'.dependencies]
libc = "=0.2.86"

@Thomasdezeeuw
Copy link
Collaborator

Libc v0.2.88 is out, so after a cargo update this should all work again.

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

4 participants