linux-next: build failure after merge of the tip tree
Subsystems (2)
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.
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 12 lines · Stephen Rothwell
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,
fromtools/include/linux/kernel.h:8,
fromutil/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...
Quoted 13 lines
Caused by commit
2a522b53c470("x86/insn: Support big endian cross-compiles")I have reverted commits
a23b701ae9b3objtool: Rework header include paths1b4998c364bcobjtool: Fix x86 orc generation on big endian cross compiles317664a7fcc9objtool: Fix reloc generation on big endian cross compiles2a522b53c470x86/insn: Support big endian cross-compiles2486baae2cf6objtool: Allow nested externs to enableBUILD_BUG()
Quoted 3 lines
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(-)
Signature · 6 lines
⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿
PATCH 1/1 perf build: Allow nested externs to enable BUILD_BUG() usage
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.
--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.config +1 -1
@@ -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
Signature · 6 lines
⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿
Re: [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
Quoted 25 lines · Vasily Gorbik
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 intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.config +0
-0
tools/perf/Makefile.config $(shell printf "" > $(OUTPUT).config-detected) · line 19
Quoted 5 lines
tools/perf/Makefile.config +1
-1@@ -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
Quoted 10 lines
tools/perf/Makefile.config +0
-1include $(srctree)/tools/scripts/Makefile.arch --⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿
⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿
⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿
⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿
⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿
⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿
Re: [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
Quoted 2 lines · Jiri Olsa
Quoted 1 line · Vasily Gorbik
Currently
BUILD_BUG()macro is expanded to smth like the following:
...snip...
Quoted 22 lines
tools/perf/Makefile.config $(shell printf "" > $(OUTPUT).config-detected) · line 19
Quoted 10 lines
tools/perf/Makefile.config +1
-1@@ -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 enableBUILD_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".
Quoted 16 lines
I wonder it's that picture at the bottom ;-)
jirka
Quoted 10 lines
tools/perf/Makefile.config +0
-1include $(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.
PATCH RESEND 1/1 perf build: Allow nested externs to enable BUILD_BUG() usage
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.
---
Resend with no fancy signatures.
tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.config +1 -1
@@ -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
Signature · 1 line
2.25.4
Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
Quoted 8 lines · Vasily Gorbik
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);
Quoted 8 lines
If used in a function body this obviously would produce build errors with -Wnested-externs and -Werror.
To enable
BUILD_BUG()usage intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>
that one applied nicely ;-) thanks
jirka
Quoted 22 lines
---
Resend with no fancy signatures.tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.config +1
-1@@ -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.archSignature · 1 line
2.25.4
Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
Hi all,
Quoted 16 lines · On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 14 lines · Vasily Gorbik
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 intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.
Quoted 6 lines
Quoted 2 lines
Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>that one applied nicely ;-) thanks
Acked-by Jiri Olsa <[email protected]>
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).
Signature · 2 lines
Cheers, Stephen Rothwell
Stephen Rothwell
Tested-byRe: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
Hi all,
Quoted 21 lines · On Mon, 12 Oct 2020 08:59:36 +1100 Stephen Rothwell <[email protected]>…
Quoted 19 lines · On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 16 lines · Vasily Gorbik
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 intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>
Quoted 7 lines
Quoted 3 lines
that one applied nicely ;-) thanks
Acked-by Jiri Olsa <[email protected]>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).
Signature · 2 lines
Cheers, Stephen Rothwell
Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
In reply to Stephen RothwellEm Mon, Oct 12, 2020 at 08:59:36AM +1100, Stephen Rothwell escreveu:
Quoted 22 lines
Hi all,
Quoted 19 lines · On Fri, 9 Oct 2020 14:41:11 +0200 Jiri Olsa <[email protected]> wrote:
Quoted 16 lines · Vasily Gorbik
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 intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>
Quoted 7 lines
Quoted 3 lines
that one applied nicely ;-) thanks
Acked-by Jiri Olsa <[email protected]>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
Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
In reply to Jiri OlsaEm Fri, Oct 09, 2020 at 02:41:11PM +0200, Jiri Olsa escreveu:
Quoted 15 lines · Vasily Gorbik
Quoted 14 lines
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 intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.
Quoted 6 lines
Quoted 2 lines
Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>that one applied nicely ;-) thanks
Acked-by Jiri Olsa <[email protected]>
Thanks, applied.
- Arnaldo
Re: [PATCH RESEND 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage
In reply to Vasily GorbikQuoted 2 lines · Vasily Gorbik
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 -
Quoted 36 lines
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 intools/arch/x86/lib/insn.cwhich perf includes in intel-pt-decoder, build perf without -Wnested-externs.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Vasily Gorbik <[email protected]>---
Resend with no fancy signatures.tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.config +1
-2@@ -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