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:   Wed, 13 May 2020 17:56:06 -0700
From:   Ian Rogers <irogers@...gle.com>
To:     "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH perf/core] perf intel-pt: Fix clang build failure in intel_pt_synth_pebs_sample

On Wed, May 13, 2020 at 4:43 PM Gustavo A. R. Silva
<gustavoars@...nel.org> wrote:
>
> Fix the following build failure generated with command
> $ make CC=clang HOSTCC=clang -C tools/ perf:
>
> util/intel-pt.c:1802:24: error: field 'br_stack' with variable sized type 'struct branch_stack' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
>                         struct branch_stack br_stack;
>                                             ^
> 1 error generated.
>
> Fix this by reordering the members of struct br.
>
> Clang version 11.0.0 was used.
>
> Fixes: f283f293a60d ("perf tools: Replace zero-length array with flexible-array")
> Reported-by: Ian Rogers <irogers@...gle.com>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>

Tested-by: Ian Rogers <irogers@...gle.com>

Thanks!
Ian

> ---
> Here to fix what I break. :)
>
>  tools/perf/util/intel-pt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
> index f17b1e769ae4..b34179e3926f 100644
> --- a/tools/perf/util/intel-pt.c
> +++ b/tools/perf/util/intel-pt.c
> @@ -1799,8 +1799,8 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq)
>
>         if (sample_type & PERF_SAMPLE_BRANCH_STACK) {
>                 struct {
> -                       struct branch_stack br_stack;
>                         struct branch_entry entries[LBRS_MAX];
> +                       struct branch_stack br_stack;
>                 } br;
>
>                 if (items->mask[INTEL_PT_LBR_0_POS] ||
> --
> 2.26.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ