Skip to content

Commit 775a2be

Browse files
tohojoAlexei Starovoitov
authored andcommitted
selftests/bpf: Declare bpf_log_buf variables as static
The cgroup selftests did not declare the bpf_log_buf variable as static, leading to a linker error with GCC 10 (which defaults to -fno-common). Fix this by adding the missing static declarations. Fixes: 257c885 ("selftests/bpf: Convert test_cgroup_attach to prog_tests") Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Andrey Ignatov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 441420a commit 775a2be

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define PING_CMD "ping -q -c1 -w1 127.0.0.1 > /dev/null"
88

9-
char bpf_log_buf[BPF_LOG_BUF_SIZE];
9+
static char bpf_log_buf[BPF_LOG_BUF_SIZE];
1010

1111
static int prog_load(void)
1212
{

tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define PING_CMD "ping -q -c1 -w1 127.0.0.1 > /dev/null"
88

9-
char bpf_log_buf[BPF_LOG_BUF_SIZE];
9+
static char bpf_log_buf[BPF_LOG_BUF_SIZE];
1010

1111
static int map_fd = -1;
1212

tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define BAR "/foo/bar/"
99
#define PING_CMD "ping -q -c1 -w1 127.0.0.1 > /dev/null"
1010

11-
char bpf_log_buf[BPF_LOG_BUF_SIZE];
11+
static char bpf_log_buf[BPF_LOG_BUF_SIZE];
1212

1313
static int prog_load(int verdict)
1414
{

0 commit comments

Comments
 (0)