Skip to content

[COMPILER REQUEST]: bindgen for C/C++ #4554

@ojeda

Description

@ojeda

Compiler name

bindgen

Compiler version

The latest patch versions from 0.57 to 0.63 (7 releases, i.e. the last 2 years). Ideally, the latest patch versions for all the minors in CE (i.e. since rustc 1.0.0).

Compiler language

C and C++

Compiler homepage

https://github.com/rust-lang/rust-bindgen

Motivation

bindgen is a project under rust-lang that takes C (or C++) code as input and generates FFI bindings for Rust (i.e. Rust code as output). It could be considered part of the Rust toolchain for projects mixing C and Rust that use it.

It would be useful to have it in CE since it would allow to easily test the tool for different inputs, different versions, to diff its outputs (since they can be fairly long and involved), share links, report bugs to bindgen, etc.

CE would also make it easy to then pipe the output into a Rust compiler, which is useful, for instance, when it outputs invalid Rust code.

As a concrete example, in the kernel we are not using bindgen's latest version at the moment, and sometimes we hit C constructs that are not mapped properly yet. If CE supported bindgen, then we could use it to quickly reduce the case, then check if newer versions trigger it, and report it if needed.

Note: bindgen uses libclang internally -- some thought may be needed on which LLVM versions to give it. Perhaps the latest possible, or the latest available one at the point of each of its releases.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions