You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bindgen fails with hard-to-debug erros (see example) when invoked cargo's target riscv32imac-unknown-none-elf. I can pass a --target=riscv32 flag explicitly passed in via a CFLAG -- but the code for that is described as only a workaround for a long-closed clang issue.
The platform passed in as TARGET from cargo is riscv32imac-unknown-none-elf in those cases, but needs to be passed to clang as riscv32-unknown-none-elf (or riscv32).
I'm not sure whether bindgen is the right place to fix the mismatch between riscv32imac and riscv32, but the workaround I have to use seems to indicate that the TARGET used from cargo is not exactly the value --target needs.
Minimal example (would expect the output of the lower command for the higher command too)
$ touch null.h
$ TARGET=riscv32imac-unknown-none-elf bindgen ./null.h
thread 'main' panicked at 'libclang error; possible causes include:- Invalid flag syntax- Unrecognized flags- Invalid flag arguments- File I/O errorsIf you encounter an error missing from this list, please file an issue or a PR!', src/libcore/option.rs:1036:5
note: Run with `RUST_BACKTRACE=1`for a backtrace.
$ TARGET=riscv32imac-unknown-none-elf bindgen ./null.h -- --target=riscv32-unknown-none-elf
/* automatically generated by rust-bindgen */
The text was updated successfully, but these errors were encountered:
Sorry for the lag here. We should probably add the default target detection and such to the libclang search as well (that is, to make it happen sooner).
Bindgen fails with hard-to-debug erros (see example) when invoked cargo's target riscv32imac-unknown-none-elf. I can pass a
--target=riscv32
flag explicitly passed in via a CFLAG -- but the code for that is described as only a workaround for a long-closed clang issue.The platform passed in as TARGET from cargo is
riscv32imac-unknown-none-elf
in those cases, but needs to be passed to clang asriscv32-unknown-none-elf
(orriscv32
).I'm not sure whether bindgen is the right place to fix the mismatch between riscv32imac and riscv32, but the workaround I have to use seems to indicate that the
TARGET
used from cargo is not exactly the value--target
needs.Minimal example (would expect the output of the lower command for the higher command too)
The text was updated successfully, but these errors were encountered: