rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document use with bindgen

TheButlah opened this issue · comments

I have been trying to get this to work with bindgen for about two days, to no avail. It works with cargo build but not with cargo zigbuild. I suspect this is because cargo zigbuild enforces zig's sysroot, which seemingly lacks stdio.h?

Documenting which specific combination of builder.clang_arg() or environment variables should be provided would be really helpful:

  • Do I pass --target as a clang arg to the bindgen builder?
  • What about --isysroot?

Note: I am attempting to cross compile from a m2 mac to aarch64-unknown-linux-gnu

Possibly related, I could just be hitting bugs in zigbuild which might be fixed soon: #140

Either way, documenting this would be super helpful

I would not say that this is documented yet

Feel free to send PRs to document it.