Skip to content

Commit e54b4ba

Browse files
ojedafbq
authored andcommitted
docs: rust: add paragraph about finding a suitable libclang
Sometimes users need to tweak the finding process of `libclang` for `bindgen` via the `clang-sys`-provided environment variables. Thus add a paragraph to the setting up guide, including a reference to `clang-sys`'s relevant documentation. Link: https://lore.kernel.org/rust-for-linux/CAKwvOdm5JT4wbdQQYuW+RT07rCi6whGBM2iUAyg8A1CmLXG6Nw@mail.gmail.com/ Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ef9b95b commit e54b4ba

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Documentation/rust/quick-start.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,23 @@ Install it via (note that this will download and build the tool from source)::
100100

101101
cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen
102102

103+
``bindgen`` needs to find a suitable ``libclang`` in order to work. If it is
104+
not found (or a different ``libclang`` than the one found should be used),
105+
the process can be tweaked using the environment variables understood by
106+
``clang-sys`` (the Rust bindings crate that ``bindgen`` uses to access
107+
``libclang``):
108+
109+
* ``LLVM_CONFIG_PATH`` can be pointed to an ``llvm-config`` executable.
110+
111+
* Or ``LIBCLANG_PATH`` can be pointed to a ``libclang`` shared library
112+
or to the directory containing it.
113+
114+
* Or ``CLANG_PATH`` can be pointed to a ``clang`` executable.
115+
116+
For details, please see ``clang-sys``'s documentation at:
117+
118+
https://github.com/KyleMayes/clang-sys#environment-variables
119+
103120

104121
Requirements: Developing
105122
------------------------

0 commit comments

Comments
 (0)