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

Add support for the loongarch64 architecture #75

Merged
merged 1 commit into from Apr 20, 2023
Merged

Add support for the loongarch64 architecture #75

merged 1 commit into from Apr 20, 2023

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Apr 7, 2023

No description provided.

@yorickpeterse
Copy link
Collaborator

@heiher Does qemu support this architecture? If so, please add this to the test matrix similar to https://github.com/tov/libffi-rs/pull/72/files.

@heiher heiher marked this pull request as draft April 8, 2023 03:25
@heiher
Copy link
Contributor Author

heiher commented Apr 8, 2023

@yorickpeterse Yes, QEMU does support this architecture. However, the latest version of Docker Ubuntu does not yet support it. Therefore, I conducted tests natively, and the results are as follows:

cargo test --no-default-features
   Compiling cc v1.0.79
   Compiling libc v0.2.141
   Compiling libffi-sys v2.2.1 (/home/hev/rust/libffi-rs/libffi-sys-rs)
   Compiling libffi v3.2.0 (/home/hev/rust/libffi-rs/libffi-rs)
    Finished test [unoptimized + debuginfo] target(s) in 13.30s
     Running unittests src/lib.rs (target/debug/deps/libffi-17240bee0f0172ee)

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

test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/libffi_sys-5bdfbe382a0b5751)

running 1 test
test test::test_function_with_two_arguments ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests libffi

running 17 tests
test src/low.rs - low::type_tag (line 178) ... ok
test src/low.rs - low::closure_free (line 389) ... ok
test src/low.rs - low::closure_alloc (line 365) ... ok
test src/low.rs - low::prep_cif (line 235) ... ok
test src/low.rs - low::prep_closure (line 464) ... ok
test src/low.rs - low::prep_closure_mut (line 556) ... ok
test src/middle/builder.rs - middle::builder::Builder (line 23) ... ok
test src/low.rs - low::call (line 321) ... ok
test src/lib.rs - (line 72) ... ok
test src/high/mod.rs - high (line 35) ... ok
test src/middle/mod.rs - middle::Cif (line 65) ... ok
test src/middle/mod.rs - middle::Closure (line 194) ... ok
test src/high/mod.rs - high (line 55) ... ok
test src/high/call.rs - high::call (line 8) ... ok
test src/high/call.rs - high::call::ffi_call (line 99) ... ok
test src/high/call.rs - high::call::call (line 64) ... ok
test src/middle/types.rs - middle::types::Type (line 45) ... ok

test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.73s

   Doc-tests libffi-sys

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
cargo test --features system
   Compiling cc v1.0.79
   Compiling libc v0.2.141
   Compiling libffi-sys v2.2.1 (/home/hev/rust/libffi-rs/libffi-sys-rs)
   Compiling libffi v3.2.0 (/home/hev/rust/libffi-rs/libffi-rs)
    Finished test [unoptimized + debuginfo] target(s) in 6.66s
     Running unittests src/lib.rs (target/debug/deps/libffi-e9d2cf5f3b99046a)

running 12 tests
test high::test::new_with_cif ... ok
test high::test::new ... ok
test middle::test::call ... ok
test high::test::new_mut ... ok
test high::test::new_with_cif_mut ... ok
test middle::test::clone_cif ... ok
test middle::test::rust_lambda ... ok
test middle::test::closure ... ok
test middle::types::test::clone_struct ... ok
test middle::types::test::clone_u64 ... 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; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/libffi_sys-2363ea291f277eba)

running 1 test
test test::test_function_with_two_arguments ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests libffi

running 17 tests
test src/low.rs - low::type_tag (line 178) ... ok
test src/low.rs - low::closure_alloc (line 365) ... ok
test src/low.rs - low::prep_cif (line 235) ... ok
test src/low.rs - low::prep_closure_mut (line 556) ... ok
test src/low.rs - low::prep_closure (line 464) ... ok
test src/low.rs - low::closure_free (line 389) ... ok
test src/middle/builder.rs - middle::builder::Builder (line 23) ... ok
test src/low.rs - low::call (line 321) ... ok
test src/lib.rs - (line 72) ... ok
test src/middle/mod.rs - middle::Cif (line 65) ... ok
test src/middle/mod.rs - middle::Closure (line 194) ... ok
test src/high/mod.rs - high (line 55) ... ok
test src/high/call.rs - high::call (line 8) ... ok
test src/high/mod.rs - high (line 35) ... ok
test src/high/call.rs - high::call::call (line 64) ... ok
test src/high/call.rs - high::call::ffi_call (line 99) ... ok
test src/middle/types.rs - middle::types::Type (line 45) ... ok

test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.74s

   Doc-tests libffi-sys

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

@heiher heiher marked this pull request as ready for review April 8, 2023 14:45
@heiher
Copy link
Contributor Author

heiher commented Apr 12, 2023

rust-lang/rust#96971 merged. Maybe we are ready to go? :)

@yorickpeterse
Copy link
Collaborator

yorickpeterse commented Apr 13, 2023

@heiher Is there any indication as to when QEMU on the GitHub actions image would support this architecture? Or is there perhaps a way to use a newer version of QEMU (without compiling it from source every build)? I'm hesitant to add/claim support of architectures we can't test for, unless there's simply no reasonable option available.

@heiher heiher marked this pull request as draft April 13, 2023 01:31
@heiher
Copy link
Contributor Author

heiher commented Apr 20, 2023

@yorickpeterse It appears that QEMU is not an issue, but since the stable and beta channels currently do not support loongarch64, we would like to request that CI support only be added after the loongarch64-unknown-linux-gnu target is promoted to Tier 2. What is your opinion on this? Thank you.

@heiher heiher marked this pull request as ready for review April 20, 2023 02:59
@yorickpeterse
Copy link
Collaborator

@heiher Ah I see. I'm guessing it will take a while for Rust to support this architecture, so in that case we'll just merge this in the mean time. Thanks!

@yorickpeterse yorickpeterse merged commit b625102 into tov:master Apr 20, 2023
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

Successfully merging this pull request may close these issues.

2 participants