From mboxrd@z Thu Jan 1 00:00:00 1970 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 35A066FA0 for ; Mon, 16 Jan 2023 16:54:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C5DEC433EF; Mon, 16 Jan 2023 16:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673888047; bh=DugYAi7ZdK/d8a4wPnfBqVgc1FiLSMxQIEUPeRi3lIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YnzgPpj7qO5vXTr+AwvJxD9lPZLv1VyqGx3TggJ+dF7KH3prUhN8ws5Ylm/CB2i9K Kwtk+0txugoHIxSJFPkbaTywC16lsLMJS63DvlWdcvBnYVHLC0bkLL/SZ3E/azcsCv Ry1F1Ca7gqpufKGjzTjH/RCBhKb3iZaVAIMHze7c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shuah Khan , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Subject: [PATCH 4.19 380/521] selftests: Use optional USERCFLAGS and USERLDFLAGS Date: Mon, 16 Jan 2023 16:50:42 +0100 Message-Id: <20230116154904.120529888@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154847.246743274@linuxfoundation.org> References: <20230116154847.246743274@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mickaël Salaün commit de3ee3f63400a23954e7c1ad1cb8c20f29ab6fe3 upstream. This change enables to extend CFLAGS and LDFLAGS from command line, e.g. to extend compiler checks: make USERCFLAGS=-Werror USERLDFLAGS=-static USERCFLAGS and USERLDFLAGS are documented in Documentation/kbuild/makefiles.rst and Documentation/kbuild/kbuild.rst This should be backported (down to 5.10) to improve previous kernel versions testing as well. Cc: Shuah Khan Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220909103901.1503436-1-mic@digikod.net Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/lib.mk | 5 +++++ 1 file changed, 5 insertions(+) --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -144,6 +144,11 @@ endef clean: $(CLEAN) +# Enables to extend CFLAGS and LDFLAGS from command line, e.g. +# make USERCFLAGS=-Werror USERLDFLAGS=-static +CFLAGS += $(USERCFLAGS) +LDFLAGS += $(USERLDFLAGS) + # When make O= with kselftest target from main level # the following aren't defined. #