使用供应商提供的交叉编译工具链(显然是 OpenEmbedded 衍生工具),我无法嵌入第三方(开源,内部编译)库的绝对路径。使用以下 gcc 命令行:
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 说:
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
请注意我的供应商的库确实有完整的路径,而 aspl 没有。另外,请注意嵌入的名称与我在命令行中指定的名称有何不同。我想知道为什么(谁在弄乱我的路径),以及如何解决它。
ps:我知道RPATH,这不是我要找的答案