On Tue, May 11, 2010 at 14:08, Shadrin Eugene <shad...@yandex-team.ru> wrote: > Hi! > > I tryed to build pypy on the freebsd, 64bit platform, but failed. > > First of all I downloaded a 32bit-Python to run pypy. > And then: > > [u...@server_name ~/pypy-trunk/pypy/translator/goal]$ ~/py32/bin/python > translate.py -Ojit > [translation:info] Translating target as defined by targetpypystandalone > [platform:execute] gcc -m32 -c -O3 -pthread -fomit-frame-pointer > /var/tmp/usession-trunk-22/gcctest.c -o /var/tmp/usession-trunk-22/gcctest.o > [platform:WARNING] /var/tmp/usession-trunk-22/gcctest.c:28:2: warning: no > newline at end of file > [platform:execute] gcc -m32 /var/tmp/usession-trunk-22/gcctest.o -L/lib32 > -L/usr/lib32 -L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32 -pthread > -o /var/tmp/usession-trunk-22/gcctest > printf("sizeof short=%ld\n", (long)sizeof(short)); > printf("sizeof unsigned short=%ld\n", (long)sizeof(unsigned short)); > printf("sizeof int=%ld\n", (long)sizeof(int)); > printf("sizeof unsigned int=%ld\n", (long)sizeof(unsigned int)); > printf("sizeof long=%ld\n", (long)sizeof(long)); > printf("sizeof unsigned long=%ld\n", (long)sizeof(unsigned long)); > printf("sizeof signed char=%ld\n", (long)sizeof(signed char)); > printf("sizeof unsigned char=%ld\n", (long)sizeof(unsigned char)); > printf("sizeof long long=%ld\n", (long)sizeof(long long)); > printf("sizeof unsigned long long=%ld\n", (long)sizeof(unsigned long > long)); > printf("sizeof size_t=%ld\n", (long)sizeof(size_t)); > printf("sizeof time_t=%ld\n", (long)sizeof(time_t)); > printf("sizeof wchar_t=%ld\n", (long)sizeof(wchar_t)); > printf("sizeof mode_t=%ld\n", (long)sizeof(mode_t)); > printf("sizeof pid_t=%ld\n", (long)sizeof(pid_t)); > sizeof short=2 > sizeof unsigned short=2 > sizeof int=4 > sizeof unsigned int=4 > sizeof long=8 > sizeof unsigned long=8 > sizeof signed char=1 > sizeof unsigned char=1 > sizeof long long=8 > sizeof unsigned long long=8 > sizeof size_t=8 > sizeof time_t=8 > sizeof wchar_t=4 > sizeof mode_t=2 > sizeof pid_t=4 > > Traceback (most recent call last): > File "translate.py", line 300, in <module> > main() > File "translate.py", line 205, in main > targetspec_dic, translateconfig, config, args = > parse_options_and_load_target() > File "translate.py", line 153, in parse_options_and_load_target > targetspec_dic = load_target(targetspec) > File "translate.py", line 105, in load_target > mod = __import__(specname) > File "targetpypystandalone.py", line 5, in <module> > from pypy.objspace.std.objspace import StdObjSpace > File "/place/home/hitrobot/pypy-trunk/pypy/objspace/std/__init__.py", line > 1, in <module> > from pypy.objspace.std.objspace import StdObjSpace > File "/place/home/hitrobot/pypy-trunk/pypy/objspace/std/objspace.py", line > 3, in <module> > from pypy.interpreter import pyframe, function, special > File "/place/home/hitrobot/pypy-trunk/pypy/interpreter/pyframe.py", line > 13, in <module> > from pypy.rlib import jit, rstack > File "/place/home/hitrobot/pypy-trunk/pypy/rlib/rstack.py", line 10, in > <module> > from pypy.rpython.lltypesystem import rffi, lltype > File "/place/home/hitrobot/pypy-trunk/pypy/rpython/lltypesystem/rffi.py", > line 824, in <module> > sys.maxint, sizeof(lltype.Signed))) > AssertionError: Mixed configuration of the word size of the machine: > the underlying Python was compiled with maxint=2147483647, > but the C compiler says that 'long' is 8 bytes > > > I got this error, then I added "-m32" flag to gcc argument list (in the > posix.py source file) , but error occured again :(
Your fix was reasonably correct, and the printed command line shows an -m32 flag passed to gcc, however the subsequent program listing still says that sizeof(long) is 8 bytes. I'm assuming that the program getting executed is the one compiled there (gcctest), can you please verify? I just double-checked that this result is unreasonable here on Linux 64bit (Ubuntu Karmic 9.10): $ cat sizeof-long.c #include <stdio.h> int main(void) { printf("sizeof(long): %zd\n", sizeof(long)); return 0; } $ gcc -m32 sizeof-long.c -o sizeof-long $ ./sizeof-long sizeof(long): 4 That's what you need to get (i.e. sizeof(long) == 4 rather than 8). Once you get it, you can fix the above error. I rechecked the above messages, there's nothing strange. Maybe you have some gcc wrapper silently forcing -m64 on the cmd line? > Does anybody tryed to build pypy-c on the 64bit FreeBsd? I didn't myself. -- Paolo Giarrusso _______________________________________________ pypy-...@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev