Compile Erlang 24.2 for iOS on mac system
Michael S
michael_489@REDACTED
Fri Jan 14 16:01:24 CET 2022
Hey!
I applied the patch in socket_util.c, but now I am getting the following error "
Undefined symbols for architecture arm64:"_BN_CTX_free", referenced from:"
I configure the otp_build script the following ... in /ios/openssl/ is the compiled openssl version 1.1.1k for ios build.
./otp_build configure --xcomp-conf=./xcomp/erl-xcomp-arm64-ios.conf --with-ssl=/Users/michael/Entwicklung/compile/ios/openssl/
Also i compiled OpenSSL 1.1.1k for the cross build, also applied with a patch to get it compiled.
See below the whole output, any hints?
*sys/common/erl_check_io.c:1754:34:**warning:**cast to smaller integer type 'ErtsPollEvents' (aka 'unsigned int') from 'void *' [-Wvoid-pointer-to-int-cast]*
ErtsPollEvents revents = ERTS_POLL_RES_GET_EVTS(&psi->pollres[i]);
*^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
*sys/common/erl_poll.h:229:54: note:*expanded from macro 'ERTS_POLL_RES_GET_EVTS'
#define ERTS_POLL_RES_GET_EVTS(evt) ERTS_POLL_EV_N2E((ErtsPollEvents)(evt)->udata)
*~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
*sys/common/erl_poll.h:271:54: note:*expanded from macro 'ERTS_POLL_EV_N2E'
#define ERTS_POLL_EV_N2E(EV) ERTS_POLL_EV_NKP_N2E((EV))
*~~~~~~~~~~~~~~~~~~~~~~^~~~*
*sys/common/erl_poll.h:241:40: note:*expanded from macro 'ERTS_POLL_EV_NKP_N2E'
((ErtsPollEvents) ((unsigned short) (EV)))
*^~*
1 warning generated.
CCobj/aarch64-apple-ios/opt/emu/erl_mseg.o
CCobj/aarch64-apple-ios/opt/emu/erl_mmap.o
CCobj/aarch64-apple-ios/opt/emu/erl_osenv.o
CCobj/aarch64-apple-ios/opt/emu/erl_unix_sys_ddll.o
CCobj/aarch64-apple-ios/opt/emu/erl_mtrace_sys_wrap.o
CCobj/aarch64-apple-ios/opt/emu/erl_sys_common_misc.o
CCobj/aarch64-apple-ios/opt/emu/erl_os_monotonic_time_extender.o
CCobj/aarch64-apple-ios/opt/emu/erlang_lttng.o
CCobj/aarch64-apple-ios/opt/emu/inet_drv.o
CCobj/aarch64-apple-ios/opt/emu/ram_file_drv.o
CCobj/aarch64-apple-ios/opt/emu/ttsl_drv.o
CCobj/aarch64-apple-ios/opt/emu/erl_tracer_nif.o
CCobj/aarch64-apple-ios/opt/emu/prim_buffer_nif.o
CCobj/aarch64-apple-ios/opt/emu/prim_file_nif.o
CCobj/aarch64-apple-ios/opt/emu/zlib_nif.o
CCobj/aarch64-apple-ios/opt/emu/prim_socket_nif.o
CCobj/aarch64-apple-ios/opt/emu/prim_net_nif.o
LD/Users/michael/Entwicklung/compile/ios/otp/bin/aarch64-apple-ios/beam.emu
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version ios 15.0.0 15.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -o /Users/michael/Entwicklung/compile/ios/otp/bin/aarch64-apple-ios/beam.emu -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/lib/ -L../lib/internal/aarch64-apple-ios -lc++ obj/aarch64-apple-ios/opt/emu/erl_main.o obj/aarch64-apple-ios/opt/emu/preload.o obj/aarch64-apple-ios/opt/emu/erl_process.o obj/aarch64-apple-ios/opt/emu/beam_emu.o obj/aarch64-apple-ios/opt/emu/emu_load.o obj/aarch64-apple-ios/opt/emu/beam_common.o obj/aarch64-apple-ios/opt/emu/beam_bif_load.o obj/aarch64-apple-ios/opt/emu/beam_bp.o
obj/aarch64-apple-ios/opt/emu/beam_catches.o obj/aarch64-apple-ios/opt/emu/beam_debug.o obj/aarch64-apple-ios/opt/emu/beam_load.o obj/aarch64-apple-ios/opt/emu/beam_opcodes.o obj/aarch64-apple-ios/opt/emu/beam_ranges.o obj/aarch64-apple-ios/opt/emu/beam_transform.o obj/aarch64-apple-ios/opt/emu/beam_transform_engine.o obj/aarch64-apple-ios/opt/emu/beam_transform_helpers.o obj/aarch64-apple-ios/opt/emu/code_ix.o obj/aarch64-apple-ios/opt/emu/erl_alloc.o obj/aarch64-apple-ios/opt/emu/erl_mtrace.o obj/aarch64-apple-ios/opt/emu/erl_alloc_util.o obj/aarch64-apple-ios/opt/emu/erl_goodfit_alloc.o obj/aarch64-apple-ios/opt/emu/erl_bestfit_alloc.o obj/aarch64-apple-ios/opt/emu/erl_afit_alloc.o obj/aarch64-apple-ios/opt/emu/erl_init.o obj/aarch64-apple-ios/opt/emu/erl_atom_table.o obj/aarch64-apple-ios/opt/emu/erl_bif_table.o obj/aarch64-apple-ios/opt/emu/erl_bif_ddll.o obj/aarch64-apple-ios/opt/emu/erl_bif_guard.o obj/aarch64-apple-ios/opt/emu/erl_bif_info.o
obj/aarch64-apple-ios/opt/emu/erl_bif_op.o obj/aarch64-apple-ios/opt/emu/erl_bif_os.o obj/aarch64-apple-ios/opt/emu/erl_bif_lists.o obj/aarch64-apple-ios/opt/emu/erl_bif_persistent.o obj/aarch64-apple-ios/opt/emu/erl_bif_atomics.o obj/aarch64-apple-ios/opt/emu/erl_bif_counters.o obj/aarch64-apple-ios/opt/emu/erl_bif_trace.o obj/aarch64-apple-ios/opt/emu/erl_bif_unique.o obj/aarch64-apple-ios/opt/emu/erl_guard_bifs.o obj/aarch64-apple-ios/opt/emu/erl_dirty_bif_wrap.o obj/aarch64-apple-ios/opt/emu/erl_trace.o obj/aarch64-apple-ios/opt/emu/copy.o obj/aarch64-apple-ios/opt/emu/utils.o obj/aarch64-apple-ios/opt/emu/bif.o obj/aarch64-apple-ios/opt/emu/io.o obj/aarch64-apple-ios/opt/emu/erl_printf_term.o obj/aarch64-apple-ios/opt/emu/erl_debug.o obj/aarch64-apple-ios/opt/emu/erl_md5.o obj/aarch64-apple-ios/opt/emu/erl_message.o obj/aarch64-apple-ios/opt/emu/erl_proc_sig_queue.o obj/aarch64-apple-ios/opt/emu/erl_process_dict.o obj/aarch64-apple-ios/opt/emu/erl_process_lock.o
obj/aarch64-apple-ios/opt/emu/erl_port_task.o obj/aarch64-apple-ios/opt/emu/erl_arith.o obj/aarch64-apple-ios/opt/emu/time.o obj/aarch64-apple-ios/opt/emu/erl_time_sup.o obj/aarch64-apple-ios/opt/emu/external.o obj/aarch64-apple-ios/opt/emu/dist.o obj/aarch64-apple-ios/opt/emu/binary.o obj/aarch64-apple-ios/opt/emu/erl_db.o obj/aarch64-apple-ios/opt/emu/erl_db_util.o obj/aarch64-apple-ios/opt/emu/erl_db_hash.o obj/aarch64-apple-ios/opt/emu/erl_db_tree.o obj/aarch64-apple-ios/opt/emu/erl_thr_progress.o obj/aarch64-apple-ios/opt/emu/big.o obj/aarch64-apple-ios/opt/emu/hash.o obj/aarch64-apple-ios/opt/emu/index.o obj/aarch64-apple-ios/opt/emu/atom.o obj/aarch64-apple-ios/opt/emu/module.o obj/aarch64-apple-ios/opt/emu/export.o obj/aarch64-apple-ios/opt/emu/register.o obj/aarch64-apple-ios/opt/emu/break.o obj/aarch64-apple-ios/opt/emu/erl_async.o obj/aarch64-apple-ios/opt/emu/erl_lock_check.o obj/aarch64-apple-ios/opt/emu/erl_dyn_lock_check.o obj/aarch64-apple-ios/opt/emu/erl_gc.o
obj/aarch64-apple-ios/opt/emu/erl_lock_count.o obj/aarch64-apple-ios/opt/emu/erl_posix_str.o obj/aarch64-apple-ios/opt/emu/erl_bits.o obj/aarch64-apple-ios/opt/emu/erl_math.o obj/aarch64-apple-ios/opt/emu/erl_fun.o obj/aarch64-apple-ios/opt/emu/erl_bif_port.o obj/aarch64-apple-ios/opt/emu/erl_term.o obj/aarch64-apple-ios/opt/emu/erl_node_tables.o obj/aarch64-apple-ios/opt/emu/erl_monitor_link.o obj/aarch64-apple-ios/opt/emu/erl_process_dump.o obj/aarch64-apple-ios/opt/emu/erl_hl_timer.o obj/aarch64-apple-ios/opt/emu/erl_cpu_topology.o obj/aarch64-apple-ios/opt/emu/erl_drv_thread.o obj/aarch64-apple-ios/opt/emu/erl_bif_chksum.o obj/aarch64-apple-ios/opt/emu/erl_bif_re.o obj/aarch64-apple-ios/opt/emu/erl_unicode.o obj/aarch64-apple-ios/opt/emu/packet_parser.o obj/aarch64-apple-ios/opt/emu/safe_hash.o obj/aarch64-apple-ios/opt/emu/erl_zlib.o obj/aarch64-apple-ios/opt/emu/erl_nif.o obj/aarch64-apple-ios/opt/emu/erl_bif_binary.o
obj/aarch64-apple-ios/opt/emu/erl_ao_firstfit_alloc.o obj/aarch64-apple-ios/opt/emu/erl_thr_queue.o obj/aarch64-apple-ios/opt/emu/erl_sched_spec_pre_alloc.o obj/aarch64-apple-ios/opt/emu/erl_ptab.o obj/aarch64-apple-ios/opt/emu/erl_map.o obj/aarch64-apple-ios/opt/emu/erl_msacc.o obj/aarch64-apple-ios/opt/emu/erl_lock_flags.o obj/aarch64-apple-ios/opt/emu/erl_io_queue.o obj/aarch64-apple-ios/opt/emu/erl_db_catree.o obj/aarch64-apple-ios/opt/emu/socket_dbg.o obj/aarch64-apple-ios/opt/emu/socket_tarray.o obj/aarch64-apple-ios/opt/emu/socket_util.o obj/aarch64-apple-ios/opt/emu/erl_flxctr.o obj/aarch64-apple-ios/opt/emu/erl_nfunc_sched.o obj/aarch64-apple-ios/opt/emu/erl_global_literals.o obj/aarch64-apple-ios/opt/emu/beam_file.o obj/aarch64-apple-ios/opt/emu/sys.o obj/aarch64-apple-ios/opt/emu/sys_drivers.o obj/aarch64-apple-ios/opt/emu/sys_env.o obj/aarch64-apple-ios/opt/emu/sys_uds.o obj/aarch64-apple-ios/opt/emu/driver_tab.o obj/aarch64-apple-ios/opt/emu/unix_prim_file.o
obj/aarch64-apple-ios/opt/emu/sys_float.o obj/aarch64-apple-ios/opt/emu/sys_time.o obj/aarch64-apple-ios/opt/emu/sys_signal_stack.o obj/aarch64-apple-ios/opt/emu/erl_poll.o obj/aarch64-apple-ios/opt/emu/erl_check_io.o obj/aarch64-apple-ios/opt/emu/erl_mseg.o obj/aarch64-apple-ios/opt/emu/erl_mmap.o obj/aarch64-apple-ios/opt/emu/erl_osenv.o obj/aarch64-apple-ios/opt/emu/erl_unix_sys_ddll.o obj/aarch64-apple-ios/opt/emu/erl_mtrace_sys_wrap.o obj/aarch64-apple-ios/opt/emu/erl_sys_common_misc.o obj/aarch64-apple-ios/opt/emu/erl_os_monotonic_time_extender.o obj/aarch64-apple-ios/opt/emu/erl_poll.flbk.o obj/aarch64-apple-ios/opt/emu/erlang_lttng.o obj/aarch64-apple-ios/opt/emu/inet_drv.o obj/aarch64-apple-ios/opt/emu/ram_file_drv.o obj/aarch64-apple-ios/opt/emu/ttsl_drv.o obj/aarch64-apple-ios/opt/emu/erl_tracer_nif.o obj/aarch64-apple-ios/opt/emu/prim_buffer_nif.o obj/aarch64-apple-ios/opt/emu/prim_file_nif.o obj/aarch64-apple-ios/opt/emu/zlib_nif.o
obj/aarch64-apple-ios/opt/emu/prim_socket_nif.o obj/aarch64-apple-ios/opt/emu/prim_net_nif.o /Users/michael/Entwicklung/compile/ios/otp/lib/asn1/priv/lib/aarch64-apple-ios/asn1rt_nif.a /Users/michael/Entwicklung/compile/ios/otp/lib/crypto/priv/lib/aarch64-apple-ios/crypto.a -lutil -ldl -lm /Users/michael/Entwicklung/compile/ios/otp/erts/emulator/zlib/obj/aarch64-apple-ios/opt/libz.a /Users/michael/Entwicklung/compile/ios/otp/erts/emulator/pcre/obj/aarch64-apple-ios/opt/libepcre.a -lethread -lerts_internal_r -lpthread -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.ios.a
Undefined symbols for architecture arm64:
"_BN_CTX_free", referenced from:
_mod_exp_nif in crypto.a(bn_static.o)
_srp_value_B_nif in crypto.a(srp_static.o)
_srp_user_secret_nif in crypto.a(srp_static.o)
_srp_host_secret_nif in crypto.a(srp_static.o)
......
"_RSA_size", referenced from:
_size_of_RSA in crypto.a(pkey_static.o)
ld: symbol(s) not found for architecture arm64
clang:*error:**linker command failed with exit code 1 (use -v to see invocation)*
make[4]: *** [/Users/michael/Entwicklung/compile/ios/otp/bin/aarch64-apple-ios/beam.emu] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [emu] Error 2
make: *** [emulator] Error 2
Am 23.12.21 um 16:14 schrieb Dominic Letz:
> That has been fixed on master https://github.com/diodechain/otp/commit/b5551600082fda193fe85f7feb5bd69bcc1f858c
>
> But that change did not make it into the OTP-24 maintenance branch it seems. So I guess you have to apply it yourself manually until there is a point release with the fix.
>
> Best
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20220114/432567f8/attachment.htm>
More information about the erlang-questions
mailing list