From nobody Sun Feb 8 11:43:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6127B2F12D2; Fri, 17 Oct 2025 15:33:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760715186; cv=none; b=rWXyp90GoCvhATymUkJ5epyIL178sOk3prvPg/23kJtsbjidW5YNR1Pp3+ReiJoO0AI+xtQTUrNxf5CcWhJej5bEmUE+luUA0OVsg13akXvlzpF3g9U6C1pBtLfDVc7JGhd/O6s4+kMesGigrZWoXy6BNnPacw2JvULiwOh4znQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760715186; c=relaxed/simple; bh=LiKIWFDNYNNAES7eZnL2gzfDuBzjxqEOphFOwMWdHrE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XtLfKRC6OD4HGP+7bxygdvauXLkHZJUsh0fBtUh38lgqu171T/BFKQ6yKjB/qUFAafxshIUgxZsZywbBZRcoe3BdrHY2N3uor+We/X1tGgnnW3Qk+hbuY3l/esCyJ6mm2vVMng01NwX2mT3Qa/agOUX7D5qCz08hFUPK5237UEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nc1VWl3u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nc1VWl3u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52B5BC4CEE7; Fri, 17 Oct 2025 15:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760715184; bh=LiKIWFDNYNNAES7eZnL2gzfDuBzjxqEOphFOwMWdHrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nc1VWl3uSn0+5q4pOFcb70EJbz+FWE9fpH94zJEWKW8u9mUZ3/GaF1Oacm7pDR5XY FghuHkKA3YjOqExtEZBU7oxL6NNx/sHh5SwODlifkdoaMIm9PYyh61EgyXQyhansHe rxJAa2J3AZy2GJg4bY3J9fhaqVLNC6DBgJ7YNzz8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Leo Yan , Ian Rogers , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nick Desaulniers , Justin Stitt , Bill Wendling , Adrian Hunter , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Nathan Chancellor , James Clark , linux-riscv@lists.infradead.org, llvm@lists.linux.dev, Paul Walmsley , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 6.17 095/371] perf python: split Clang options when invoking Popen Date: Fri, 17 Oct 2025 16:51:10 +0200 Message-ID: <20251017145205.376305398@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017145201.780251198@linuxfoundation.org> References: <20251017145201.780251198@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 6.17-stable review patch. If anyone has any objections, please let me know. Reviewed-by: Ian Rogers ------------------ From: Leo Yan [ Upstream commit c6a43bc3e8f6102a47da0d2e53428d08f00172fb ] When passing a list to subprocess.Popen, each element maps to one argv token. Current code bundles multiple Clang flags into a single element, something like: cmd =3D ['clang', '--target=3Dx86_64-linux-gnu -fintegrated-as -Wno-cast-function-ty= pe-mismatch', 'test-hello.c'] So Clang only sees one long, invalid option instead of separate flags, as a result, the script cannot capture any log via PIPE. Fix this by using shlex.split() to separate the string so each option becomes its own argv element. The fixed list will be: cmd =3D ['clang', '--target=3Dx86_64-linux-gnu', '-fintegrated-as', '-Wno-cast-function-type-mismatch', 'test-hello.c'] Fixes: 09e6f9f98370 ("perf python: Fix splitting CC into compiler and optio= ns") Signed-off-by: Leo Yan Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20251006-perf_build_android_ndk-v3-2-430559= 0795b2@arm.com Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: Nick Desaulniers Cc: Justin Stitt Cc: Bill Wendling Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: Nathan Chancellor Cc: James Clark Cc: linux-riscv@lists.infradead.org Cc: llvm@lists.linux.dev Cc: Paul Walmsley Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index dd289d15acfd6..9cae2c472f4ad 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -1,6 +1,7 @@ from os import getenv, path from subprocess import Popen, PIPE from re import sub +import shlex =20 cc =3D getenv("CC") assert cc, "Environment variable CC not set" @@ -22,7 +23,9 @@ assert srctree, "Environment variable srctree, for the Li= nux sources, not set" src_feature_tests =3D f'{srctree}/tools/build/feature' =20 def clang_has_option(option): - cc_output =3D Popen([cc, cc_options + option, path.join(src_feature_te= sts, "test-hello.c") ], stderr=3DPIPE).stderr.readlines() + cmd =3D shlex.split(f"{cc} {cc_options} {option}") + cmd.append(path.join(src_feature_tests, "test-hello.c")) + cc_output =3D Popen(cmd, stderr=3DPIPE).stderr.readlines() return [o for o in cc_output if ((b"unknown argument" in o) or (b"is n= ot supported" in o) or (b"unknown warning option" in o))] =3D=3D [ ] =20 if cc_is_clang: --=20 2.51.0