Re: [PATCH v2 1/2] crosvm: add recipe for ChromeOS Virtual Machine Monitor (VMM)
Bruce Ashfield <[email protected]> Tue, 23 Jun 2026 08:58:09 -0400
| Newsgroups | org.yoctoproject.lists.meta-virtualization |
|---|---|
| Message-ID | <CADkTA4NykhXNe9xahCc76OBc5B4D9TfLCHSw847Y9JHJnx2=QQ@mail.gmail.com> |
On Tue, Jun 23, 2026 at 6:23 AM Keerthivasan Raghavan < [email protected]> wrote: > > Hi Bruce, > > Thank you for the guidance and suggestions. > > I reviewed another recipe that uses bindgen for creating sys crates: > > https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.3.1.bb > > I would like to propose using: > > export BINDGEN_EXTRA_CLANG_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} > --target=${TARGET_SYS}" > > instead of: > > export BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${STAGING_DIR_HOST}" > > Rationale: > > - HOST_CC_ARCH: Specifies architecture-specific compiler flags passed to > the C compiler. > Reference: > https://docs.yoctoproject.org/ref-manual/variables.html#term-HOST_CC_ARCH > > - TOOLCHAIN_OPTIONS: Holds additional options passed to the compiler and > linker. For non-native recipes, these point to the custom sysroot via > RECIPE_SYSROOT. > Reference: > https://docs.yoctoproject.org/ref-manual/variables.html#term-TOOLCHAIN_OPTIONS > > - TARGET_SYS: Specifies the target system (architecture and operating > system) for which the build is being performed. > Reference: > https://docs.yoctoproject.org/ref-manual/variables.html#term-TARGET_SYS > > Given their intended purposes, using these variables makes the toolchain > and target configuration more explicit. This helps prevent accidental > "noise" or "crosstalk" with build host directories. > > With this approach, bindgen (via libclang/clang frontend) will resolve > system headers using the correct toolchain configuration, including all > relevant compiler and target options. This should ensure consistent and > correct header resolution, especially when extending the recipe class for > native builds. > > I value simplicity. Passing the sysroot, which is a valid option to bindgen is a single argument and fixes the build. No extended researching of variables and dumping the environment to know what you are passing. I'm curious as to how you hadn't hit this previously ? my build broke without something fixing it up. Bruce > Overall, this feels more robust than specifying only the sysroot location. > > Thank you, > Keerthivasan Raghavan > > > > -- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II