selftests/bpf: Fix conflicts with built-in functions in bench_local_storage_create
Subsystems (3)
PATCH 1/1 selftests/bpf: Fix conflicts with built-in functions in bench_local_storage_create
The fork function in gcc is considered a built in function due to being used by libgcov when building with gnu extensions.
Rename fork to sched_process_fork to prevent this conflict.
See details:
https://github.com/gcc-mirror/gcc/commit/d1c38823924506d389ca58d02926ace21bdf82fa
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82457
Fixes the following error:
In file included from progs/bench_local_storage_create.c:6:progs/bench_local_storage_create.c:43:14: error: conflicting types for built-in function 'fork'; expected 'int(void)' [-Werror=builtin-declaration-mismatch]
43 | int BPF_PROG(fork, struct task_struct *parent, structtask_struct *child)
| ^~~~
--- tools/testing/selftests/bpf/benchs/bench_local_storage_create.c | 2 +- tools/testing/selftests/bpf/progs/bench_local_storage_create.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/benchs/bench_local_storage_create.c +1 -1
@@ -95,7 +95,7 @@ static void setup(void)exit (1 ); } }else { -if (!bpf_program__attach (skel->progs.fork)) { +if (!bpf_program__attach (skel->progs.sched_process_fork)) {fprintf (stderr,"Error attaching bpf program\n" );exit (1 ); }
tools/testing/selftests/bpf/progs/bench_local_storage_create.c +1 -1
@@ -40,7 +40,7 @@ int BPF_PROG(kmalloc, unsigned long call_site, const void *ptr, } SEC("tp_btf/sched_process_fork") -int BPF_PROG (fork ,struct task_struct *parent,struct task_struct *child) +int BPF_PROG (sched_process_fork ,struct task_struct *parent,struct task_struct *child) {struct storage *stg;
Signature · 1 line
2.34.1
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 10 lines · On Fri, 31 Mar 2023 01:58:42 -0600 you wrote:
The fork function in gcc is considered a built in function due to being used by libgcov when building with gnu extensions.
Rename fork to
sched_process_forkto prevent this conflict.See details:
https://github.com/gcc-mirror/gcc/commit/d1c38823924506d389ca58d02926ace21bdf82fa
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82457[...]
Here is the summary with links:
- [bpf-next] selftests/bpf: Fix conflicts with built-in functions in bench_local_storage_create
https://git.kernel.org/bpf/bpf-next/c/9af0f555ae4a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html