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