<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Carlo Kok via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mi., 2. Sep. 2020, 11:09:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><div><div>Seems I had to use ffi.manager.pas too. However when building then it fails with;<br></div><div><br></div><div>Undefined symbols for architecture arm64:<br></div><pre><div> "_ffi_call", referenced from:<br></div><div> _FFI.MANAGER_$$_FFIINVOKE$crc7AE31AA0 in ffi.manager.o<br></div><div> "_ffi_closure_alloc", referenced from:<br></div><div> _FFI.MANAGER$_$TFFIFUNCTIONCALLBACK_$__$$_CREATE$crc5C7D27E4 in ffi.manager.o<br></div><div> "_ffi_closure_free", referenced from:<br></div><div> _FFI.MANAGER$_$TFFIFUNCTIONCALLBACK_$__$$_DESTROY in ffi.manager.o<br></div><div> "_ffi_prep_cif", referenced from:<br></div><div> _FFI.MANAGER_$$_CREATECIF$crcD3E75E66 in ffi.manager.o<br></div><div> "_ffi_prep_closure_loc", referenced from:<br></div><div> _FFI.MANAGER$_$TFFIFUNCTIONCALLBACK_$__$$_CREATE$crc5C7D27E4 in ffi.manager.o<br></div><div> "_ffi_type_double", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_float", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_pointer", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_sint16", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_sint32", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_sint64", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_sint8", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_uint16", referenced from:<br></div><div> _FFI.MANAGER_$$_RECORDOROBJECTTOFFITYPE$PTYPEINFO$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_SETTOFFITYPE$INT64$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_uint32", referenced from:<br></div><div> _FFI.MANAGER_$$_RECORDOROBJECTTOFFITYPE$PTYPEINFO$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_SETTOFFITYPE$INT64$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_uint64", referenced from:<br></div><div> _FFI.MANAGER_$$_RECORDOROBJECTTOFFITYPE$PTYPEINFO$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_SETTOFFITYPE$INT64$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_uint8", referenced from:<br></div><div> _FFI.MANAGER_$$_RECORDOROBJECTTOFFITYPE$PTYPEINFO$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_SETTOFFITYPE$INT64$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> "_ffi_type_void", referenced from:<br></div><div> _FFI.MANAGER_$$_TYPEINFOTOFFITYPE$PTYPEINFO$TPARAMFLAGS$$PFFI_TYPE in ffi.manager.o<br></div><div> _FFI.MANAGER_$$_CREATECIF$crcD3E75E66 in ffi.manager.o<br></div><div>ld: symbol(s) not found for architecture arm64<br></div></pre><div><br></div><div>Is there something else I need to do to allow FFI to work on arm64? (Does this depend on a dylib? or a static library?, and do I need to explicitly reference that?)</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You need the libffi library compiled for macOS on ARM ( <a href="https://github.com/libffi/libffi">https://github.com/libffi/libffi</a> ) and then you might need to add a "{$linklibrary ffi}" or so, cause the ffi unit was not set tested on macOS. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>