-
Notifications
You must be signed in to change notification settings - Fork 689
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
Generation of overflow operations on estimating constant type sizes #2931
Comments
The overflow is letting you know that the pointer sizes etc don't match. You need to pass the right target information to clang (and to bindgen). |
So, this brings me to my initial problem of using the libclang.dll provided by espressif/xtensa for the esp-32 platform. Clang seems not to be able to open the provided dll, why I had to change the LIBCLANG_PATH env variable. Is it possible on any way to use bindgen with clang and passing the necessary libclang fork? Otherwise I'd have to look for a similiar architecture/target compared to the esp-32 platform which is supported by the clang version and hoping for the best. Amendment: I assigned the riscv-unknown-gnu as target to clang and added the include path of stdio.h from the esp-platform and let it compile. Suprisingly it worked and gets adopted by the rust and c compiler with just printing not-ffi-safe, upper-case-globals and camel-case-naming warnings. Open: It would satisfy my inner peace, if clang and bindgen would use the libclang.dll provided by xtensa/espressif for the ESP-platform, thus the compilation result makes fully use of the platform and is fully supported. The current solution is just a workaround with lots of unclearence how well it is adopted by the target platform. It is still unclear to me, why the libclang.dll don't get adopted by bindgen and clang. Wish: Introduce support for the libclang.dll fork provided by espressif/xtensa. |
if you want to use a specific |
Hello,
in trying to implement some Rust in my ESP-32 C application, a was able to do it with cbindgen. Now I tryed it backward to use the C-libraries in Rust from my C-environment. It seems, that bindgen is not able to estimate the sizes of structs, or combined structs correctly and produces overflow operations.
Prelude: In doing so, I recognized that the Xtensa Clang version, respectively the libclang.dll version, is not supported by bindgen, so I switched to the standard one. So the result is not a native compiled solution but thought to give it a shot. I looked promising with my small example C-code. This could be one or the issue aspect.
Input gptimer.h
Output bindings.rs
Bindgen Invocation
Using the following bindgen command line
Actual Results
When compiling my Rust lib with using the C-FFI, following result appears.
Expected Results
The text was updated successfully, but these errors were encountered: