Openssl: error: undefined reference while giving NDK build for application using openssl library

Created on 21 Apr 2016  路  3Comments  路  Source: openssl/openssl

I have followed FIPS Library and Android from the OpenSSL wiki to build the FIPS Object Module. After creating libcrypto.a for both ARM and x86 architecture, I included libcrypto.a in my project's jni/include folder, and then performed an NDK build.

I am getting the below error everytime. Not able to resolve the issue

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

My Application Directory name is OpenSSL
Here is the Android.mk inside my OpenSSL/jni folder

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)

Can any one suggest how to resolve this?

Most helpful comment

You probably chose _ANDROID_API=21 for OpenSSL, but some lesser platform for your ndk-build. See http://stackoverflow.com/questions/37122126/whats-the-exact-significance-of-android-ndk-platform-version-compared-to-api-le.

All 3 comments

I am using the below vesion of openssl and fips components
android-ndk-r11c
openssl-1.0.1r
openssl-fips-2.0.12

Also I tried with changing the fips component to openssl-fips-2.0.5 keeping the other two same. But the error I got was same.

You probably chose _ANDROID_API=21 for OpenSSL, but some lesser platform for your ndk-build. See http://stackoverflow.com/questions/37122126/whats-the-exact-significance-of-android-ndk-platform-version-compared-to-api-le.

If this is still a problem please raise it on the openssl-users email list:

https://mta.openssl.org/mailman/listinfo/openssl-users

Closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enriquejcobo picture enriquejcobo  路  3Comments

kaduk picture kaduk  路  3Comments

Legends picture Legends  路  3Comments

evqna picture evqna  路  4Comments

barbarosalp picture barbarosalp  路  4Comments