我已经从OpenSSL wiki跟踪FIPS Library and Android来构建FIPS对象模块。在为ARM和x86架构创建libcrypto.a
之后,我在项目的jni / include文件夹中包含了libcrypto.a
,然后执行了NDK构建。
我每次都会收到以下错误。无法解决问题。谁能告诉我哪里出错了。
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(fipscanister.o):fips_canister.c:function fips_openssl_cpuid_setup: error: undefined reference to 'sigfillset'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(fipscanister.o):fips_canister.c:function fips_openssl_cpuid_setup: error: undefined reference to 'sigdelset'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(fipscanister.o):fips_canister.c:function fips_openssl_cpuid_setup: error: undefined reference to 'sigdelset'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(fipscanister.o):fips_canister.c:function fips_openssl_cpuid_setup: error: undefined reference to 'sigdelset'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(fipscanister.o):fips_canister.c:function fips_openssl_cpuid_setup: error: undefined reference to 'sigdelset'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'signal'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
5.45/OpenSSL/jni/include/armeabi/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'tcgetattr'
collect2: error: ld returned 1 exit status
make: *** [5.45/OpenSSL/obj/local/armeabi/libmaascrypto.so] Error 1
这是我的NDK_application / jni文件夹中的Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := crypto
LOCAL_SRC_FILES := include/$(TARGET_ARCH_ABI)/libcrypto.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := XYZcrypto
LOCAL_SRC_FILES := XYZcbcEncryption.cpp XYZEcbEncryption.cpp XYZSHA256.c
LOCAL_SHARED_LIBRARIES := crypto
include $(BUILD_SHARED_LIBRARY)