# git rev-parse -q --verify 6ad7cbc01527223f3f92baac9b122f15651cf76b^{commit} # git fetch -q -n -f git://gitlab.ozlabs.ibm.com/mirror/linux-kbuild.git for-next # git rev-parse -q --verify 6ad7cbc01527223f3f92baac9b122f15651cf76b^{commit} 6ad7cbc01527223f3f92baac9b122f15651cf76b # 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/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux-gcc --version # < /opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux-ld --version # < git log --format=%s --max-count=1 6ad7cbc01527223f3f92baac9b122f15651cf76b # < make -s -j 24 ARCH=arm64 O=/kisskb/build/kbuild_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- defconfig # < make -s -j 24 ARCH=arm64 O=/kisskb/build/kbuild_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- help # make -s -j 24 ARCH=arm64 O=/kisskb/build/kbuild_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- olddefconfig # make -s -j 24 ARCH=arm64 O=/kisskb/build/kbuild_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- arch/arm64/Makefile:26: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum arch/arm64/Makefile:34: LSE atomics not supported by binutils /kisskb/src/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but its #address-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but its #size-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but its #address-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but its #size-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but its #address-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but its #size-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/qcom/ipq6018.dtsi:127.3-14: Warning (dma_ranges_format): /soc:dma-ranges: empty "dma-ranges" property but its #address-cells (1) differs from / (2) /kisskb/src/arch/arm64/boot/dts/qcom/ipq6018.dtsi:127.3-14: Warning (dma_ranges_format): /soc:dma-ranges: empty "dma-ranges" property but its #size-cells (1) differs from / (2) Completed OK # rm -rf /kisskb/build/kbuild_arm64-defconfig_arm64-gcc5.4 # Build took: 0:07:17.865354