All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] kbuild: clang-tidy
@ 2020-08-12 17:39 Masahiro Yamada
  2020-08-12 17:39 ` [PATCH 1/3] gen_compile_commands: parse only the first line of .*.cmd files Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Masahiro Yamada @ 2020-08-12 17:39 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Nathan Huckleberry, Nick Desaulniers, Tom Roeder,
	clang-built-linux, Masahiro Yamada, David S. Miller,
	Mauro Carvalho Chehab, Michal Marek, Rob Herring, linux-kernel


I improved gen_compile_commands.py in the first two patches,
then rebased Nathan's v7 [1] on top of them.
To save time, I modified the Makefile part.
No change for run-clang-tools.py

I am not sure if the new directory, scripts/clang-tools/,
is worth creating only for 2 files, but I do not have
a strong opinion about it.

"make clang-tidy" should work in-tree build,
out-of-tree build (O=), and external module build (M=).
Tests and reviews are appreciated.

"make clang-tidy" worked for me.

masahiro@oscar:~/workspace/linux-kbuild$ make -j24 CC=clang clang-tidy
  DESCEND  objtool
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GEN     compile_commands.json
  CHECK   compile_commands.json

But "make clang-analyzer" just sprinkled the following error:

  Error: no checks enabled.
  USAGE: clang-tidy [options] <source0> [... <sourceN>]

I built clang-tidy from the latest source.
I had no idea how to make it work...

[1] https://patchwork.kernel.org/patch/11687833/



Masahiro Yamada (2):
  gen_compile_commands: parse only the first line of .*.cmd files
  gen_compile_commands: wire up build rule to Makefile

Nathan Huckleberry (1):
  Makefile: Add clang-tidy and static analyzer support to makefile

 MAINTAINERS                                 |   1 +
 Makefile                                    |  45 +++++-
 scripts/clang-tools/gen_compile_commands.py | 117 +++++++++++++++
 scripts/clang-tools/run-clang-tools.py      |  74 ++++++++++
 scripts/gen_compile_commands.py             | 151 --------------------
 5 files changed, 233 insertions(+), 155 deletions(-)
 create mode 100755 scripts/clang-tools/gen_compile_commands.py
 create mode 100755 scripts/clang-tools/run-clang-tools.py
 delete mode 100755 scripts/gen_compile_commands.py

-- 
2.25.1


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

end of thread, other threads:[~2020-08-20  2:30 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 17:39 [PATCH 0/3] kbuild: clang-tidy Masahiro Yamada
2020-08-12 17:39 ` [PATCH 1/3] gen_compile_commands: parse only the first line of .*.cmd files Masahiro Yamada
2020-08-12 21:52   ` Nick Desaulniers
2020-08-12 17:39 ` [PATCH 2/3] gen_compile_commands: wire up build rule to Makefile Masahiro Yamada
2020-08-12 22:30   ` Nick Desaulniers
2020-08-13 17:10     ` Masahiro Yamada
2020-08-19  4:29       ` Masahiro Yamada
2020-08-20  2:29         ` Nick Desaulniers
2020-08-12 17:39 ` [PATCH 3/3] Makefile: Add clang-tidy and static analyzer support to makefile Masahiro Yamada
2020-08-12 19:56 ` [PATCH 0/3] kbuild: clang-tidy Nathan Huckleberry
2020-08-12 22:52   ` Nick Desaulniers
2020-08-12 22:55     ` Nick Desaulniers
2020-08-13  0:50     ` Nathan Chancellor
2020-08-13  0:57       ` Masahiro Yamada
2020-08-13  1:34     ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.