lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 13 Aug 2020 02:47:52 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Nathan Huckleberry <nhuck@...gle.com>
Cc:     Michal Marek <michal.lkml@...kovi.net>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>,
        Pirama Arumuga Nainar <pirama@...gle.com>,
        Bill Wendling <morbo@...gle.com>
Subject: Re: [PATCH v7] Makefile: Add clang-tidy and static analyzer support
 to makefile

On Wed, Aug 12, 2020 at 10:24 AM 'Nathan Huckleberry' via Clang Built
Linux <clang-built-linux@...glegroups.com> wrote:
>
> Sounds good. Do you think this patch is ready to land then?


I do not think so.

I pointed out the CC=clang check was not working.
I see false positive errors from GCC commands.



This patch does not use the benefit of Makefile.

Makefile is used to describe the dependency
between a target and its prerequisites,
and how to update the target.

Make compares the timestamps between the
targets and prerequisites, then determines
which targets need updating.


See your code.


clang-tidy:
ifdef CONFIG_CC_IS_CLANG
       $(PYTHON3) scripts/clang-tools/gen_compile_commands.py
       $(PYTHON3) scripts/clang-tools/run-clang-tools.py clang-tidy
compile_commands.json
else
       $(error clang-tidy requires CC=clang)
endif


This always runs two commands sequentially.
It rebuilds compile_commands.json even if
nothing in the source tree has been changed.

If you do this, there is no strong reason to use Make,
and actually you can rewrite it in a shell script:


clang_tidy () {
  if [ "$CONFIG_CC_IS_CLANG = "y" ]; then
    $PYTHON3 scripts/clang-tools/gen_compile_commands.py
    $PYTHON3 scripts/clang-tools/run-clang-tools.py clang-tidy
compile_commands.json
  else
    echo "clang-tidy requires CC=clang"
    exit 1
  fi
}




I changed the rules to Makefile-ish style.

https://patchwork.kernel.org/project/linux-kbuild/list/?series=331893


I will wait for comments for the new version.


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists