Skip to content

Commit d6f7ff9

Browse files
jeezAlexei Starovoitov
authored andcommitted
libbpf: Revert poisoning of strlcpy
This reverts commit 6d0c4b1("libbpf: Poison strlcpy()"). It added the pragma poison directive to libbpf_internal.h to protect against accidental usage of strlcpy but ended up breaking the build for toolchains based on libcs which provide the strlcpy() declaration from string.h (e.g. uClibc-ng). The include order which causes the issue is: string.h, from Iibbpf_common.h:12, from libbpf.h:20, from libbpf_internal.h:26, from strset.c:9: Fixes: 6d0c4b1 ("libbpf: Poison strlcpy()") Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20230309004836.2808610-1-jesussanp@google.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent bced3f7 commit d6f7ff9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/lib/bpf/libbpf_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
/* make sure libbpf doesn't use kernel-only integer typedefs */
2121
#pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
2222

23-
/* prevent accidental re-addition of reallocarray()/strlcpy() */
24-
#pragma GCC poison reallocarray strlcpy
23+
/* prevent accidental re-addition of reallocarray() */
24+
#pragma GCC poison reallocarray
2525

2626
#include "libbpf.h"
2727
#include "btf.h"

0 commit comments

Comments
 (0)