[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzYPx-shzhex4CvE=P7bYBudU5GVMK1fNq6Azz=sfBXK3g@mail.gmail.com>
Date: Thu, 20 Mar 2025 14:36:52 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Andrii Nakryiko <andrii@...nel.org>, Eduard Zingerman <eddyz87@...il.com>,
Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Mykyta Yatsenko <yatsenko@...a.com>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] libbpf: Add namespace for errstr making it libbpf_errstr
On Thu, Mar 20, 2025 at 11:00 AM Ian Rogers <irogers@...gle.com> wrote:
>
> When statically linking symbols can be replaced with those from other
> statically linked libraries depending on the link order and the hoped
> for "multiple definition" error may not appear. To avoid conflicts it
> is good practice to namespace symbols, this change renames errstr to
> libbpf_errstr.
>
> Fixes: 1633a83bf993 ("libbpf: Introduce errstr() for stringifying errno")
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> I feel like this patch shouldn't be strictly necessary, it turned out
> for a use-case it was and people who know better than me say the
> linker is working as intended. The conflicting errstr was from:
> https://sourceforge.net/projects/linuxquota/
> The fixes tag may not be strictly necessary.
> ---
sigh, I do like short errstr(). How about we avoid all this churn by
naming the function libbpf_errstr() as you did, but then also
defining:
#define errstr(err) libbpf_errstr(err)
and leaving all existing invocations as is
?
pw-bot: cr
> tools/lib/bpf/btf.c | 24 ++--
> tools/lib/bpf/btf_dump.c | 2 +-
> tools/lib/bpf/elf.c | 2 +-
> tools/lib/bpf/features.c | 6 +-
> tools/lib/bpf/gen_loader.c | 2 +-
> tools/lib/bpf/libbpf.c | 228 +++++++++++++++++++------------------
> tools/lib/bpf/linker.c | 21 ++--
> tools/lib/bpf/ringbuf.c | 21 ++--
> tools/lib/bpf/str_error.c | 2 +-
> tools/lib/bpf/str_error.h | 4 +-
> tools/lib/bpf/usdt.c | 16 +--
> 11 files changed, 168 insertions(+), 160 deletions(-)
>
[...]
Powered by blists - more mailing lists