selftests: Use optional USERCFLAGS and USERLDFLAGS
authorMickaël Salaün <mic@digikod.net>
Fri, 9 Sep 2022 10:39:01 +0000 (12:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:58:51 +0000 (11:58 +0100)
commit0e945ea733eaf44007e7eedbfc85a06493c5b5ab
treeec12ea7dabcf26c58a5afb7e6029b547b215835b
parent31697c5953ff9fe5fa6a14e689a23e0b86baf84d
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>
tools/testing/selftests/lib.mk