Re: [PATCH v7 1/3] perf report: compile tips.txt in perf binary

From: Arnaldo Carvalho de Melo
Date: Wed May 26 2021 - 11:44:54 EST


Em Wed, May 26, 2021 at 02:50:24PM +0000, Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco) escreveu:
> > [perfbuilder@five ~]$ export PERF_TARBALL=http://192.168.100.2/perf/perf-5.13.0-rc3.tar.xz
> > [perfbuilder@five ~]$ time dm
> > Wed May 26 11:04:00 AM -03 2021
> > # export PERF_TARBALL=http://192.168.100.2/perf/perf-5.13.0-rc3.tar.xz
> > # dm
> > 1 9.39 alpine:3.4 : FAIL gcc version 5.3.0 (Alpine 5.3.0)
> > builtin-report.c: In function 'cmd_report':
> > builtin-report.c:560:3: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > fprintf(stdout, "#\n# (%s)\n#\n", help);
> > ^
> > builtin-report.c:622:20: note: 'prev' was declared here
> > char *tok, *tmp, *prev;
> > <SNIP>
> >
> > 10 13.35 alpine:3.13 : FAIL gcc version 10.2.1 20201203 (Alpine 10.2.1_pre1)
> > builtin-report.c: In function 'cmd_report':
> > builtin-report.c:560:3: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > 560 | fprintf(stdout, "#\n# (%s)\n#\n", help);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > builtin-report.c:622:20: note: 'prev' was declared here
> > 622 | char *tok, *tmp, *prev;
> > | ^~~~
> > cc1: all warnings being treated as errors
> > 11 13.77 alpine:edge : FAIL gcc version 10.3.1 20210424 (Alpine 10.3.1_git20210424)
> > builtin-report.c: In function 'cmd_report':
> > builtin-report.c:560:3: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > 560 | fprintf(stdout, "#\n# (%s)\n#\n", help);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > builtin-report.c:622:20: note: 'prev' was declared here
> > 622 | char *tok, *tmp, *prev;
> > | ^~~~
> > cc1: all warnings being treated as errors
> >
> >
> > I'll check later...
>
> prev should be initialized to _binary_Documentation_tips_txt_start, i can resend


More problems with that patch, so I'm removing it for now, till we have
these addressed.

- Arnaldo

When cross-building to Risc-V 64-bit:

LD /tmp/build/perf/Documentation/tips.o
riscv64-linux-gnu-ld: --relax and -r may not be used together
Documentation/Build:7: recipe for target '/tmp/build/perf/Documentation/tips.o' failed
make[4]: *** [/tmp/build/perf/Documentation/tips.o] Error 1
/git/perf-5.13.0-rc3/tools/build/Makefile.build:139: recipe for target 'Documentation' failed
make[3]: *** [Documentation] Error 2
make[3]: *** Waiting for unfinished jobs....

Ditto for m68k

LD /tmp/build/perf/Documentation/tips.o
m68k-linux-gnu-ld: failed to merge target specific data of file Documentation/tips.txt
Documentation/Build:7: recipe for target '/tmp/build/perf/Documentation/tips.o' failed
make[4]: *** [/tmp/build/perf/Documentation/tips.o] Error 1
/git/perf-5.13.0-rc3/tools/build/Makefile.build:139: recipe for target 'Documentation' failed
make[3]: *** [Documentation] Error 2
make[3]: *** Waiting for unfinished jobs....



That same problem, for other targets:

42 7.55 fedora:34-x-ARC-uClibc : FAIL gcc version 8.3.1 20190225 (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1)
builtin-report.c: In function 'cmd_report':
builtin-report.c:560:3: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
fprintf(stdout, "#\n# (%s)\n#\n", help);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin-report.c:622:20: note: 'prev' was declared here
char *tok, *tmp, *prev;
^~~~

19 9.46 debian:8 : FAIL gcc version 4.9.2 (Debian 4.9.2-10+deb8u2)
builtin-report.c: In function 'cmd_report':
builtin-report.c:654:7: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent,
^
builtin-report.c:622:20: note: 'prev' was declared here
char *tok, *tmp, *prev;
^
cc1: all warnings being treated as errors