Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: "Mickaël Salaün" <mic@digikod.net>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	"Guillaume Tucker" <guillaume.tucker@collabora.com>,
	"Mark Brown" <broonie@kernel.org>,
	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	[thread overview]
Message-ID: <20220909103901.1503436-1-mic@digikod.net> (raw)

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 <skhan@linuxfoundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Link: https://lore.kernel.org/r/20220909103901.1503436-1-mic@digikod.net
---
 tools/testing/selftests/lib.mk | 5 +++++
 1 file changed, 5 insertions(+)

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.
 #

base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179
-- 
2.37.2


             reply	other threads:[~2022-09-09 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 10:39 Mickaël Salaün [this message]
2022-10-20 14:17 ` [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS Mickaël Salaün
2022-10-20 14:48   ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220909103901.1503436-1-mic@digikod.net \
    --to=mic@digikod.net \
    --cc=anders.roxell@linaro.org \
    --cc=broonie@kernel.org \
    --cc=guillaume.tucker@collabora.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox