Skip to content

Commit

Permalink
perf tests bp_account: Make global variable static
Browse files Browse the repository at this point in the history
ANBZ: torvalds#668

commit cff20b3 upstream.

To fix the build with newer gccs, that without this patch exit with:

    LD       /tmp/build/perf/tests/perf-in.o
  ld: /tmp/build/perf/tests/bp_account.o:/git/perf/tools/perf/tests/bp_account.c:22: multiple definition of `the_var'; /tmp/build/perf/tests/bp_signal.o:/git/perf/tools/perf/tests/bp_signal.c:38: first defined here
  make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/tests/perf-in.o] Error 1

First noticed in fedora:rawhide/32 with:

  [perfbuilder@a5ff49d6e6e4 ~]$ gcc --version
  gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8)

Reported-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
  • Loading branch information
acmel authored and lostjeffle committed Mar 15, 2022
1 parent 1ee93e9 commit d50e2db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/tests/bp_account.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "perf.h"
#include "cloexec.h"

volatile long the_var;
static volatile long the_var;

static noinline int test_function(void)
{
Expand Down

0 comments on commit d50e2db

Please sign in to comment.