Skip to content

Commit

Permalink
lib: update instructions for invoking bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Oct 12, 2023
1 parent 1d4f03c commit 7026887
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ clap = "3.2"
env_logger = "0.10"
utils = { path = "../utils" }

# For convenience we are building the bindings manually and integrating them with
# the crate. They are generated as follows:
# bindgen /usr/include/linux/videodev2.h --output src/bindings/videodev2_64.rs
# bindgen /usr/include/linux/videodev2.h --output src/bindings/videodev2_32.rs -- --target=i686-unknown-linux-gnu
# For convenience we are building the bindings manually and integrating them
# with the crate. In order to generate them, run the following inside the
# src/bindings/runbindgen directory:
#
# In case we want to use locally installed headers (make headers_install in kernel source directory) we need to pass clang args:
# bindgen usr/include/linux/videodev2.h --output videodev2_64.rs -- -Iusr/include
# otherwise clang will mix up system-wide headers with locally installed ones resulting in inconsistent output.
#
# For 32-bit headers you might need to install libc6-dev-i386-cross or a similar package, and then
# bindgen usr/include/linux/videodev2.h --output videodev2_32.rs -- --sysroot=/usr/i686-linux-gnu/ --target=i686-linux-gnu -Iusr/include
# cargo run -- -o ../videodev2_64.rs -I /path/to/kerneldir/usr/include/
# cargo run -- -o ../videodev2_32.rs -I /path/to/kerneldir/usr/include/ -s /usr/i686-linux-gnu/ -t i686-linux-gnu

0 comments on commit 7026887

Please sign in to comment.