From nobody Mon Feb 9 17:23:06 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F2B139BA2E; Thu, 22 Jan 2026 17:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769101367; cv=none; b=Ym6frDX6zUHEY7POh1ZCvd6as4LiUnmeqmMQPvEf2RoJD10t4tifXfVNXh7XvxoVhZuJ06vpjLdQX+arPsAmup0lM7UpYU2Qk0qD4Dyi/u+9DdrTL60I0q770VPvYtoceWT1l5F+sCrE73EvmRU4r+7o1vtu1I56HiCKdB9nYr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769101367; c=relaxed/simple; bh=nbWww7zFwokXENYKIQfUH/f8WSUwimnfG8LGROYYa0o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uNXdmsD3s4HLHNUUHHKY7URZhEOBlHuNyJTFlN/M089zpzec6lkyZYQ9JEiePMC+hOAKTII55w0nMIVFNIz5wm0a9KVYTh03fhvEVi7AY5jedASGCa/JBlTQYEsP9Wh7yqF1ohVxcRNWK1Q5DAtu04IusX6DwcB2V7/3oEHVFPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1DD3E1596; Thu, 22 Jan 2026 09:02:33 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 245C33F632; Thu, 22 Jan 2026 09:02:38 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org, linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , Andrew Morton , David Hildenbrand , Dev Jain , Lorenzo Stoakes , Mark Brown , Ryan Roberts , Shuah Khan , Jason Gunthorpe , John Hubbard Subject: [PATCH v3 3/9] selftests/mm: pass down full CC and CFLAGS to check_config.sh Date: Thu, 22 Jan 2026 17:02:18 +0000 Message-ID: <20260122170224.4056513-4-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260122170224.4056513-1-kevin.brodsky@arm.com> References: <20260122170224.4056513-1-kevin.brodsky@arm.com> 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" check_config.sh checks that liburing is available by running the compiler provided as its first argument. This makes two assumptions: 1. CC consists of only one word 2. No extra flag is required Unfortunately, there are many situations where these assumptions don't hold. For instance: - When using Clang, CC consists of multiple words - When cross-compiling, extra flags may be required to allow the compiler to find headers Remove these assumptions by passing down CC and CFLAGS as-is from the Makefile, so that the same command line is used as when actually building the tests. Cc: Jason Gunthorpe Cc: John Hubbard Acked-by: David Hildenbrand (Red Hat) Reviewed-by: Mark Brown Signed-off-by: Kevin Brodsky --- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/check_config.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/= mm/Makefile index 4e5c8a330a0c..de4afc34e3b1 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -230,7 +230,7 @@ $(OUTPUT)/migration: LDLIBS +=3D -lnuma $(OUTPUT)/rmap: LDLIBS +=3D -lnuma =20 local_config.mk local_config.h: check_config.sh - /bin/sh ./check_config.sh $(CC) + CC=3D"$(CC)" CFLAGS=3D"$(CFLAGS)" ./check_config.sh =20 EXTRA_CLEAN +=3D local_config.mk local_config.h =20 diff --git a/tools/testing/selftests/mm/check_config.sh b/tools/testing/sel= ftests/mm/check_config.sh index 3954f4746161..b84c82bbf875 100755 --- a/tools/testing/selftests/mm/check_config.sh +++ b/tools/testing/selftests/mm/check_config.sh @@ -16,8 +16,7 @@ echo "#include " > $tmpfile_c echo "#include " >> $tmpfile_c echo "int func(void) { return 0; }" >> $tmpfile_c =20 -CC=3D${1:?"Usage: $0 # example compiler: gcc"} -$CC -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1 +$CC $CFLAGS -c $tmpfile_c -o $tmpfile_o =20 if [ -f $tmpfile_o ]; then echo "#define LOCAL_CONFIG_HAVE_LIBURING 1" > $OUTPUT_H_FILE --=20 2.51.2