diff options
author | Mickaël Salaün <mic@digikod.net> | 2022-09-09 12:39:01 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 11:30:42 +0100 |
commit | 9347c83cf6c0d73989535b5d9e3ba037c9daa816 (patch) | |
tree | 7cdd9cf5bf652ba2536bfd419437e3c142f9d660 /tools/testing/selftests | |
parent | 3ab8a64d002c752672f5bb44029e9991e8a11d47 (diff) | |
download | linux-stable-9347c83cf6c0d73989535b5d9e3ba037c9daa816.tar.gz linux-stable-9347c83cf6c0d73989535b5d9e3ba037c9daa816.tar.bz2 linux-stable-9347c83cf6c0d73989535b5d9e3ba037c9daa816.zip |
selftests: Use optional USERCFLAGS and USERLDFLAGS
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 <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
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r-- | tools/testing/selftests/lib.mk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 9700281bee4c..e7c205c8df56 100644 --- 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. # |