Patch "kbuild: rust_is_available: fix version check when CC has multiple arguments" has been added to the 6.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    kbuild: rust_is_available: fix version check when CC has multiple arguments

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kbuild-rust_is_available-fix-version-check-when-cc-h.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c170dd2fae5001555d54eebb180617969d9c874f
Author: Russell Currey <ruscur@xxxxxxxxxx>
Date:   Fri Jun 16 02:16:22 2023 +0200

    kbuild: rust_is_available: fix version check when CC has multiple arguments
    
    [ Upstream commit dee3a6b819c96fc8b1907577f585fd66f5c0fefe ]
    
    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 <ruscur@xxxxxxxxxx>
    Fixes: 78521f3399ab ("scripts: add `rust_is_available.sh`")
    Link: https://github.com/Rust-for-Linux/linux/pull/873
    [ Reworded title prefix and reflow line to 75 columns. ]
    Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>
    Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230616001631.463536-3-ojeda@xxxxxxxxxx
    Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh
index f43a010eaf305..0c9be438e4cd3 100755
--- a/scripts/rust_is_available.sh
+++ b/scripts/rust_is_available.sh
@@ -113,10 +113,10 @@ fi
 #
 # In the future, we might be able to perform a full version check, see
 # https://github.com/rust-lang/rust-bindgen/issues/2138.
-cc_name=$($(dirname $0)/cc-version.sh "$CC" | cut -f1 -d' ')
+cc_name=$($(dirname $0)/cc-version.sh $CC | cut -f1 -d' ')
 if [ "$cc_name" = Clang ]; then
 	clang_version=$( \
-		LC_ALL=C "$CC" --version 2>/dev/null \
+		LC_ALL=C $CC --version 2>/dev/null \
 			| sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
 	)
 	if [ "$clang_version" != "$bindgen_libclang_version" ]; then



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux