Question

I tried installing Pygame version 1.9.1release for PyPy on my Mac OSX Lion. I ran pypy config.py first with pypy setup.py install. I added the config to the installation process since I saw that it was trying to configure with normal python (which installs correctly, but causes import errors). Durring the installation process, there are many warnings such as:

src/overlay.c:44:5: warning: implicit declaration of function 'PyObject_Free' is invalid in C99 [-Wimplicit-function-declaration]
PyObject_Free ((PyObject*)self);
^

But it also provided me with 2 similar errors:

    In file included from src/scale_mmx.c:33:
src/scale_mmx64.c:424:27: error: invalid instruction mnemonic 'movsxl'
        asm __volatile__( " /* MMX code for inner loop of X bilinear filter */ "
                          ^
<inline asm>:1:191: note: instantiated into assembly here
         /* MMX code for inner loop of X bilinear filter */  movl             -36(%rbp),      %ecx;            pxor          %mm0,      %mm0;           1:                                           movsxl         (%rdi), ...
                                                                                                                                                                                                     ^~~~~~
In file included from src/scale_mmx.c:33:
src/scale_mmx64.c:499:27: error: invalid instruction mnemonic 'movsxl'
        asm __volatile__( " /* MMX code for inner loop of X bilinear filter */ "
                          ^
<inline asm>:1:191: note: instantiated into assembly here
         /* MMX code for inner loop of X bilinear filter */  movl             -36(%rbp),      %ecx;            pxor          %mm0,      %mm0;           1:                                           movsxl         (%rdi), ...
                                                                                                                                                                                                     ^~~~~~
2 errors generated.

It seems rather silly to me that PyPy got stuck at a line that generates what seems to be a block comment in C. And why its encapsulated the comment in asm and volatile is beyond me. But this is the code that was provided to me and works in regular python. So is this a bug? Or am I missing something?

Was it helpful?

Solution

Chances are PyPy has some #defines different than CPython (for good or bad reasons) and pygame chooses to use something else (based on a badly thought out #else with implicit assumptions) that tries to compile invalid C. I'm just guessing though, you would need to follow why and how the same code is/is not compiled on CPython.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top