我能够将其归结为缺少的依赖项。
下面,在构建共享对象时,我曾经--sysroot
包含头文件和库路径。我libstlport_shared.so
也在$(LDLIBS)
. 但是,构建共享对象的命令不包括$(LDFLAGS)
and $(LDLIBS)
(其他人编写了 makefile)。
Readelf 显示它丢失了:
$ arm-linux-androideabi-readelf -d libcryptopp.so
Dynamic section at offset 0x34472c contains 26 entries:
Tag Type Name/Value
0x00000003 (PLTGOT) 0x346e30
0x00000002 (PLTRELSZ) 904 (bytes)
...
0x00000001 (NEEDED) Shared library: [libstdc++.so]
0x00000001 (NEEDED) Shared library: [libm.so]
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libdl.so]
...
$ make static dynamic
arm-linux-androideabi-g++ -DNDEBUG -g2 -Os -pipe -fPIC -DCRYPTOPP_DISABLE_ASM
--sysroot=/opt/android-ndk-r9/platforms/android-14/arch-arm
-I/opt/android-ndk-r9/sources/cxx-stl/stlport/stlport/ -c 3way.cpp
arm-linux-androideabi-g++ -DNDEBUG -g2 -Os -pipe -fPIC -DCRYPTOPP_DISABLE_ASM
--sysroot=/opt/android-ndk-r9/platforms/android-14/arch-arm
-I/opt/android-ndk-r9/sources/cxx-stl/stlport/stlport/ -c adler32.cpp
arm-linux-androideabi-g++ -DNDEBUG -g2 -Os -pipe -fPIC -DCRYPTOPP_DISABLE_ASM
--sysroot=/opt/android-ndk-r9/platforms/android-14/arch-arm
-I/opt/android-ndk-r9/sources/cxx-stl/stlport/stlport/ -c algebra.cpp
...
arm-linux-androideabi-g++ -DNDEBUG -g2 -Os -pipe -fPIC -DCRYPTOPP_DISABLE_ASM
--sysroot=/opt/android-ndk-r9/platforms/android-14/arch-arm
-I/opt/android-ndk-r9/sources/cxx-stl/stlport/stlport/ -shared -o libcryptopp.so
3way.o adler32.o algebra.o algparam.o arc4.o asn.o authenc.o base32.o base64.o
... wait.o wake.o whrlpool.o xtr.o xtrcrypt.o zdeflate.o zinflate.o zlib.o
...