-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross-compiled crate appears to include host header files after 0.30 #1229
Comments
I added a "successful" dump to the gist (they're named |
Thanks for the bug report! The best way to help solve it would be to create a minimal, standalone test case that reproduces system headers getting included. Unfortunately, because this has to do with includes and include paths, I don't think |
I've been experiencing similar problem. For simple #include <stdint.h> Running let bindings = bindgen::Builder::default()
.header("wrapper.h")
.generate()
.expect("Unable to generate bindings"); or running the following command
produces the same error.
I had to add explicit .clang_arg("--sysroot=/my/path/to/arm/sysroot") |
I encountered the same problem where the i386 stubs-32.h was getting referenced when trying to cross-compile for armhf. I was able to get past it by modifying
That was on Xenial, then on Bionic it still couldn't find the proper cross-target headers, and complained about being unable to find
and then was able to cross-compile all the Rust code in Firefox 59. |
Hey everyone, I've added the ability to pass additional clang arguments through an environment variable, while trying trying to tackle this exact problem. If you use that to pass If anyone could try that, perhaps this bug could be closed. |
With bindgen 0.55.1 I am able to cross-compile (host debian 10, target raspbian 10) for a raspberry pi zero w with:
It would be convenient if the sysroot directory could be specified alongside the linker in a |
Even if the crate were to read an extra parameter from There are a number of behavior changes between gcc versions and linkers. Since a lot of cross compiling involves 3rd party or vendor toolchains, I don't know that any single set of parameters would be portable. For the case I was working on when I wrote this, I also found that I needed more than just a |
This seems to be clang version dependent: for libOSCORE (where I track this as #61), this hasn't been an issue until I installed Debian's clang-18. In particular, things start misbehaving as soon as libclang-common-18-dev is installed, no matter whether clang itself is installed. (Beware that there might be missing emitted Cargo rebuild checks -- after installing/uninstalling libclang files, be sure to cargo clean). |
For my most recent occurrence of this, setting |
When building bindings for an embedded OS, updating the dependency from 0.30 to 0.31 causes an error when
Builder::generate
is called. To repro (this assumes you've got arm-none-eabi tools installed):The crate will build successfully.
Updating bindgen to 0.31 results in the following output:
(looking at the backtrace points to where I
expect
thegenerate
call)Relevant host information:
You can find the
__bindgen.i
file hereThe text was updated successfully, but these errors were encountered: