Lines Matching +full:debian +full:- +full:clang
2 # SPDX-License-Identifier: GPL-2.0
6 set -e
8 min_tool_version=$(dirname $0)/min-tool-version.sh
10 # Convert the version string x.y.z to a canonical up-to-7-digits form.
18 set -- $1
26 echo >&2 "*** Please see Documentation/rust/quick-start.rst for details"
44 trap 'if [ $? -ne 0 ] || [ $warning -ne 0 ]; then print_docs_reference; fi' EXIT
47 if [ -z "${RUSTC+x}" ]; then
53 if [ -z "${BINDGEN+x}" ]; then
59 if [ -z "${CC+x}" ]; then
66 if ! command -v "$RUSTC" >/dev/null; then
74 if ! command -v "$BINDGEN" >/dev/null; then
83 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
85 LC_ALL=C "$RUSTC" --version 2>/dev/null
87 if [ -n "$rust_compiler_code" ]; then
98 | sed -nE '1s:.*rustc ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
100 if [ -z "$rust_compiler_version" ]; then
112 if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
123 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
125 # The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
126 # (https://github.com/rust-lang/rust-bindgen/pull/2678) and 0.71.0
127 # (https://github.com/rust-lang/rust-bindgen/pull/3040). It can be removed when
131 LC_ALL=C "$BINDGEN" --version workaround-for-0.69.0 2>/dev/null
133 if [ -n "$rust_bindings_generator_code" ]; then
144 | sed -nE '1s:.*bindgen ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
146 if [ -z "$rust_bindings_generator_version" ]; then
158 if [ "$rust_bindings_generator_cversion" -lt "$rust_bindings_generator_min_cversion" ]; then
166 if [ "$rust_bindings_generator_cversion" -eq 6600 ] ||
167 [ "$rust_bindings_generator_cversion" -eq 6601 ]; then
168 # Distributions may have patched the issue (e.g. Debian did).
172 echo >&2 "*** work due to a bug (https://github.com/rust-lang/rust-bindgen/pull/2567),"
173 echo >&2 "*** unless patched (like Debian's)."
188 if [ -n "$bindgen_libclang_code" ]; then
206 | sed -nE 's:.*clang version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
208 if [ -z "$bindgen_libclang_version" ]; then
221 if [ "$bindgen_libclang_cversion" -lt "$bindgen_libclang_min_cversion" ]; then
230 if [ "$bindgen_libclang_cversion" -ge 1900100 ] &&
231 [ "$rust_bindings_generator_cversion" -lt 6905 ]; then
232 # Distributions may have patched the issue (e.g. Debian did).
233 if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang_concat.h | grep -q foofoo; then
236 echo >&2 "*** may not work due to a bug (https://github.com/rust-lang/rust-bindgen/pull/2824),"
237 echo >&2 "*** unless patched (like Debian's)."
245 # If the C compiler is Clang, then we can also check whether its version
249 # https://github.com/rust-lang/rust-bindgen/issues/2138.
250 cc_name=$($(dirname $0)/cc-version.sh $CC | cut -f1 -d' ')
251 if [ "$cc_name" = Clang ]; then
253 LC_ALL=C $CC --version 2>/dev/null \
254 | sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
259 echo >&2 "*** version does not match Clang's. This may be a problem."
261 echo >&2 "*** Clang version: $clang_version"
269 # `$KRUSTFLAGS` is passed in case the user added `--sysroot`.
270 rustc_sysroot=$("$RUSTC" $KRUSTFLAGS --print sysroot)
271 rustc_src=${RUST_LIB_SRC:-"$rustc_sysroot/lib/rustlib/src/rust/library"}
273 if [ ! -e "$rustc_src_core" ]; then