Commit d6f7ff9d authored by Jesus Sanchez-Palencia's avatar Jesus Sanchez-Palencia Committed by Alexei Starovoitov

libbpf: Revert poisoning of strlcpy

This reverts commit 6d0c4b11("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: 6d0c4b11 ("libbpf: Poison strlcpy()")
Signed-off-by: default avatarJesus Sanchez-Palencia <jesussanp@google.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230309004836.2808610-1-jesussanp@google.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent bced3f7d
......@@ -20,8 +20,8 @@
/* make sure libbpf doesn't use kernel-only integer typedefs */
#pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
/* prevent accidental re-addition of reallocarray()/strlcpy() */
#pragma GCC poison reallocarray strlcpy
/* prevent accidental re-addition of reallocarray() */
#pragma GCC poison reallocarray
#include "libbpf.h"
#include "btf.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment