Dynamic VS Static linking

55 views
Skip to first unread message

saif kandil

unread,
Aug 7, 2024, 8:19:48 AMAug 7
to Protocol Buffers
Hello folks,

I created this simple solution to try to link absl, protobuf, and grpc together to see if they work without problems, and I have figured out that static linking is working perfect however the dynamic linking is not:


The error exists in the job file but here is a version of it:

```
[ 53%] Linking CXX shared library libprotobuf.so
/usr/bin/ld: /home/runner/work/absl-proto-grpc-ci/absl-proto-grpc-ci/absl-k0t0z-lib/lib/libabsl_log_internal_log_sink_set.a(log_sink_set.cc.o): relocation R_X86_64_TPOFF32 against `_ZZN4absl12lts_2024072212log_internal12_GLOBAL__N_121ThreadIsLoggingStatusEvE17thread_is_logging' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libprotobuf.dir/build.make:1389: libprotobuf.so.28.0.1] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/libprotobuf.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
```

Can anyone please explain it to me? Why this happened? I built absl from scratch.

saif kandil

unread,
Aug 7, 2024, 8:24:01 AMAug 7
to Protocol Buffers
Reply all
Reply to author
Forward
0 new messages