It looks like you're linking against the system OpenSSL (which is libreSSL) and doesn't include the OpenSSL 1.1 functions needed.
We build OpenSSL 1.1.1 from source and then link it directly in our xcode project which builds libssh2. So it is possible, just tricky.
Will
> On May 13, 2019, at 6:11 AM, "rollastre_at_gmail.com" <rollastre_at_gmail.com> wrote:
>
> Hi list.
>
> I have managed to build libssh2 in a variety of environments (android clang, linux gcc, windows mvc, macos clang) and I am completely unable to build it for iOS 12.2 (didn't try to do it in an older version) with the specs of the subject (OpenSSL 1.1.1a or 1.1.1b, XCode 10.2.
>
> I doesn't matter what I try. Building it manually, using this iSSH2 script (https://github.com/Frugghi/iSSH2), etc. It always fails. From syntax errors like the following
>
>
> CompileC build/src/libssh2.build/Release-iphoneos/libssh2.build/Objects-normal/armv7/agent.o src/agent.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler
> cd /tmp/libssh2-1.8.0
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch armv7 -fmessage-length=181 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Release-iphoneos\" -DLIBSSH2_OPENSSL -DLIBSSH2_DH_GEX_NEW=1 -DLIBSSH2_CLEAR_MEMORY -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -fstrict-aliasing -Wdeprecated-declarations -miphoneos-version-min=10.0 -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -fembed-bitcode-marker -I/tmp/libssh2-1.8.0/build/src/Release-iphoneos/include -I/Users/jaume/Documents/dev/openssl-build-xcrun-ios/include -I/tmp/libssh2-1.8.0/include -I/tmp/libssh2-1.8.0/build/src -I/tmp/libssh2-1.8.0/build/src/libssh2.build/Release-iphoneos/libssh2.build/DerivedSources-normal/armv7 -I/tmp/libssh2-1.8.0/build/src/libssh2.build/Release-iphoneos/libssh2.build/DerivedSources/armv7 -I/tmp/libssh2-1.8.0/build/src/libssh2.build/Release-iphoneos/libssh2.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/tmp/libssh2-1.8.0/build/src/Release-iphoneos -DNDEBUG -std=gnu90 -MMD -MT dependencies -MF /tmp/libssh2-1.8.0/build/src/libssh2.build/Release-iphoneos/libssh2.build/Objects-normal/armv7/agent.d --serialize-diagnostics /tmp/libssh2-1.8.0/build/src/libssh2.build/Release-iphoneos/libssh2.build/Objects-normal/armv7/agent.dia -c /tmp/libssh2-1.8.0/src/agent.c -o /tmp/libssh2-1.8.0/build/src/libssh2.build/Release-iphoneos/libssh2.build/Objects-normal/armv7/agent.o
> In file included from /tmp/libssh2-1.8.0/src/agent.c:40:
> In file included from /tmp/libssh2-1.8.0/src/libssh2_priv.h:44:
> /tmp/libssh2-1.8.0/build/src/libssh2_config.h:91:12: error: expected parameter declarator
> static int snprintf(char * cp, int cp_max_len, const char * fmt, ...)
> ^
>
> or mismatch of BITCODE being used in libssh2 and not in openssl
>
> to link error (which is the closest I get to get it built) like this
>
> [100%] Linking C shared library ../../lib/libssh2.dylib
> 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
>
> which normally means that the dependency (openssl) wasn't build for armv7, but
>
> $ lipo -info libcrypto.a
> Architectures in the fat file: libcrypto.a are: armv7 armv7s x86_64 arm64
> $ lipo -info libssl.a
> Architectures in the fat file: libssl.a are: armv7 armv7s x86_64 arm64
>
> so, not the case either.
>
> I ran out of ideas and I wonder if it is just not possible to do what I am trying to.
>
> Anybody knows if it is possible and can enlighten me, please?
> Thanks in advance.
>
> _______________________________________________
> libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2019-05-13