llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] selftests/lib.mk: LLVM=1, CC=clang, and warnings
@ 2024-05-31 18:37 John Hubbard
  2024-05-31 18:37 ` [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds John Hubbard
  2024-05-31 18:37 ` [PATCH v2 2/2] selftests/lib.mk: silence some clang warnings that gcc already ignores John Hubbard
  0 siblings, 2 replies; 15+ messages in thread
From: John Hubbard @ 2024-05-31 18:37 UTC (permalink / raw)
  To: Shuah Khan, Muhammad Usama Anjum
  Cc: Beau Belgrave, Steven Rostedt, Mark Brown, Naresh Kamboju,
	Nick Desaulniers, Justin Stitt, Bill Wendling, sunliming,
	Masami Hiramatsu, Valentin Obst, linux-kselftest, LKML, llvm,
	John Hubbard

The kselftests may be built in a couple different ways:
    make LLVM=1
    make CC=clang

In order to handle both cases, set LLVM=1 if CC=clang. That way,the rest
of lib.mk, and any Makefiles that include lib.mk, can base decisions
solely on whether or not LLVM is set.

Then, build upon that to disable a pair of clang warnings that are
already silenced on gcc.

Doing it this way is much better than the piecemeal approach that I
started with in [1] and [2]. Thanks to Nathan Chancellor for the patch
reviews that led to this approach.

Changes since the first version:

1) Wrote a detailed explanation for suppressing two clang warnings, in
both a lib.mk comment, and the commit description.

2) Added a Reviewed-by tag to the first patch.

[1] https://lore.kernel.org/20240527214704.300444-1-jhubbard@nvidia.com
[2] https://lore.kernel.org/20240527213641.299458-1-jhubbard@nvidia.com

John Hubbard (2):
  selftests/lib.mk: handle both LLVM=1 and CC=clang builds
  selftests/lib.mk: silence some clang warnings that gcc already ignores

 tools/testing/selftests/lib.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)


base-commit: e0cce98fe279b64f4a7d81b7f5c3a23d80b92fbc
-- 
2.45.1


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

end of thread, other threads:[~2024-06-07 20:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 18:37 [PATCH v2 0/2] selftests/lib.mk: LLVM=1, CC=clang, and warnings John Hubbard
2024-05-31 18:37 ` [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds John Hubbard
2024-06-03 15:32   ` Mark Brown
2024-06-03 17:09     ` John Hubbard
2024-06-03 20:11       ` John Hubbard
2024-06-03 22:47     ` Nathan Chancellor
2024-06-04  4:55       ` John Hubbard
2024-06-07 11:12         ` Ryan Roberts
2024-06-07 17:15           ` Nathan Chancellor
2024-06-07 20:13             ` John Hubbard
2024-06-04 13:14       ` Mark Brown
2024-05-31 18:37 ` [PATCH v2 2/2] selftests/lib.mk: silence some clang warnings that gcc already ignores John Hubbard
2024-06-03 21:06   ` John Hubbard
2024-06-03 22:36   ` Nathan Chancellor
2024-06-07 17:23     ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).