Djoga'Ro
moonstruck
- Joined
- Apr 3, 2016
- Messages
- 2,490
(my question doesn't regard any handhelds nor ARM; am I still in the correct sub-forum?)
In a project at work I want to facilitate Fast-DDS linked statically to be able to communicate with ROS2 nodes on a remote device.
To learn how to use that library properly to that effect in isolation, I made some project ddstest.
I compiled Fast-DDS and its direct dependencies with flags to make it static (all of them came with cmake stuff prepared so that's what I used for that). Some of them have still other dependencies - openssl is the one I'm aware of.
Then in Code::Blocks in the linker options for ddstest I explicitely gave those four lib*.a plus /usr/lib/librt.a.
Building on Artix, when I tried to run the fruits of my labour in Ubuntu ff on a VM, where there are also some ROS2 tutorial nodes running, I learned about there being different versions of glibc out in the wild.
So I found this: https://stackoverflow.com/a/26241702
, made such a file as
, did
before reiterating that cmake stuff, and added that include flag in my project's options. The g++-invokations C::B then comes up with look like this:
Still, there are glibc dependencies which ask for version 2.33 (I'm trying to get it down to 2.30 for now) in my binary ddstest. Like that:
I'm trying to find out, where those high version deps come in. And to narrow it down my question(s) here:
When I compile something into a static library, while not providing all of its dependencies as statics, can the result carry some dependency on certain function's versions from shared libs?
If so, how can I check? readelf or nm show me no such thing for the static libs I built (or I don't know the right buttons to push).
Or must those unwanted version deps come from the shared libs I involve in my test projest?
Or do those version choices all get decided, when I compile my stuff into a binary?
Pertinent clues would be very much appreciated.
In a project at work I want to facilitate Fast-DDS linked statically to be able to communicate with ROS2 nodes on a remote device.
To learn how to use that library properly to that effect in isolation, I made some project ddstest.
I compiled Fast-DDS and its direct dependencies with flags to make it static (all of them came with cmake stuff prepared so that's what I used for that). Some of them have still other dependencies - openssl is the one I'm aware of.
Then in Code::Blocks in the linker options for ddstest I explicitely gave those four lib*.a plus /usr/lib/librt.a.
Building on Artix, when I tried to run the fruits of my labour in Ubuntu ff on a VM, where there are also some ROS2 tutorial nodes running, I learned about there being different versions of glibc out in the wild.
So I found this: https://stackoverflow.com/a/26241702
, made such a file as
Code:
linker_symver.h,
Code:
export CFLAGS="-include ~/Documents/3rdParty/helpers/linker_symver.h"
Code:
g++ -pedantic -Wextra -Wall -std=c++17 -m64 -fexceptions -include ~/Documents/3rdParty/helpers/linker_symver.h -O2 -I../../3rdParty/Fast-DDS/install/include -I/usr/bin/include -c /mnt/int/data/micha/Documents/Projekte/ddstest/main.cpp -o obj/defaultRelease/main.o
g++ -pedantic -Wextra -Wall -std=c++17 -m64 -fexceptions -include ~/Documents/3rdParty/helpers/linker_symver.h -O2 -I../../3rdParty/Fast-DDS/install/include -I/usr/bin/include -c /mnt/int/data/micha/Documents/Projekte/ddstest/TestSubscriber.cpp -o obj/defaultRelease/TestSubscriber.o
g++ -L../../3rdParty/Fast-DDS/install/lib -o bin/defaultRelease/ddstest obj/defaultRelease/main.o obj/defaultRelease/TestSubscriber.o -m64 -Bshared /usr/lib/libpthread.so /usr/lib/libdl.so /usr/lib/libssl.so /usr/lib/libcrypto.so /usr/lib/librt.so -Bstatic -s ../../3rdParty/Fast-DDS/install/lib/libfastrtps.a ../../3rdParty/Fast-DDS/install/lib/libfastcdr.a ../../3rdParty/Fast-DDS/install/lib/libfoonathan_memory-0.6.2.a ../../3rdParty/Fast-DDS/install/lib/libtinyxml2.a
Still, there are glibc dependencies which ask for version 2.33 (I'm trying to get it down to 2.30 for now) in my binary ddstest. Like that:
Code:
> readelf -aC ./ddstest | grep GLIBC_2.33
00000067db88 017a00000001 R_X86_64_64 0000000000000000 stat64@GLIBC_2.33 + 0
00000067dba0 00ed00000001 R_X86_64_64 0000000000000000 fstat64@GLIBC_2.33 + 0
00000067ddb0 00df00000001 R_X86_64_64 0000000000000000 lstat64@GLIBC_2.33 + 0
00000067a898 013a00000007 R_X86_64_JUMP_SLO 0000000000000000 fstat@GLIBC_2.33 + 0
223: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]@GLIBC_2.33 (36)
237: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]@GLIBC_2.33 (36)
314: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fstat@GLIBC_2.33 (36)
378: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]@GLIBC_2.33 (36)
0dc: 3 (GLIBCXX_3.4) 9 (GLIBC_2.2.5) 12 (GLIBC_2.2.5) 24 (GLIBC_2.33)
0ec: 5 (GLIBCXX_3.4.21) 24 (GLIBC_2.33) 3 (GLIBCXX_3.4) 21 (GLIBC_2.3.2)
138: 9 (GLIBC_2.2.5) 21 (GLIBC_2.3.2) 24 (GLIBC_2.33) c (CXXABI_1.3)
178: 3 (GLIBCXX_3.4) c (CXXABI_1.3) 24 (GLIBC_2.33) 5 (GLIBCXX_3.4.21)
0x0080: Name: GLIBC_2.33 Flags: none Version: 36
When I compile something into a static library, while not providing all of its dependencies as statics, can the result carry some dependency on certain function's versions from shared libs?
If so, how can I check? readelf or nm show me no such thing for the static libs I built (or I don't know the right buttons to push).
Or must those unwanted version deps come from the shared libs I involve in my test projest?
Or do those version choices all get decided, when I compile my stuff into a binary?
Pertinent clues would be very much appreciated.