Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS
@ 2022-09-09 10:39 Mickaël Salaün
  2022-10-20 14:17 ` Mickaël Salaün
  0 siblings, 1 reply; 3+ messages in thread
From: Mickaël Salaün @ 2022-09-09 10:39 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Mickaël Salaün, Anders Roxell, Guillaume Tucker,
	Mark Brown, linux-kselftest, linux-security-module, stable

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS
  2022-09-09 10:39 [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS Mickaël Salaün
@ 2022-10-20 14:17 ` Mickaël Salaün
  2022-10-20 14:48   ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Mickaël Salaün @ 2022-10-20 14:17 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Anders Roxell, Guillaume Tucker, Mark Brown, linux-kselftest,
	linux-security-module, stable

Hi Shuah, what do you think about this patch?

On 09/09/2022 12:39, Mickaël Salaün wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS
  2022-10-20 14:17 ` Mickaël Salaün
@ 2022-10-20 14:48   ` Shuah Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2022-10-20 14:48 UTC (permalink / raw)
  To: Mickaël Salaün
  Cc: Anders Roxell, Guillaume Tucker, Mark Brown, linux-kselftest,
	linux-security-module, stable, Shuah Khan

On 10/20/22 08:17, Mickaël Salaün wrote:
> Hi Shuah, what do you think about this patch?
> 

Thanks for the ping.

> On 09/09/2022 12:39, Mickaël Salaün wrote:
>> 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

Sorry for the delay. Looks good to me. I will apply to next to get
some soak time and get this into 6.2.

thanks,
-- Shuah



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-20 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09 10:39 [PATCH v1] selftests: Use optional USERCFLAGS and USERLDFLAGS Mickaël Salaün
2022-10-20 14:17 ` Mickaël Salaün
2022-10-20 14:48   ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox