Skip to content

Commit f2ecfe4

Browse files
committed
scripts: rust: Fix version check when CC has multiple arguments
rust_is_available.sh uses cc-version.sh to identify which C compiler is in use, as scripts/Kconfig.include does. cc-version.sh isn't designed to be able to handle multiple arguments in one variable, i.e. "ccache clang". Its invocation in rust_is_available.sh quotes "$CC", which makes $1 == "ccache clang" instead of the intended $1 == ccache & $2 == clang. cc-version.sh could also be changed to handle having "ccache clang" as one argument, but it only has the one consumer upstream, making it simpler to fix the caller here. Signed-off-by: Russell Currey <[email protected]>
1 parent 459035a commit f2ecfe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/rust_is_available.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fi
126126
# In the future, we might be able to perform a full version check, see
127127
# https://github.com/rust-lang/rust-bindgen/issues/2138.
128128
if [ "$1" = -v ]; then
129-
cc_name=$($(dirname $0)/cc-version.sh "$CC" | cut -f1 -d' ')
129+
cc_name=$($(dirname $0)/cc-version.sh $CC | cut -f1 -d' ')
130130
if [ "$cc_name" = Clang ]; then
131131
clang_version=$( \
132132
LC_ALL=C "$CC" --version 2>/dev/null \

0 commit comments

Comments
 (0)