From: Yonghong Song <yhs@fb.com>
To: Andrii Nakryiko <andriin@fb.com>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Alexei Starovoitov <ast@fb.com>,
"daniel@iogearbox.net" <daniel@iogearbox.net>
Cc: "andrii.nakryiko@gmail.com" <andrii.nakryiko@gmail.com>,
Kernel Team <Kernel-team@fb.com>,
Luca Boccassi <bluca@debian.org>
Subject: Re: [PATCH bpf-next] libbpf: add zlib as a dependency in pkg-config template
Date: Mon, 16 Dec 2019 19:33:49 +0000 [thread overview]
Message-ID: <b50659cb-4dcc-110e-e770-31615a11b5e7@fb.com> (raw)
In-Reply-To: <20191216183830.3972964-1-andriin@fb.com>
On 12/16/19 10:38 AM, Andrii Nakryiko wrote:
> List zlib as another dependency of libbpf in pkg-config template.
> Verified it is correctly resolved to proper -lz flag:
>
> $ make DESTDIR=/tmp/libbpf-install install
> $ pkg-config --libs /tmp/libbpf-install/usr/local/lib64/pkgconfig/libbpf.pc
> -L/usr/local/lib64 -lbpf
> $ pkg-config --libs --static /tmp/libbpf-install/usr/local/lib64/pkgconfig/libbpf.pc
> -L/usr/local/lib64 -lbpf -lelf -lz
Even without this patch, I already got -lz for static link libraries:
-bash-4.4$ cat libbpf.pc.template
...
Requires.private: libelf
...
-bash-4.4$ pkg-config --libs --static
/tmp/libbpf-install/usr/local/lib64/pkgconfig/libbpf.pc
-L/usr/local/lib64 -lbpf -lelf -lz
libelf depending on zlib. Maybe -lz is introduced due to libelf.
But in any case, add explicit dependency to zlib from libbpf probably
a good thing since libbpf directly uses its API functions.
Acked-by: Yonghong Song <yhs@fb.com>
[...]
> diff --git a/tools/lib/bpf/libbpf.pc.template b/tools/lib/bpf/libbpf.pc.template
> index ac17fcef2108..b45ed534bdfb 100644
> --- a/tools/lib/bpf/libbpf.pc.template
> +++ b/tools/lib/bpf/libbpf.pc.template
> @@ -8,5 +8,5 @@ Name: libbpf
> Description: BPF library
> Version: @VERSION@
> Libs: -L${libdir} -lbpf
> -Requires.private: libelf
> +Requires.private: libelf zlib
> Cflags: -I${includedir}
>
next prev parent reply other threads:[~2019-12-16 19:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 18:38 [PATCH bpf-next] libbpf: add zlib as a dependency in pkg-config template Andrii Nakryiko
2019-12-16 19:33 ` Yonghong Song [this message]
2019-12-16 22:56 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b50659cb-4dcc-110e-e770-31615a11b5e7@fb.com \
--to=yhs@fb.com \
--cc=Kernel-team@fb.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=ast@fb.com \
--cc=bluca@debian.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox