From patchwork Fri Sep 9 10:39:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= X-Patchwork-Id: 604455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BB77ECAAD3 for ; Fri, 9 Sep 2022 10:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbiIIKjG (ORCPT ); Fri, 9 Sep 2022 06:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbiIIKjF (ORCPT ); Fri, 9 Sep 2022 06:39:05 -0400 Received: from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch [IPv6:2001:1600:3:17::190b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE0F134C10 for ; Fri, 9 Sep 2022 03:39:04 -0700 (PDT) Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4MPCCW0221zMqPkF; Fri, 9 Sep 2022 12:39:03 +0200 (CEST) Received: from localhost (unknown [23.97.221.149]) by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4MPCCV5brKzMpnPq; Fri, 9 Sep 2022 12:39:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1662719942; bh=mUrd1lhQRsT39GMuGMdM54M7Mdt2k87ApjcidD8sFRU=; h=From:To:Cc:Subject:Date:From; b=vDpXl5FXOhCUQO7zEhdG8UTfzKKWbyFQdS0cawFUn6q+SWPjwTwrqUz9hx6/mgucD nXr+lRW1kgMWROfpW2NUZuCCCgfTJBZ3EY9ZHqWbADbOCGheTpqVMowmazetLIsmdT O0DaqQHba3PgDl0RzR0XfUwlpGUgdLP8s4zBM6Ys= From: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= To: Shuah Khan Cc: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , Anders Roxell , Guillaume Tucker , Mark Brown , linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS Date: Fri, 9 Sep 2022 12:39:01 +0200 Message-Id: <20220909103901.1503436-1-mic@digikod.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 --- tools/testing/selftests/lib.mk | 5 +++++ 1 file changed, 5 insertions(+) base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179 diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index d44c72b3abe3..da47a0257165 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -119,6 +119,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. #