# 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/mips-linux/bin/mips-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux-ld --version # < git log --format=%s --max-count=1 6ad7cbc01527223f3f92baac9b122f15651cf76b # < make -s -j 48 ARCH=mips O=/kisskb/build/kbuild_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- defconfig # < make -s -j 48 ARCH=mips O=/kisskb/build/kbuild_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- help # make -s -j 48 ARCH=mips O=/kisskb/build/kbuild_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- olddefconfig # make -s -j 48 ARCH=mips O=/kisskb/build/kbuild_mips-defconfig_mips-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/mips-linux/bin/mips-linux- FIT description: Linux 5.9.0-rc2-48140-g6ad7cbc01527 Created: Thu Aug 27 08:41:35 2020 Image 0 (kernel@0) Description: Linux 5.9.0-rc2-48140-g6ad7cbc01527 Created: Thu Aug 27 08:41:35 2020 Type: Kernel Image Compression: gzip compressed Data Size: 5083046 Bytes = 4963.91 KiB = 4.85 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x80950020 Hash algo: sha1 Hash value: abf192894a6b1b9ba5d09c1638a0dd9ed932cd2b Image 1 (fdt@boston) Description: img,boston Device Tree Created: Thu Aug 27 08:41:35 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 3793 Bytes = 3.70 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 4799f50d688573234da6e9d7701234d394759ef4 Image 2 (fdt@ni169445) Description: NI 169445 device tree Created: Thu Aug 27 08:41:35 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 1871 Bytes = 1.83 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 51b89b31605ee62038c8468c429af091dfc75ec7 Image 3 (fdt@ocelot_pcb123) Description: MSCC Ocelot PCB123 Device Tree Created: Thu Aug 27 08:41:35 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 4639 Bytes = 4.53 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: be2724f58b66c316a61da7c11ced633f4e7e86c7 Image 4 (fdt@ocelot_pcb120) Description: MSCC Ocelot PCB120 Device Tree Created: Thu Aug 27 08:41:35 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 5398 Bytes = 5.27 KiB = 0.01 MiB Architecture: MIPS Hash algo: sha1 Hash value: 2a757b83ef9e9d35fb6c43bdbde70d311b3e4555 Image 5 (fdt@xilfpga) Description: MIPSfpga (xilfpga) Device Tree Created: Thu Aug 27 08:41:35 2020 Type: Flat Device Tree Compression: uncompressed Data Size: 2708 Bytes = 2.64 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 63d058b780f65e22da30f0a183433765f1807f1d Default Configuration: 'conf@default' Configuration 0 (conf@default) Description: Generic Linux kernel Kernel: kernel@0 Configuration 1 (conf@boston) Description: Boston Linux kernel Kernel: kernel@0 FDT: fdt@boston Configuration 2 (conf@ni169445) Description: NI 169445 Linux Kernel Kernel: kernel@0 FDT: fdt@ni169445 Configuration 3 (conf@ocelot_pcb123) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb123 Configuration 4 (conf@ocelot_pcb120) Description: Ocelot Linux kernel Kernel: kernel@0 FDT: fdt@ocelot_pcb120 Configuration 5 (conf@xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel@0 FDT: fdt@xilfpga Completed OK # rm -rf /kisskb/build/kbuild_mips-defconfig_mips-gcc4.9 # Build took: 0:01:38.864078