From: Scott Murray Date: Wed, 16 Oct 2024 18:44:50 +0000 (-0400) Subject: agl-persistent-storage-api: set BINDGEN_EXTRA_CLANG_ARGS X-Git-Tag: 18.0.2~1 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F60%2F30460%2F2;p=AGL%2Fmeta-agl-demo.git agl-persistent-storage-api: set BINDGEN_EXTRA_CLANG_ARGS The agl-persistent-storage-api build was failing on hosts where the native headers happened to not work with the clang invocation being done during binding generation for the rocksdb wrapper crate. To avoid this, set BINDGEN_EXTRA_CLANG_ARGS to pass in the required cross-compile environment arguments. Bug-AGL: SPEC-5264 Change-Id: I54af5846045285b4ccd7af5cc0087193eae79be0 Signed-off-by: Scott Murray Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/30416 Tested-by: Jenkins Job builder account Reviewed-by: Naoto YAMAGUCHI Reviewed-by: Jan-Simon Moeller ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account (cherry picked from commit df7db40b80da5300dbced99aef171d1e0dada5af) Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/30460 --- diff --git a/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb b/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb index 63a315fd6..0058f26fe 100644 --- a/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb +++ b/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb @@ -31,6 +31,10 @@ USERADD_PARAM:${PN} = "--system -g 903 -u 903 -o -d / --shell /bin/nologin persi do_compile:prepend() { export ROCKSDB_CXX_STD="--std=c99" export ROCKSDB_INCLUDE_DIR="${RECIPE_SYSROOT}/usr/include" + + # Need to set options for the rust-librocksdb-sys crate's bindgen invocation of clang, + # or there's a good chance it will choke when trying to use the host system's headers. + export BINDGEN_EXTRA_CLANG_ARGS="${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" } do_install:append () {