# git rev-parse -q --verify 6ad7cbc01527223f3f92baac9b122f15651cf76b^{commit} 6ad7cbc01527223f3f92baac9b122f15651cf76b already have revision, skipping fetch # git checkout -q -f -B kisskb 6ad7cbc01527223f3f92baac9b122f15651cf76b # git clean -qxdf # < git log -1 # commit 6ad7cbc01527223f3f92baac9b122f15651cf76b # Author: Nathan Huckleberry # Date: Sat Aug 22 23:56:18 2020 +0900 # # Makefile: Add clang-tidy and static analyzer support to makefile # # This patch adds clang-tidy and the clang static-analyzer as make # targets. The goal of this patch is to make static analysis tools # usable and extendable by any developer or researcher who is familiar # with basic c++. # # The current static analysis tools require intimate knowledge of the # internal workings of the static analysis. Clang-tidy and the clang # static analyzers expose an easy to use api and allow users unfamiliar # with clang to write new checks with relative ease. # # ===Clang-tidy=== # # Clang-tidy is an easily extendable 'linter' that runs on the AST. # Clang-tidy checks are easy to write and understand. A check consists of # two parts, a matcher and a checker. The matcher is created using a # domain specific language that acts on the AST # (https://clang.llvm.org/docs/LibASTMatchersReference.html). When AST # nodes are found by the matcher a callback is made to the checker. The # checker can then execute additional checks and issue warnings. # # Here is an example clang-tidy check to report functions that have calls # to local_irq_disable without calls to local_irq_enable and vice-versa. # Functions flagged with __attribute((annotation("ignore_irq_balancing"))) # are ignored for analysis. (https://reviews.llvm.org/D65828) # # ===Clang static analyzer=== # # The clang static analyzer is a more powerful static analysis tool that # uses symbolic execution to find bugs. Currently there is a check that # looks for potential security bugs from invalid uses of kmalloc and # kfree. There are several more general purpose checks that are useful for # the kernel. # # The clang static analyzer is well documented and designed to be # extensible. # (https://clang-analyzer.llvm.org/checker_dev_manual.html) # (https://github.com/haoNoQ/clang-analyzer-guide/releases/download/v0.1/clang-analyzer-guide-v0.1.pdf) # # The main draw of the clang tools is how accessible they are. The clang # documentation is very nice and these tools are built specifically to be # easily extendable by any developer. They provide an accessible method of # bug-finding and research to people who are not overly familiar with the # kernel codebase. # # Signed-off-by: Nathan Huckleberry # Reviewed-by: Nick Desaulniers # Tested-by: Nick Desaulniers # Tested-by: Lukas Bulwahn # Signed-off-by: Masahiro Yamada # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 6ad7cbc01527223f3f92baac9b122f15651cf76b # < make -s -j 24 ARCH=powerpc O=/kisskb/build/kbuild_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc44x_defconfig # < make -s -j 24 ARCH=powerpc O=/kisskb/build/kbuild_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 24 ARCH=powerpc O=/kisskb/build/kbuild_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 24 ARCH=powerpc O=/kisskb/build/kbuild_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/block/genhd.c: In function 'diskstats_show': /kisskb/src/block/genhd.c:1667:1: warning: the frame size of 1160 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/zstd/compress.c: In function 'ZSTD_compressBlock_doubleFast': /kisskb/src/lib/zstd/compress.c:1393:1: warning: the frame size of 1584 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e37b4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3039967 Bytes = 2968.72 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040110 Bytes = 2968.86 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014b8 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:37 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040079 Bytes = 2968.83 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 00601498 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:36 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040279 Bytes = 2969.02 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:37 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040694 Bytes = 2969.43 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006000c4 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:37 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040568 Bytes = 2969.30 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a0 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:37 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040677 Bytes = 2969.41 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:37 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040784 Bytes = 2969.52 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006001b8 Image Name: Linux-5.9.0-rc2-g6ad7cbc01527 Created: Thu Aug 27 09:11:37 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3040747 Bytes = 2969.48 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 00601488 Completed OK # rm -rf /kisskb/build/kbuild_ppc44x_defconfig_powerpc-gcc4.9 # Build took: 0:01:11.493998