Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link failures against system grpc-1.41.0 #99

Closed
mgorny opened this issue Oct 16, 2021 · 1 comment · Fixed by #144
Closed

Link failures against system grpc-1.41.0 #99

mgorny opened this issue Oct 16, 2021 · 1 comment · Fixed by #144
Labels
kind/bug Something isn't working

Comments

@mgorny
Copy link

mgorny commented Oct 16, 2021

Describe the bug

When attempting to build sinsp against system grpc, the build fails due to underlinking:

FAILED: libsinsp/examples/sinsp-example 
: && /usr/bin/c++ -Wall -ggdb -std=c++0x -O3 -fno-strict-aliasing -DNDEBUG -rdynamic libsinsp/examples/CMakeFiles/sinsp-example.dir/util.cpp.o libsinsp/examples/CMakeFiles/sinsp-example.dir/test.cpp.o -o libsinsp/examples/sinsp-example  libsinsp/libsinsp.a  libscap/libscap.a  -lelf  -lz  -lcurl  -ljsoncpp  -lcares  -ltbb  -lgrpc++  -lgrpc  -lgpr  -lprotobuf  -lcares  -ltbb  -lgrpc++  -lgrpc  -lgpr  -lprotobuf  -ljq  -Wl,-Bstatic  -lb64  -Wl,-Bdynamic  -lrt  -lanl  -lssl  -lcrypto  -ldl  -lpthread && :
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: libsinsp/libsinsp.a(cri.grpc.pb.cc.o): undefined reference to symbol '_ZN4absl12lts_202103245MutexD1Ev'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libabsl_synchronization.so.2103.0.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

A similar problem affects sysdig, also through libsinsp.a.

How to reproduce it

git clone https://github.com/falcosecurity/libs falcolibs
mkdir falcolibs/build
cd falcolibs/build
cmake .. -G Ninja -DUSE_BUNDLED_DEPS=OFF
ninja libsinsp/examples/sinsp-example

Expected behaviour

Successful build ;-).

Environment

  • Falco version: tested against libs a03ccfd
  • System info: (I don't have falco installed)
  • Cloud provider or hardware configuration: amd64
  • OS: Gentoo Linux
  • Kernel: 5.14.11-gentoo-dist
  • Installation method: from git checkout, also reproduced with sysdig 0.27.1

Additional context

grpc seems to include both pkg-config and cmake files. The pkg-config file seems to correctly list all needed libraries, find_package() would probably also work correctly.

@mgorny mgorny added the kind/bug Something isn't working label Oct 16, 2021
@FedeDP
Copy link
Contributor

FedeDP commented Nov 19, 2021

Hi! Can confirm the issue!
As you outlined, problem is we are not correctly linking all grpc deps libraries; i will have a look at it, as i'm looking forward to build Falco with local deps myself too ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
2 participants