Re: [PATCH v9 20/27] scripts: add `rust_is_available.sh`

From: Nick Desaulniers
Date: Mon Aug 22 2022 - 16:09:24 EST


On Fri, Aug 5, 2022 at 8:46 AM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>
> This script tests whether the Rust toolchain requirements are in place
> to enable Rust support.

With this, I get:

$ make LLVM=1 rustavailable
***
*** libclang (used by the Rust bindings generator 'bindgen')
*** version does not match Clang's. This may be a problem.
*** libclang version: 15.0.0
*** Clang version: 16.0.0
***
Rust is available!

because I'm using clang built from source from ToT. Is this supposed
to mean that I can't use clang-16, clang-14, clang-13, clang-12, or
clang-11 (in the kernel we support clang-11+) in order to use rust?
I'm guessing that's going to hinder adoption. Is there a way to
specify which libclang version bindgen should be using?

I have libclang built in my clang sources,
llvm-project/llvm/build/lib/libclang.so. I also tried:

$ CLANG_PATH=/android0/llvm-project/llvm/build/lib/libclang.so.15 make
LLVM=1 -j72 rustavailable
$ CLANG_PATH=/android0/llvm-project/llvm/build/lib/libclang.so make
LLVM=1 -j72 rustavailable

--
Thanks,
~Nick Desaulniers