Skip to content

Commit

Permalink
build.rs: Manually pass the host to bindgen clang
Browse files Browse the repository at this point in the history
In order to avoid errors like this when cross compiling:

    error: unknown target triple 'riscv32imc-unknown-none-elf', please use -triple or -arch

we pass the host target to clang instead of the target.

See rust-lang/rust-bindgen#1728 for the
upstream issue.

Signed-off-by: Alistair Francis <[email protected]>
  • Loading branch information
alistair23 committed Nov 9, 2023
1 parent d5a3bd2 commit a0aadc3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ fn main() {
.blocklist_function("qgcvt")
.blocklist_function("strtold")
.blocklist_type("_Float64x")
.clang_arg(format!("--target={}", env::var("HOST").unwrap()))
.generate()
.expect("Unable to generate bindings");

Expand Down

0 comments on commit a0aadc3

Please sign in to comment.