All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: add zlib as a dependency in pkg-config template
@ 2019-12-16 18:38 Andrii Nakryiko
  2019-12-16 19:33 ` Yonghong Song
  0 siblings, 1 reply; 3+ messages in thread
From: Andrii Nakryiko @ 2019-12-16 18:38 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel
  Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko, Luca Boccassi

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

Fixes: 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables")
Cc: Luca Boccassi <bluca@debian.org>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/lib/bpf/libbpf.pc.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: add zlib as a dependency in pkg-config template
  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
  2019-12-16 22:56   ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Yonghong Song @ 2019-12-16 19:33 UTC (permalink / raw)
  To: Andrii Nakryiko, bpf, netdev, Alexei Starovoitov, daniel
  Cc: andrii.nakryiko, Kernel Team, Luca Boccassi



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}
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: add zlib as a dependency in pkg-config template
  2019-12-16 19:33 ` Yonghong Song
@ 2019-12-16 22:56   ` Alexei Starovoitov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2019-12-16 22:56 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Andrii Nakryiko, bpf, netdev, Alexei Starovoitov, daniel,
	andrii.nakryiko, Kernel Team, Luca Boccassi

On Mon, Dec 16, 2019 at 11:34 AM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> 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>

Applied. Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-16 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-12-16 22:56   ` Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.