Open copyninja opened 4 years ago
cc @olsajiri could you check here? Maybe a PIC version of libbpf.a is needed here?
Just to note that libbpf.a in Debian is built with -fPIC flag as seen here in the build log
From reading src/cc/CMakeLists.txt
here is my understanding. When CMAKE_USE_LIBBPF_PACKAGE
is set bcc-shared-no-libbpf
target is built but I see even bcc-shared
target is built as well. bcc-shared-no-libbpf
builds successfully where bcc-shared
fails. So is it a build system bug?.
@yonghong-song @olsajiri any comments on above?
Bump.. anything on this front?
@olsajiri Are you aware of this?
@copyninja I stumbled on the same error. Error cause is that libbpf.o
for libbpf.a
is compiled without -fPIC
. See your Debian build log closely -- there is two compilation lines for libbpf.o
:
Only the second one (which is going into libbpf.so
) is having -fPIC
. The one with staticobjs/libbpf.o
(which goes into libbpf.a
) does not have -fPIC
.
And, it seems, bcc
wants libbpf.a
unconditionally and wants it with -fPIC
.
@vt-alt right. I think this issue can be closed as it was fixed by @bluca in recent PR's and now packages in Debian built with libbpf from system
I'm trying to compile bcc using libbpf packaged on Debian (libbpf0 and libbpf-dev). So I set the above flag while invoking cmake.
But this ends up with following error
I'm not well versed with cmake to fix this can some one help me in fixing this erorr?. I'm trying to build bcc on Debian without embedding libbpf.