I am trying to make a
no_std "-sys" crate using bindgen. I successfully followed the guide, the crate builds and passes tests, but when I try to use it in a project using a custom target (bare metal x86_64) I get the following error:
thread 'main' panicked at 'libclang error; possible causes include: - Invalid flag syntax - Unrecognized flags - Invalid flag arguments - File I/O errors - Host vs. target architecture mismatch
When I remove the build.rs and instead use the bindgen CLI to generate the Rust library file I can use the crate with the custom target without issue.
I've looked for a way to manually set the target for bindgen without luck, does anyone have any advice? Thanks:)
Edit: I've also tried the
.clang_arg("--target x86_64-pc-linux-gnu") method on the bindgen Builder without any luck