Skip to content

Unfork bindgen #124

Open
Open
@adetaylor

Description

@adetaylor
Collaborator

bindgen doesn't pass on quite all the information we need in order to be able to generate autocxx bindings. Options in the future might be to fork bindgen, ask very nicely if they mind us upstreaming patches to add metadata, or switch away from bindgen and use llvm directly.

In any case this bug will be a live tracker of all known cases where we don't have all the information that we require about the underlying C++.

Activity

martinboehme

martinboehme commented on Apr 16, 2021

@martinboehme
Collaborator
  • Classes vs structs. Both present as structs in the bindgen output. When we then generate extra C++ we have to plump for one or the other. In some ABIs this will result in a binary incompatibility or failure to compile.

Not sure I understand -- I always thought a struct was exactly identical to a class, just that it has public visibility by default? And I believe it's legal for forward declarations of a struct to use class and vice versa (see this StackOverflow answer). I'm pretty sure there isn't an ABI difference either. Or am I misunderstanding what you're referring to here?

adetaylor

adetaylor commented on Apr 16, 2021

@adetaylor
CollaboratorAuthor

This is #54 - let's discuss over there.

martinboehme

martinboehme commented on Apr 16, 2021

@martinboehme
Collaborator

Thanks for the clarification -- interesting!

adetaylor

adetaylor commented on Apr 25, 2021

@adetaylor
CollaboratorAuthor

For #414 and #102 many types have 'annotations' attached (the RustTy type in our fork of bindgen). Such annotations are currently discarded using an ignore_annotations method. Each time that happens, it's probably a bug. For example this means we would try (and fail) to generate POD struct fields using types with template parameters which bindgen has dropped. Once a plan presents itself here, we should ensure we never drop information like this.

martinboehme

martinboehme commented on Apr 29, 2021

@martinboehme
Collaborator

Note from #426: The Rust function signature for copy constructors and move constructors is the same, so bindgen needs to add an annotation that allows us to distinguish between them.

bsilver8192

bsilver8192 commented on Feb 17, 2022

@bsilver8192
Contributor

#799 is also on this list, and I'm pretty sure #815 is too.

76 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @adetaylor@bsilver8192@martinboehme

        Issue actions

          Unfork bindgen · Issue #124 · google/autocxx