Embedding the absolute path for shared libraries

Using a provider that provides cross-compilation of the toolchain (apparently a derivative of OpenEmbedded), I cannot insert the absolute path into third-party (open source compiled in home) libraries. In the following gcc command line:

arm-linux-gcc test_connect_send.o gprs_connect.o \
    /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libgprs_stuff.so \
    /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libpower_supply_stuff.so \
    /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libgsm_stuff.so \
    /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libtcp_stuff.so \
    /package/host/aspl.es/vortex-1.1.0/lib/libvortex-1.1.so \
    /package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0  -o test_connect_send

objdump says:

Dynamic Section:
  NEEDED      /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libgprs_stuff.so
  NEEDED      /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libpower_supply_stuff.so
  NEEDED      /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libgsm_stuff.so
  NEEDED      /package/host/myvendor.com/API-R-2.0.0/Release/Libraries/libtcp_stuff.so
  NEEDED      libvortex-1.1.so.0
  NEEDED      libaxl.so.0
  NEEDED      libgcc_s.so.1
  NEEDED      libc.so.6

Please note that my development libraries have a full path, but aspl does not. Also note how the embedded name differs from the name specified on the command line. I would like to know why (who is messing with my ways) and how to solve it.

ps: I know about RPATH, this is not the answer I'm looking for

+3
source share
3 answers

, , , SONAME .

+1

arm-linux-gcc -print-file-name :

arm-linux-gcc -print-file- name=/package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0.0.0 /package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0.0.0 arm-linux-gcc -print-file- name=/package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0.0 /package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0.0 arm-linux-gcc -print-file- name=/package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0 /package/host/aspl.es/axl-0.5.6/lib/libaxl.so.0 arm-linux-gcc -print-file- name=/package/host/aspl.es/axl-0.5.6/lib/libaxl.so /package/host/aspl.es/axl-0.5.6/lib/libaxl.so

LD_LIBRARY_PATH DT_RPATH ( , ?)

/etc/ld.so.conf, , .

, , :

distclean; LDFLAGS = -L/package/host/myvendor.com/arm9-linux-toolchain-2.1/prefix/arm-linux/lib CC =/package/host/myvendor.com/arm9-linux-toolchain-2.1/prefix/bin/arm-linux-gcc ~/wd/sources/contrib/axl/configure --prefix =/shared/syst/arm9-linux-abtrack/package/host/aspl.es/axl-0.5.6 -host = armv4tl --linux-gnu -disable-axl-knife -disable-axl-babel -disable-axl-log -disable-axl-test && &

distclean; AXL_LIBS = "- L/shared/syst/arm9-linux-abtrack/package/host/aspl.es/axl-0.5.6/lib/-laxl -lm" AXL_CFLAGS = -I/shared/syst/arm9-linux- abtrack/package/host/aspl.es/axl-0.5.6/include/axl CC =/package/host/myvendor.com/arm9-linux-toolchain-2.1/prefix/bin/arm-linux-gcc LDFLAGS = "-L/package/host/myvendor.com/arm9-linux-toolchain-2.1/prefix/arm-linux/lib" ~/wd/sources/contrib/vortex/configure --prefix =/shared/syst/arm9-linux -abtrack/package/host/aspl.es/vortex-1.1.0 --disable-http-support --disable-pull-support --disable-tunnel-support --disable-xml-rpc-support-gen - disable-xml-rpc-support --disable-sasl-support --disable-vortex-log --disable-vortex-client --host = armv4tl-unknown-linux-gnu && & && & &&

autofoo --prefix ?

0

, , .

, , , aspl, aspl- -? , , /package/host/aspl.es/vortex-1.1.0/lib/libvortex-1.1.so, , libvortex-1.1.so.0 ( no full pathname).

, , , .

0

Source: https://habr.com/ru/post/1712551/


All Articles