Problems building for IOS and linking to libssh2

rollastre at gmail.com rollastre at gmail.com
Wed May 8 22:10:48 UTC 2019


Hello.

I have built libssh2 with openssl in windows (MVC 2017), linux (GCC >6), 
mac (clang 8 - 10), android (NDK19 / API 21-24 / clang) successfully. 
Now I am stuck trying to build it for iOS. The error I get is about an 
undefined symbol as folows

ld: warning: -headerpad_max_install_names is ignored when used with 
-bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
undefined symbols for architecture armv7:
     "_ENGINE_load_builtin_engines", referenced from:
         _libssh2_init in global.c.o
         __libssh2_init_if_needed in global.c.o
     "_ENGINE_register_all_complete", referenced from:
         _libssh2_init in global.c.o
         __libssh2_init_if_needed in global.c.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

 From what I understand, the problem is that the static lib is not 
including a symbol?

I am using XCode 10.2.1 and the command I used to build OpenSSL is

./Configure iphoneos-cross 
-lsysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk 
-mios-version-min=10.0 -fembed-bitcode -O3 
--sysroot=/Application/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk 
-fPIC --with-zlib-include=/Users/roll/sdks/zlib/include 
--with-zlib-lib=/Users/roll/sdks/zlib/lib

the build process ends without error and a libcrypto.a and libssl.a 
files are created.

Can anybody point me what am I doing wrong or misunderstanding?

Thanks in advance.



More information about the openssl-users mailing list