Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
* linux-next: build failure after merge of the tip tree
@ 2020-10-09  4:28 Stephen Rothwell
  2020-10-09  6:47 ` Vasily Gorbik
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2020-10-09  4:28 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
  Cc: Josh Poimboeuf, Martin Schwidefsky, Vasily Gorbik,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List


[-- Attachment #1: Type: text/plain, Size: 2901 bytes --]

Hi all,

After merging the tip tree, today's linux-next build (perf) failed
like this:

In file included from tools/include/linux/build_bug.h:5,
                 from tools/include/linux/kernel.h:8,
                 from util/intel-pt-decoder/intel-pt-insn-decoder.c:7:
util/intel-pt-decoder/../../../arch/x86/lib/insn.c: In function '__insn_get_emulate_prefix':
tools/include/linux/compiler.h:37:38: error: nested extern declaration of '__compiletime_assert_0' [-Werror=nested-externs]
   37 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                      ^~~~~~~~~~~~~~~~~~~~~
tools/include/linux/compiler.h:16:15: note: in definition of macro '__compiletime_assert'
   16 |   extern void prefix ## suffix(void) __compiletime_error(msg); \
      |               ^~~~~~
tools/include/linux/compiler.h:37:2: note: in expansion of macro '_compiletime_assert'
   37 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |  ^~~~~~~~~~~~~~~~~~~
tools/include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
tools/include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
      |                     ^~~~~~~~~~~~~~~~
util/intel-pt-decoder/../../../arch/x86/lib/insn.c:27:3: note: in expansion of macro 'BUILD_BUG'
   27 |   BUILD_BUG(); break;     \
      |   ^~~~~~~~~
util/intel-pt-decoder/../../../arch/x86/lib/insn.c:40:41: note: in expansion of macro 'leXX_to_cpu'
   40 |  ({ t r = *(t*)((insn)->next_byte + n); leXX_to_cpu(t, r); })
      |                                         ^~~~~~~~~~~
util/intel-pt-decoder/../../../arch/x86/lib/insn.c:46:61: note: in expansion of macro '__peek_nbyte_next'
   46 |  ({ if (unlikely(!validate_next(t, insn, n))) goto err_out; __peek_nbyte_next(t, insn, n); })
      |                                                             ^~~~~~~~~~~~~~~~~
util/intel-pt-decoder/../../../arch/x86/lib/insn.c:86:7: note: in expansion of macro 'peek_nbyte_next'
   86 |   if (peek_nbyte_next(insn_byte_t, insn, i) != prefix[i])
      |       ^~~~~~~~~~~~~~~

Caused by commit

  2a522b53c470 ("x86/insn: Support big endian cross-compiles")

I have reverted commits

a23b701ae9b3 objtool: Rework header include paths
1b4998c364bc objtool: Fix x86 orc generation on big endian cross compiles
317664a7fcc9 objtool: Fix reloc generation on big endian cross compiles
2a522b53c470 x86/insn: Support big endian cross-compiles
2486baae2cf6 objtool: Allow nested externs to enable BUILD_BUG()

for today.

This is a PowerPC LE native build of tools/perf.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux-next: build failure after merge of the tip tree
  2020-10-09  4:28 linux-next: build failure after merge of the tip tree Stephen Rothwell
@ 2020-10-09  6:47 ` Vasily Gorbik
  2020-10-09  6:47   ` [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage Vasily Gorbik
  0 siblings, 1 reply; 12+ messages in thread
From: Vasily Gorbik @ 2020-10-09  6:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Josh Poimboeuf, Peter Zijlstra,
	Stephen Rothwell
  Cc: Ingo Molnar, Thomas Gleixner, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, H. Peter Anvin, Masami Hiramatsu,
	Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Oct 09, 2020 at 03:28:46PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the tip tree, today's linux-next build (perf) failed
> like this:
> 
> In file included from tools/include/linux/build_bug.h:5,
>                  from tools/include/linux/kernel.h:8,
>                  from util/intel-pt-decoder/intel-pt-insn-decoder.c:7:
> util/intel-pt-decoder/../../../arch/x86/lib/insn.c: In function '__insn_get_emulate_prefix':
> tools/include/linux/compiler.h:37:38: error: nested extern declaration of '__compiletime_assert_0' [-Werror=nested-externs]
>    37 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>       |                                      ^~~~~~~~~~~~~~~~~~~~~
...snip...
> 
> Caused by commit
> 
>   2a522b53c470 ("x86/insn: Support big endian cross-compiles")
> 
> I have reverted commits
> 
> a23b701ae9b3 objtool: Rework header include paths
> 1b4998c364bc objtool: Fix x86 orc generation on big endian cross compiles
> 317664a7fcc9 objtool: Fix reloc generation on big endian cross compiles
> 2a522b53c470 x86/insn: Support big endian cross-compiles
> 2486baae2cf6 objtool: Allow nested externs to enable BUILD_BUG()
> 
> for today.
> 
> This is a PowerPC LE native build of tools/perf.

Oh, I missed that. Sorry about that. Obviously x86 instruction
decoder is also used in perf. The question is, should we just disable
-Wnested-externs for perf like we did for the objtool. Or since we got
BUILD_BUG() implementation in tools simply disable -Wnested-externs for
all tools altogether? By throwing it out of EXTRA_WARNINGS.

Vasily Gorbik (1):
  perf build: Allow nested externs to enable BUILD_BUG() usage

 tools/perf/Makefile.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿
⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿
⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿
⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿
⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿
⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09  6:47 ` Vasily Gorbik
@ 2020-10-09  6:47   ` Vasily Gorbik
  2020-10-09 11:23     ` Jiri Olsa
  0 siblings, 1 reply; 12+ messages in thread
From: Vasily Gorbik @ 2020-10-09  6:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Josh Poimboeuf, Peter Zijlstra,
	Stephen Rothwell
  Cc: Ingo Molnar, Thomas Gleixner, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, H. Peter Anvin, Masami Hiramatsu,
	Linux Kernel Mailing List, Linux Next Mailing List

Currently BUILD_BUG() macro is expanded to smth like the following:
   do {
           extern void __compiletime_assert_0(void)
                   __attribute__((error("BUILD_BUG failed")));
           if (!(!(1)))
                   __compiletime_assert_0();
   } while (0);

If used in a function body this obviously would produce build errors
with -Wnested-externs and -Werror.

To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
includes in intel-pt-decoder, build perf without -Wnested-externs.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
---
 tools/perf/Makefile.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 190be4fa5c21..8137a6046a47 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
 detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
 detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
 
-CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
+CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
 
 include $(srctree)/tools/scripts/Makefile.arch
 
-- 
⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿
⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿
⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿
⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿
⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿
⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09  6:47   ` [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage Vasily Gorbik
@ 2020-10-09 11:23     ` Jiri Olsa
  2020-10-09 12:25       ` Vasily Gorbik
  0 siblings, 1 reply; 12+ messages in thread
From: Jiri Olsa @ 2020-10-09 11:23 UTC (permalink / raw)
  To: Vasily Gorbik
  Cc: Arnaldo Carvalho de Melo, Josh Poimboeuf, Peter Zijlstra,
	Stephen Rothwell, Ingo Molnar, Thomas Gleixner, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Oct 09, 2020 at 08:47:45AM +0200, Vasily Gorbik wrote:
> Currently BUILD_BUG() macro is expanded to smth like the following:
>    do {
>            extern void __compiletime_assert_0(void)
>                    __attribute__((error("BUILD_BUG failed")));
>            if (!(!(1)))
>                    __compiletime_assert_0();
>    } while (0);
> 
> If used in a function body this obviously would produce build errors
> with -Wnested-externs and -Werror.
> 
> To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> includes in intel-pt-decoder, build perf without -Wnested-externs.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> ---
>  tools/perf/Makefile.config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 190be4fa5c21..8137a6046a47 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
>  detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
>  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
>  
> -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
> +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))

looks good, but I can't apply the patch with 'git am'

	Applying: perf build: Allow nested externs to enable BUILD_BUG() usage
	error: patch failed: tools/perf/Makefile.config:16
	error: tools/perf/Makefile.config: patch does not apply
	Patch failed at 0001 perf build: Allow nested externs to enable BUILD_BUG() usage
	hint: Use 'git am --show-current-patch=diff' to see the failed patch
	When you have resolved this problem, run "git am --continue".
	If you prefer to skip this patch, run "git am --skip" instead.
	To restore the original branch and stop patching, run "git am --abort".

I wonder it's that picture at the bottom ;-)

jirka


>  
>  include $(srctree)/tools/scripts/Makefile.arch
>  
> -- 
> ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿
> ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿
> ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿
> ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿
> ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿
> ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09 11:23     ` Jiri Olsa
@ 2020-10-09 12:25       ` Vasily Gorbik
  2020-10-09 12:25         ` [PATCH RESEND " Vasily Gorbik
  0 siblings, 1 reply; 12+ messages in thread
From: Vasily Gorbik @ 2020-10-09 12:25 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, Josh Poimboeuf, Peter Zijlstra,
	Stephen Rothwell, Ingo Molnar, Thomas Gleixner, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Oct 09, 2020 at 01:23:27PM +0200, Jiri Olsa wrote:
> On Fri, Oct 09, 2020 at 08:47:45AM +0200, Vasily Gorbik wrote:
> > Currently BUILD_BUG() macro is expanded to smth like the following:
...snip...
> > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> > index 190be4fa5c21..8137a6046a47 100644
> > --- a/tools/perf/Makefile.config
> > +++ b/tools/perf/Makefile.config
> > @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
> >  detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
> >  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
> >  
> > -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
> > +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
> 
> looks good, but I can't apply the patch with 'git am'
> 
> 	Applying: perf build: Allow nested externs to enable BUILD_BUG() usage
> 	error: patch failed: tools/perf/Makefile.config:16
> 	error: tools/perf/Makefile.config: patch does not apply
> 	Patch failed at 0001 perf build: Allow nested externs to enable BUILD_BUG() usage
> 	hint: Use 'git am --show-current-patch=diff' to see the failed patch
> 	When you have resolved this problem, run "git am --continue".
> 	If you prefer to skip this patch, run "git am --skip" instead.
> 	To restore the original branch and stop patching, run "git am --abort".
> 
> I wonder it's that picture at the bottom ;-)
> 
> jirka
> 
> 
> >  
> >  include $(srctree)/tools/scripts/Makefile.arch
> >  
> > -- 
> > ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿
> > ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿
> > ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿
> > ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿
> > ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿
> > ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿
> 

What? This makes tux and blind people very unhappy. Those are nothing
else but braille utf-8 characters. And I've seen people on lkml are
using those, i.e. debian icon in a signature. Oh, well... I'll avoid
using this signature in future.

BTW which branch did you try to apply it on? I've just checked perf/core
and there should be no conflicts as well. But I assume this should go
via objtool together with other changes which introduced that BUILD_BUG()
usage.
 
Anyhow I've resent the patch without fancy signatures included.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09 12:25       ` Vasily Gorbik
@ 2020-10-09 12:25         ` Vasily Gorbik
  2020-10-09 12:41           ` Jiri Olsa
  2020-10-12  7:06           ` Sedat Dilek
  0 siblings, 2 replies; 12+ messages in thread
From: Vasily Gorbik @ 2020-10-09 12:25 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, Josh Poimboeuf, Peter Zijlstra,
	Stephen Rothwell, Ingo Molnar, Thomas Gleixner, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List

Currently BUILD_BUG() macro is expanded to smth like the following:
   do {
           extern void __compiletime_assert_0(void)
                   __attribute__((error("BUILD_BUG failed")));
           if (!(!(1)))
                   __compiletime_assert_0();
   } while (0);

If used in a function body this obviously would produce build errors
with -Wnested-externs and -Werror.

To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
includes in intel-pt-decoder, build perf without -Wnested-externs.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
---
 Resend with no fancy signatures.

 tools/perf/Makefile.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 854da830b5ca..834061e94e7c 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
 detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
 detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
 
-CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
+CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
 
 include $(srctree)/tools/scripts/Makefile.arch
 
-- 
2.25.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09 12:25         ` [PATCH RESEND " Vasily Gorbik
@ 2020-10-09 12:41           ` Jiri Olsa
  2020-10-11 21:59             ` Stephen Rothwell
  2020-10-13 19:07             ` Arnaldo Carvalho de Melo
  2020-10-12  7:06           ` Sedat Dilek
  1 sibling, 2 replies; 12+ messages in thread
From: Jiri Olsa @ 2020-10-09 12:41 UTC (permalink / raw)
  To: Vasily Gorbik
  Cc: Arnaldo Carvalho de Melo, Josh Poimboeuf, Peter Zijlstra,
	Stephen Rothwell, Ingo Molnar, Thomas Gleixner, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> Currently BUILD_BUG() macro is expanded to smth like the following:
>    do {
>            extern void __compiletime_assert_0(void)
>                    __attribute__((error("BUILD_BUG failed")));
>            if (!(!(1)))
>                    __compiletime_assert_0();
>    } while (0);
> 
> If used in a function body this obviously would produce build errors
> with -Wnested-externs and -Werror.
> 
> To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> includes in intel-pt-decoder, build perf without -Wnested-externs.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

that one applied nicely ;-) thanks

Acked-by: Jiri Olsa <jolsa@redhat.com>

jirka

> ---
>  Resend with no fancy signatures.
> 
>  tools/perf/Makefile.config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 854da830b5ca..834061e94e7c 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
>  detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
>  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
>  
> -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
> +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
>  
>  include $(srctree)/tools/scripts/Makefile.arch
>  
> -- 
> 2.25.4
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09 12:41           ` Jiri Olsa
@ 2020-10-11 21:59             ` Stephen Rothwell
  2020-10-12  5:13               ` Stephen Rothwell
  2020-10-13 19:09               ` Arnaldo Carvalho de Melo
  2020-10-13 19:07             ` Arnaldo Carvalho de Melo
  1 sibling, 2 replies; 12+ messages in thread
From: Stephen Rothwell @ 2020-10-11 21:59 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Vasily Gorbik, Arnaldo Carvalho de Melo, Josh Poimboeuf,
	Peter Zijlstra, Ingo Molnar, Thomas Gleixner, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List


[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

Hi all,

On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> > Currently BUILD_BUG() macro is expanded to smth like the following:
> >    do {
> >            extern void __compiletime_assert_0(void)
> >                    __attribute__((error("BUILD_BUG failed")));
> >            if (!(!(1)))
> >                    __compiletime_assert_0();
> >    } while (0);
> > 
> > If used in a function body this obviously would produce build errors
> > with -Wnested-externs and -Werror.
> > 
> > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > 
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>  
> 
> that one applied nicely ;-) thanks
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>

I will apply that patch to the merge of the tip tree today (instead of
reverting the series I reverted in Friday) (unless I get an update of
the tip tree containing it, of course).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-11 21:59             ` Stephen Rothwell
@ 2020-10-12  5:13               ` Stephen Rothwell
  2020-10-13 19:09               ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2020-10-12  5:13 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Vasily Gorbik, Arnaldo Carvalho de Melo, Josh Poimboeuf,
	Peter Zijlstra, Ingo Molnar, Thomas Gleixner, Mark Rutland,
	Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List


[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

Hi all,

On Mon, 12 Oct 2020 08:59:36 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa <jolsa@redhat.com> wrote:
> >
> > On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:  
> > > Currently BUILD_BUG() macro is expanded to smth like the following:
> > >    do {
> > >            extern void __compiletime_assert_0(void)
> > >                    __attribute__((error("BUILD_BUG failed")));
> > >            if (!(!(1)))
> > >                    __compiletime_assert_0();
> > >    } while (0);
> > > 
> > > If used in a function body this obviously would produce build errors
> > > with -Wnested-externs and -Werror.
> > > 
> > > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > > 
> > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>    
> > 
> > that one applied nicely ;-) thanks
> > 
> > Acked-by: Jiri Olsa <jolsa@redhat.com>  
> 
> I will apply that patch to the merge of the tip tree today (instead of
> reverting the series I reverted in Friday) (unless I get an update of
> the tip tree containing it, of course).

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build tested

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09 12:25         ` [PATCH RESEND " Vasily Gorbik
  2020-10-09 12:41           ` Jiri Olsa
@ 2020-10-12  7:06           ` Sedat Dilek
  1 sibling, 0 replies; 12+ messages in thread
From: Sedat Dilek @ 2020-10-12  7:06 UTC (permalink / raw)
  To: Vasily Gorbik
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Josh Poimboeuf,
	Peter Zijlstra, Stephen Rothwell, Ingo Molnar, Thomas Gleixner,
	Mark Rutland, Alexander Shishkin, Namhyung Kim, H. Peter Anvin,
	Masami Hiramatsu, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Oct 9, 2020 at 8:35 PM Vasily Gorbik <gor@linux.ibm.com> wrote:
>
> Currently BUILD_BUG() macro is expanded to smth like the following:

Two feedbacks:

#1: Greg KH told me to expand abbreviated words, here "smth = something".

#2: Interesting to see an ASCII-art in the signature is causing such troubles.

- Sedat -


>    do {
>            extern void __compiletime_assert_0(void)
>                    __attribute__((error("BUILD_BUG failed")));
>            if (!(!(1)))
>                    __compiletime_assert_0();
>    } while (0);
>
> If used in a function body this obviously would produce build errors
> with -Wnested-externs and -Werror.
>
> To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> includes in intel-pt-decoder, build perf without -Wnested-externs.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> ---
>  Resend with no fancy signatures.
>
>  tools/perf/Makefile.config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 854da830b5ca..834061e94e7c 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
>  detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
>  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
>
> -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
> +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
>
>  include $(srctree)/tools/scripts/Makefile.arch
>
> --
> 2.25.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-09 12:41           ` Jiri Olsa
  2020-10-11 21:59             ` Stephen Rothwell
@ 2020-10-13 19:07             ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-10-13 19:07 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Vasily Gorbik, Josh Poimboeuf, Peter Zijlstra, Stephen Rothwell,
	Ingo Molnar, Thomas Gleixner, Mark Rutland, Alexander Shishkin,
	Namhyung Kim, H. Peter Anvin, Masami Hiramatsu,
	Linux Kernel Mailing List, Linux Next Mailing List

Em Fri, Oct 09, 2020 at 02:41:11PM +0200, Jiri Olsa escreveu:
> On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> > Currently BUILD_BUG() macro is expanded to smth like the following:
> >    do {
> >            extern void __compiletime_assert_0(void)
> >                    __attribute__((error("BUILD_BUG failed")));
> >            if (!(!(1)))
> >                    __compiletime_assert_0();
> >    } while (0);
> > 
> > If used in a function body this obviously would produce build errors
> > with -Wnested-externs and -Werror.
> > 
> > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > 
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> 
> that one applied nicely ;-) thanks
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>



Thanks, applied.

- Arnaldo


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
  2020-10-11 21:59             ` Stephen Rothwell
  2020-10-12  5:13               ` Stephen Rothwell
@ 2020-10-13 19:09               ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-10-13 19:09 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jiri Olsa, Vasily Gorbik, Josh Poimboeuf, Peter Zijlstra,
	Ingo Molnar, Thomas Gleixner, Mark Rutland, Alexander Shishkin,
	Namhyung Kim, H. Peter Anvin, Masami Hiramatsu,
	Linux Kernel Mailing List, Linux Next Mailing List

Em Mon, Oct 12, 2020 at 08:59:36AM +1100, Stephen Rothwell escreveu:
> Hi all,
> 
> On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa <jolsa@redhat.com> wrote:
> >
> > On Fri, Oct 09, 2020 at 02:25:23PM +0200, Vasily Gorbik wrote:
> > > Currently BUILD_BUG() macro is expanded to smth like the following:
> > >    do {
> > >            extern void __compiletime_assert_0(void)
> > >                    __attribute__((error("BUILD_BUG failed")));
> > >            if (!(!(1)))
> > >                    __compiletime_assert_0();
> > >    } while (0);
> > > 
> > > If used in a function body this obviously would produce build errors
> > > with -Wnested-externs and -Werror.
> > > 
> > > To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf
> > > includes in intel-pt-decoder, build perf without -Wnested-externs.
> > > 
> > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>  
> > 
> > that one applied nicely ;-) thanks
> > 
> > Acked-by: Jiri Olsa <jolsa@redhat.com>
> 
> I will apply that patch to the merge of the tip tree today (instead of
> reverting the series I reverted in Friday) (unless I get an update of
> the tip tree containing it, of course).

Applied to perf/core that will go to Linus this week, maybe even today.

- Arnaldo

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09  4:28 linux-next: build failure after merge of the tip tree Stephen Rothwell
2020-10-09  6:47 ` Vasily Gorbik
2020-10-09  6:47   ` [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage Vasily Gorbik
2020-10-09 11:23     ` Jiri Olsa
2020-10-09 12:25       ` Vasily Gorbik
2020-10-09 12:25         ` [PATCH RESEND " Vasily Gorbik
2020-10-09 12:41           ` Jiri Olsa
2020-10-11 21:59             ` Stephen Rothwell
2020-10-12  5:13               ` Stephen Rothwell
2020-10-13 19:09               ` Arnaldo Carvalho de Melo
2020-10-13 19:07             ` Arnaldo Carvalho de Melo
2020-10-12  7:06           ` Sedat Dilek

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git