Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicolasbauw/rust-asm-ffi
Using FFI to Call Assembly Functions from Rust
https://github.com/nicolasbauw/rust-asm-ffi
arm assembly cross-compilation ffi risc-v rust
Last synced: 6 days ago
JSON representation
Using FFI to Call Assembly Functions from Rust
- Host: GitHub
- URL: https://github.com/nicolasbauw/rust-asm-ffi
- Owner: nicolasbauw
- Created: 2024-01-20T17:31:04.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-07T19:27:45.000Z (about 1 year ago)
- Last Synced: 2025-02-05T17:18:53.400Z (6 days ago)
- Topics: arm, assembly, cross-compilation, ffi, risc-v, rust
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Using FFI to Call Assembly Functions from Rust
This is a mini-howto for people wanting to call assembly functions from their Rust code.
- assembly is not inline assembly, but a separate .s source file
- just replace mnemonics to fit your target CPU (here, three examples for armv6, aarch64 and riscv64)Cross-compilation for Raspberry Pi 1B:
```
rustup target add arm-unknown-linux-musleabihf
brew install arm-linux-gnueabihf-binutils
cargo build --target="arm-unknown-linux-musleabihf" --release
```Linux users could replace musleabihf by gnueabihf.