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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Jan 2019 10:24:36 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Tri Vo <trong@...roid.com>
Cc:     oberpar@...ux.ibm.com, ghackmann@...roid.com,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kernel-team@...roid.com
Subject: Re: [PATCH 4/4] gcov: clang: pick GCC vs Clang format depending on compiler

On Tue, Jan 15, 2019 at 6:07 AM Tri Vo <trong@...roid.com> wrote:
>
> Clang gcov format is only supported by Clang compiler, and Clang
> compiler only supports Clang format.


If so, what is the point of putting GCOV_FORMAT_CLANG into the
choice menu?


You can choose the format only when you are using GCC.

I think the following is more sensible:


if GCOV_KERNEL

config GCOV_PROFILE_ALL
         ....


choice
        prompt "Specify GCOV format for GCC"
        depends on CC_IS_GCC
        ...

config GCOV_FORMAT_3_4
        bool "GCC 3.4 format"
        depends on GCC_VERSION < 40700
        ...

config GCOV_FORMAT_4_7
        bool "GCC 4.7 format"
        ...

endchoice


config GCOV_FORMAT_CLANG
         def_bool CC_IS_CLANG

endif





Or, you can delete GCOV_FORMAT_CLANG
if you write the Makefile like follows:



obj-y := base.o fs.o
obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_base.o gcc_3_4.o
obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_base.o gcc_4_7.o
obj-$(CONFIG_CC_IS_CLANG)     += clang.o






> We set gcov format to depend on which compiler (GCC or Clang) is used.
>
> Automatic format detection behavior is preserved because:
> If GCC is used, one of the GCC gcov formats is selected.
> If Clang is used, Clang gcov format is selected.
>
> Signed-off-by: Tri Vo <trong@...roid.com>
> ---
>  kernel/gcov/Kconfig | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig
> index eb428e570923..37ec551d4039 100644
> --- a/kernel/gcov/Kconfig
> +++ b/kernel/gcov/Kconfig
> @@ -60,6 +60,8 @@ choice
>         In such a case, change this option to adjust the format used in the
>         kernel accordingly.
>
> +       Select Clang gcov format if building with Clang compiler.
> +
>  config GCOV_FORMAT_3_4
>         bool "GCC 3.4 format"
>         depends on CC_IS_GCC && GCC_VERSION < 40700
> @@ -68,11 +70,13 @@ config GCOV_FORMAT_3_4
>
>  config GCOV_FORMAT_4_7
>         bool "GCC 4.7 format"
> +       depends on CC_IS_GCC
>         ---help---
>         Select this option to use the format defined by GCC 4.7.
>
>  config GCOV_FORMAT_CLANG
>         bool "Clang format"
> +       depends on CC_IS_CLANG
>         ---help---
>         Select this option to use the format defined by Clang.
>
> --
> 2.20.1.97.g81188d93c3-goog
>


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ