nyxstone-rs
Official bindings for the Nyxstone assembler/disassembler engine.
Building
The project can be build via cargo build, as long as LLVM with a major version in the range 15-18 is installed in the $PATH or the environment variable $NYXSTONE_LLVM_PREFIX points to the installation location of a LLVM library.
LLVM might be linked against FFI, but not correctly report this fact via llvm-config. If your LLVM does link FFI and
Nyxstone fails to run, set the NYXSTONE_LINK_FFI environment variable to 1, which will ensure that Nyxstone
links against libffi.
Installation
Add nyxstone as a dependency in your Cargo.toml:
[dependencies]
nyxstone = "0.1"
Building nyxstone requires a C/C++ compiler to be installed on your system. Additionally, Nyxstone requires LLVM with a major version in the range 15-18.
Sample
In the following is a short sample of what using Nyxstone can look like:
extern crate anyhow;
extern crate nyxstone;
use HashMap;
use Result;
use ;
Technical overview
The nyxstone-rs bindings are generated via the cxx crate. Since nyxstone is specifically a c++ library, we currently do not plan to support C bindings via bindgen.
Acknowledgements
The build script of the rust bindings borrow heavily from the llvm-sys build script.