依赖都已经顺利按照文档安装,make编译阶段报错。
报错如下:
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/libcrypto.a(chacha-armv8.o): relocation R_AARCH64_PREL64 against symbol OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(chacha-armv8.o):(.text+0x20): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): relocation R_AARCH64_ADR_PREL_LO21 against symbol
poly1305_blocks’ which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): in function poly1305_init': (.text+0x40): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): relocation R_AARCH64_ADR_PREL_LO21 against symbol
poly1305_emit’ which may bind externally can not be used when making a shared object; recompile with -fPIC
(.text+0x48): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): relocation R_AARCH64_PREL64 against symbol OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(poly1305-armv8.o): in function
poly1305_emit_neon’:
(.text+0x9a0): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): in function
sha1_block_armv8’:
(.text+0x1240): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/libcrypto.a(sha256-armv8.o): relocation R_AARCH64_PREL64 against symbol OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(sha256-armv8.o): in function
sha256_block_data_order’:
(.text+0xf88): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libcrypto.a(sha512-armv8.o): in function
sha512_block_data_order’:
(.text+0x1108): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/neuron-base.dir/build.make:714: libneuron-base.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:311: CMakeFiles/neuron-base.dir/all] Error 2
查资料好像是链接出了问题,但在CMakeLists.txt加了add_compile_options(-fPIC)也不行。