tov / libffi-rs

Rust bindings for libffi
Apache License 2.0
100 stars 35 forks source link

libffi-sys: arch: add constants for the MIPS family #87

Closed chenx97 closed 9 months ago

chenx97 commented 9 months ago

Fixes #67.

chenx97 commented 9 months ago

This architecture family has known QEMU support, but has been demoted to tier-3. Should I add it to the test matrix? We can use cargo +nightly -Zbuild-std if you want to automatically test them.

chenx97 commented 9 months ago

@yorickpeterse would you mind taking a look at this patch?

chenx97 commented 9 months ago

the heck? I locally tried both ubuntu 22.04 and debian bookworm, and s390x successfully passed the tests.

# export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
# export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER='qemu-s390x -L /usr/s390x-linux-gnu'
# cargo +1.48.0 test --no-default-features --target=s390x-unknown-linux-gnu
   Compiling libc v0.2.150
   Compiling cc v1.0.83
   Compiling libffi-sys v2.3.0 (/ffirs/libffi-sys-rs)
   Compiling libffi v3.2.0 (/ffirs/libffi-rs)
    Finished test [unoptimized + debuginfo] target(s) in 13.91s
     Running /ffirs/target/s390x-unknown-linux-gnu/debug/deps/libffi-ee9f2b15a895b394

running 12 tests
test middle::test::call ... ok
test high::test::new_mut ... ok
test high::test::new_with_cif_mut ... ok
test high::test::new_with_cif ... ok
test high::test::new ... ok
test middle::test::clone_cif ... ok
test middle::test::closure ... ok
test middle::test::rust_lambda ... ok
test middle::types::test::clone_u64 ... ok
test middle::types::test::clone_struct ... ok
test middle::types::test::create_struct ... ok
test middle::types::test::create_u64 ... ok

test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Debugging suggestions would be appreciated.

yorickpeterse commented 9 months ago

@chenx97 The failures are random so it's fine. Thanks for the changes!