tov / libffi-rs

Rust bindings for libffi
Apache License 2.0
104 stars 36 forks source link

Support aarch64 msvc target #65

Closed syrel closed 1 year ago

syrel commented 1 year ago

Hi

I noticed that it is not possible to compile libffi for aarch64 msvc target:

cargo build --target aarch64-pc-windows-msvc -vvvv

This PR refactors msvc.rs to slightly generalise the build process of msvc targets. In addition, it adds support for cross-compilation by passing INCLUDE env.var constructed by cc::Build to the cl.exe in the asm pre-processing step, otherwise it would not be able to find appropriate headers for the target architecture.

syrel commented 1 year ago

I think it would also make sense to add aarch64-pc-windows-msvc to https://github.com/tov/libffi-rs/blob/1e6047ce78c643cee0cc11d597ffbb24612259e3/.github/workflows/test.yml#L25

yorickpeterse commented 1 year ago

I think it would also make sense to add aarch64-pc-windows-msvc to

https://github.com/tov/libffi-rs/blob/1e6047ce78c643cee0cc11d597ffbb24612259e3/.github/workflows/test.yml#L25

Is this supported by GitHub actions? If so, please include the necessary changes for that in this PR :smiley:

syrel commented 1 year ago

Hi @YorickPeterse Thanks for bearing with me 😃 I have extended the cross compilation matrix with aarch64-pc-windows-msvc. Had to separate toolchain and target because aarch64 toolchain can't be installed on github VMs. There seem to be a few flaky tests today due to network issues. Otherwise feel free to integrate the PR!

yorickpeterse commented 1 year ago

@syrel Thanks!