Skip to content
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

How can we get bindgen output with wrap_static_fns() ? #201

Open
gopakumarce opened this issue May 18, 2023 · 3 comments
Open

How can we get bindgen output with wrap_static_fns() ? #201

gopakumarce opened this issue May 18, 2023 · 3 comments

Comments

@gopakumarce
Copy link

So for example I want to include esp32/incude/hal/i2s_ll.h and all the static inlines inside it, but by default all the static inlines are not generated in the bindings. How can I include wrap_static_fns() so that I get the inline utility APIs inside i2s_ll.h ? From my project's build.rs can I pass in something to the embuild flags or anything of that sort to achieve this ?

@ivmarkov
Copy link
Collaborator

wrap_static_fns is a brand new, experimental feature of bindgen and as such it is not supported out of the box in esp-idf-sys. Moreover, it is not just about "passing the flag to bindgen", as in that case bindgen would generate a C file too, that you need to compile with clang (or gcc would do as well?) and then you need to use cargo build cmds to pass down the compiled output to the linker.

Not a rocket science, but would require some changes to esp-idf-sys - in the native as well as in the pio code paths, (as long as it can even be supported in the latter).

Might also require a small change to embuild so that it's bindgen dependency is updated to a version which supports bindgen 0.65, if that's not the case already.

All in all it would require a PR. Are you willing to work on that?

@gopakumarce
Copy link
Author

@ivmarkov yes ill take a stab at it

@gopakumarce
Copy link
Author

PR here #202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants