kivy/pyobjus

'objc_msgSend_stret' is unavailable: not available in arm64

rajeshmajumdar opened this issue · 5 comments

I am trying to install pyobjus in my mac running big sur. I am getting this error while installing.
Here is the error log:

Pyobjus platform is darwin
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-3.10
creating build/lib.macosx-10.9-universal2-3.10/pyobjus
copying pyobjus/dylib_manager.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus
copying pyobjus/protocols.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus
copying pyobjus/init.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus
copying pyobjus/objc_py_types.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus
creating build/lib.macosx-10.9-universal2-3.10/pyobjus/consts
copying pyobjus/consts/init.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus/consts
copying pyobjus/consts/corebluetooth.py -> build/lib.macosx-10.9-universal2-3.10/pyobjus/consts
running build_ext
cythoning pyobjus/pyobjus.pyx to pyobjus/pyobjus.c
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/kirito/Downloads/pyobjus-master/pyobjus/pyobjus.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pyobjus' extension
creating build/temp.macosx-10.9-universal2-3.10
creating build/temp.macosx-10.9-universal2-3.10/pyobjus
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c pyobjus/pyobjus.c -o build/temp.macosx-10.9-universal2-3.10/pyobjus/pyobjus.o
pyobjus/pyobjus.c:29384:18: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object *') [-Wpointer-to-int-cast]
__pyx_t_5 = ((int)(__pyx_v_f_result[0]));
^~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29410:41: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object *') [-Wpointer-to-int-cast]
__pyx_t_3 = __Pyx_PyInt_From_int(((int)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 203, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29452:45: warning: cast to smaller integer type 'char' from 'id' (aka 'struct objc_object *') [-Wpointer-to-int-cast]
__pyx_t_2 = __Pyx_PyInt_From_int(((int)((char)(__pyx_v_f_result[0])))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 204, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29488:39: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object *') [-Wpointer-to-int-cast]
__pyx_t_4 = __Pyx_PyInt_From_int(((int)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 206, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29521:41: warning: cast to smaller integer type 'short' from 'id' (aka 'struct objc_object *') [-Wpointer-to-int-cast]
__pyx_t_4 = __Pyx_PyInt_From_short(((short)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 208, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29620:49: warning: cast to smaller integer type 'unsigned char' from 'id' (aka 'struct objc_object *') [-Wpointer-to-int-cast]
__pyx_t_4 = __Pyx_PyInt_From_unsigned_char(((unsigned char)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 214, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29653:48: warning: cast to smaller integer type 'unsigned int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast]
__pyx_t_4 = __Pyx_PyInt_From_unsigned_int(((unsigned int)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 216, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:29686:50: warning: cast to smaller integer type 'unsigned short' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast]
__pyx_t_4 = __Pyx_PyInt_From_unsigned_short(((unsigned short)(__pyx_v_f_result[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 218, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:30030:19: warning: cast to smaller integer type 'int' from 'id' (aka 'struct objc_object ') [-Wpointer-to-int-cast]
__pyx_t_6 = (((int)(__pyx_v_f_result[0])) != 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
pyobjus/pyobjus.c:43690:75: error: 'objc_msgSend_stret' is unavailable: not available in arm64
ffi_call((&__pyx_v_self->f_cif), ((void (
)(void))((id (
)(id, SEL))objc_msgSend_stret)), __pyx_v_res_ptr, __pyx_v_f_args);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/message.h:123:1: note: 'objc_msgSend_stret' has been explicitly marked unavailable here
objc_msgSend_stret(void /
id self, SEL op, ... */ )
^
9 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1

misl6 commented

Hi @rajeshmajumdar,

If I'm right, you're on an M1 based device and using the latest version available on pypi.

Can you try to build the master version available here on GitHub?

Same error persists, and it's not m1 based it's intel based mac with latest version of pypi

misl6 commented

Is confirmed that while building a universal2 wheel on Intel, (that is now the default on python3.10), the reported error occurs during the arm64 crosscompilation phase.

misl6 commented

Hi,
I posted a PR that should fix the issue (#82)

Let me know if it works fine for you.

Thanks @misl6, it worked.