[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YwOBKwPmW/FX6hSS@kernel.org>
Date: Mon, 22 Aug 2022 10:14:19 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>
Cc: Yang Jihong <yangjihong1@...wei.com>, bp@...e.de,
ndesaulniers@...gle.com, nathan@...nel.org,
alexandre.belloni@...tlin.com, namhyung@...nel.org,
jolsa@...nel.org, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tools: Fix compile error for x86
Em Mon, Aug 22, 2022 at 12:37:53PM +0200, Ingo Molnar escreveu:
>
> * Yang Jihong <yangjihong1@...wei.com> wrote:
>
> > Commit a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO") eradicates
> > CC_HAS_ASM_GOTO, perf on x86 call asm_volatile_goto when compiling __GEN_RMWcc.
> > However, asm_volatile_goto is not declared, which causes compilation error:
> >
> > In file included from /home/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h:7,
> > from /home/linux/tools/include/asm/atomic.h:6,
> > from /home/linux/tools/include/linux/atomic.h:5,
> > from /home/linux/tools/include/linux/refcount.h:41,
> > from /home/linux/tools/lib/perf/include/internal/cpumap.h:5,
> > from /home/linux/tools/perf/util/cpumap.h:7,
> > from /home/linux/tools/perf/util/env.h:7,
> > from /home/linux/tools/perf/util/header.h:12,
> > from pmu-events/pmu-events.c:9:
> > /home/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h: In function ‘atomic_dec_and_test’:
> > /home/linux/tools/include/asm/../../arch/x86/include/asm/rmwcc.h:7:2: error: implicit declaration of function ‘asm_volatile_goto’ [-Werror=implicit-function-declaration]
> > asm_volatile_goto (fullop "; j" cc " %l[cc_label]" \
> > ^~~~~~~~~~~~~~~~~
> >
> > Solution:
> > Define asm_volatile_goto in compiler_types.h if not declared.
> >
> > Currently, only x86 architecture uses asm_volatile_goto.
> > Theoretically, this patch affects only the x86 architecture.
> >
> > Fixes: a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO")
> > Signed-off-by: Yang Jihong <yangjihong1@...wei.com>
> > ---
> > tools/include/linux/compiler_types.h | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/compiler_types.h
> > index 24ae3054f304..1bdd834bdd57 100644
> > --- a/tools/include/linux/compiler_types.h
> > +++ b/tools/include/linux/compiler_types.h
> > @@ -36,4 +36,8 @@
> > #include <linux/compiler-gcc.h>
> > #endif
> >
> > +#ifndef asm_volatile_goto
> > +#define asm_volatile_goto(x...) asm goto(x)
> > +#endif
>
> Tested-by: Ingo Molnar <mingo@...nel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Linus, I'll prep a pull req later today or you can apply this so that we
can reduce the window where tools/perf/ isn't building.
- Arnaldo
Powered by blists - more mailing lists