Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

I have a of ios compile openssl environmental issues

hi:

Compile openSSL, I encountered a troublesome problem when compile-arch i386 compiler-arch armv7 when wrong.

I encountered this problem has been for several days, and I suspect that is not different simulator sdk and iphone sdk or my sdk missing file.

os x 10.8.2 xcode 4.6.1 iphone sdk 6.1.

openssl the makefile:

VERSION=1.0.0e
MAJOR=1
MINOR=0.0
SHLIB_VERSION_NUMBER=1.0.0
SHLIB_VERSION_HISTORY=
SHLIB_MAJOR=1
SHLIB_MINOR=0.0
SHLIB_EXT=.$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
PLATFORM=darwin-armv7-cc
OPTIONS= no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-shared no-store no-zlib no-zlib-dynamic static-engine
CONFIGURE_ARGS=darwin-armv7-cc
SHLIB_TARGET=darwin-shared
HERE=.
INSTALL_PREFIX=
INSTALLTOP=/usr/local/ssl
OPENSSLDIR=/usr/local/ssl

CC= /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develope r/usr/bin/gcc
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develope r/SDKs/iPhoneOS6.1.sdk -O3 -fomit-frame-pointer -DL_ENDIAN
DEPFLAG= -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE
PEX_LIBS= -Wl,-search_paths_first
EX_LIBS=
EXE_EXT=
ARFLAGS=
AR= ar $(ARFLAGS) r
RANLIB= /opt/local/bin/ranlib
NM= nm
PERL= /opt/local/bin/perl5
TAR= tar
TARFLAGS= --no-recursion
MAKEDEPPROG=makedepend
LIBDIR=lib

......

The Log:

Undefined symbols for architecture armv7:

"_accept$UNIX2003", referenced from:

_do_server in s_socket.o

_BIO_accept in libcrypto.a(b_sock.o)

"_bind$UNIX2003", referenced from:

_do_server in s_socket.o

_BIO_get_accept_socket in libcrypto.a(b_sock.o)

"_chmod$UNIX2003", referenced from:

_RAND_write_file in libcrypto.a(randfile.o)

"_close$UNIX2003", referenced from:

_sv_body in s_server.o

_s_client_main in s_client.o

_speed_main in speed.o

_s_time_main in s_time.o

_init_client in s_socket.o

_do_server in s_socket.o

_acpt_ctrl in libcrypto.a(bss_acpt.o)

...

"_closedir$UNIX2003", referenced from:

_OPENSSL_DIR_end in libcrypto.a(o_dir.o)

"_connect$UNIX2003", referenced from:

_init_client in s_socket.o

_conn_state in libcrypto.a(bss_conn.o)

_BIO_get_accept_socket in libcrypto.a(b_sock.o)

_RAND_query_egd_bytes in libcrypto.a(rand_egd.o)

"_fdopen$UNIX2003", referenced from:

_speed_main in speed.o

"_fopen$UNIX2003", referenced from:

_enc_main in enc.o

_BIO_new_file in libcrypto.a(bss_file.o)

_file_ctrl in libcrypto.a(bss_file.o)

_RAND_load_file in libcrypto.a(randfile.o)

_RAND_write_file in libcrypto.a(randfile.o)

_open_console in libcrypto.a(ui_openssl.o)

"_fputs$UNIX2003", referenced from:

_main in openssl.o

_BIO_debug_callback in libcrypto.a(bio_cb.o)

_write_string in libcrypto.a(ui_openssl.o)

_read_string in libcrypto.a(ui_openssl.o)

"_fstat$INODE64", referenced from:

_RAND_poll in libcrypto.a(rand_unix.o)

"_fwrite$UNIX2003", referenced from:

_check in verify.o

_req_main in req.o

_dsa_main in dsa.o

_speed_main in speed.o

_s_time_main in s_time.o

_load_index in apps.o

_write_fp in libcrypto.a(b_dump.o)

...


Can you help me solve it, thank you very much~!

Online waiting~~~

iPad 2, iOS 6.1.3

Posted on Apr 11, 2013 8:00 PM

Reply
4 replies

Apr 12, 2013 4:52 AM in response to YiFeng.Liu

You're looking for assistance with porting OpenSSL to iOS? While it would be more typical to use iOS core frameworks such as CFNetworkor other higher-level frameworks such as AFNetwork, there are other OpenSSL-based alternatives and ports for iOS, if you really want or need your own copy.


I just ended up writing a "framework" for OpenSSL for another platform. That was "fun". But I digress.


Quoting from the Apple documentation: "Although OpenSSL is commonly used in the open source community, OpenSSL does not provide a stable API from version to version. For this reason, although OS X provides OpenSSL libraries, the OpenSSL libraries in OS X are deprecated, and OpenSSL has never been provided as part of iOS. Use of the OS X OpenSSL libraries by apps is strongly discouraged."


Accordingly, I'd generally recommend against having your own embedded SSL/TLS security code as that means full ownership of security updates and security fixes and API changes and the rest, but if you do really need to have OpenSSL around, then you're going to get to build your own dynamic library containing OpenSSL, as was described in the links above.


For more information on what's happening with OpenSSL, SSL/TLS, CDSA and other such within iOS and OS X, there are some WWDC sessions that will definitely be of interest. Given the (programming) choice here, I'd probably go with AFNetwork or CFNetwork, or with Common Crypto or such. Not with OpenSSL.


For the best and fastest answers to these sorts of questions, I'd also suggest posting to the Apple developer forums, rather than here in the consumer forums. For instance, see this thread...

Apr 13, 2013 2:45 AM in response to MrHoffman

Thank you to help.
I'm Sorry help here, I may be the less experienced, I found that this is a compiler problem.

I added CFLAG-lsystem_network, error message changed

"Ld: cannot link directly with / Applications / Xcode.app / Contents / Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/sy stem/libsystem_network.dylib. Link against the umbrella framework 'System.framework' instead. for architecture armv7 ".

My idea is that correct? The next step is how to solve.
Very much looking forward to your reply ~!

Apr 14, 2013 9:43 AM in response to MrHoffman

hi,MrHoffman.

it seems not, if I do not have it, you are prompted:

Undefined symbols for architecture armv7:

"_accept $ UNIX2003", referenced from:

_do_server in s_socket.o

_BIO_accept In libcrypto.a (b_sock.o)

"_bind $ UNIX2003", referenced from:

_do_server in s_socket.o

_BIO_get_accept_socket In libcrypto.a (b_sock.o)

"_chmod $ UNIX2003", referenced from:

_RAND_write_file In libcrypto.a (randfile.o). . . .

These are obviously part of the socket interface, why specify the isysyroot also suggest not find it, I manually add CFLAG -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develo per/SDKs/iPhoneOS6 .1.sdk/usr/lib/system-lsystem_network Tip:

"Ld: cannot link directly with / Applications / Xcode.app / Contents / Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/sy stem / libsystem_network.dylib. Link against the umbrella framework 'System.framework' instead. for architecture armv7 ".

This is simply around me dizzy.

In addition, I use Xcode IDE Link Binary With Libraries "plus libsystem_network.dylib on given Tips and like this.

In the end is what went wrong, there are any good suggestions?

I have a of ios compile openssl environmental issues

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.