Andrew Geissler | 7eb438a | 2020-11-30 19:53:16 -0600 | [diff] [blame] | 1 | From 73d2d6b421dfdc66b4615452a94efcece27a3c21 Mon Sep 17 00:00:00 2001 |
| 2 | From: Arnaldo Carvalho de Melo <acme@redhat.com> |
| 3 | Date: Mon, 2 Mar 2020 11:13:19 -0300 |
| 4 | Subject: [PATCH] perf tests bp_account: Make global variable static |
| 5 | |
| 6 | commit cff20b3151ccab690715cb6cf0f5da5cccb32adf upstream. |
| 7 | |
| 8 | To fix the build with newer gccs, that without this patch exit with: |
| 9 | |
| 10 | LD /tmp/build/perf/tests/perf-in.o |
| 11 | 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 |
| 12 | make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/tests/perf-in.o] Error 1 |
| 13 | |
| 14 | First noticed in fedora:rawhide/32 with: |
| 15 | |
| 16 | [perfbuilder@a5ff49d6e6e4 ~]$ gcc --version |
| 17 | gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8) |
| 18 | |
| 19 | Reported-by: Jiri Olsa <jolsa@kernel.org> |
| 20 | Cc: Adrian Hunter <adrian.hunter@intel.com> |
| 21 | Cc: Namhyung Kim <namhyung@kernel.org> |
| 22 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
| 23 | Cc: Ben Hutchings <ben@decadent.org.uk> |
| 24 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 25 | --- |
| 26 | tools/perf/tests/bp_account.c | 2 +- |
| 27 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 28 | |
| 29 | diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c |
| 30 | index 016bba2..55a9de3 100644 |
| 31 | --- a/tools/perf/tests/bp_account.c |
| 32 | +++ b/tools/perf/tests/bp_account.c |
| 33 | @@ -23,7 +23,7 @@ |
| 34 | #include "../perf-sys.h" |
| 35 | #include "cloexec.h" |
| 36 | |
| 37 | -volatile long the_var; |
| 38 | +static volatile long the_var; |
| 39 | |
| 40 | static noinline int test_function(void) |
| 41 | { |
| 42 | -- |
| 43 | 2.7.4 |
| 44 | |