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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 22, 2022 at 10:09 PM Nick Desaulniers
<ndesaulniers@xxxxxxxxxx> wrote:
>
> 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

No, it is only a warning, so you can proceed if you want to risk it.

However, is there a reason you would like to mix the versions?

If not, please point `bindgen` to your newer libclang (see below).

> specify which libclang version bindgen should be using?

Yes, see below.

> 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` is for pointing to a `clang` executable, not `libclang`.

Instead, please try `LIBCLANG_PATH` (note the `LIB` there).

For instance, using the test header to print the libclang version,
this works for me:

    $ bindgen scripts/rust_is_available_bindgen_libclang.h
    ... clang version 14.0.6 (https://github.com/llvm/llvm-project.git ...

    $ LIBCLANG_PATH=.../libclang-6.0.so.1 \
      bindgen scripts/rust_is_available_bindgen_libclang.h
    ... clang version 6.0.0 (tags/RELEASE_600/final) ...

If the above does not work, for details on how the dependency is
resolved, please see:

    https://github.com/KyleMayes/clang-sys#linking
    https://github.com/KyleMayes/clang-sys#dependencies
    https://github.com/KyleMayes/clang-sys#environment-variables
    https://github.com/rust-lang/rust-bindgen#environment-variables

I will add a note about this to the docs.

Cheers,
Miguel



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux