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: [user@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 :( Does anybody tryed to build pypy-c on the 64bit FreeBsd? Thank you for your answer! -- Shadrin Eugene
On Tue, May 11, 2010 at 14:08, Shadrin Eugene <shadrin@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:
[user@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
Thank you! Probably I think that I have some problems with my compiler. So that because: [user@server_name ~/test]$ gcc -m32 sizeof-long.c -o sizeof-long /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc I thought that 32 bit doesn't work because gcc doesn't look under /usr/lib32, so I added lib32 path, but I failed again: [user@server_name ~/test]$ gcc -m32 sizeof-long.c -L/lib32 -L/usr/lib32 -L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32 -pthread -fomit-frame-pointer -o sizeof-long /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crt1.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crti.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crtbegin.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crtend.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crtn.o' is incompatible with i386 output /usr/bin/ld: BFD 2.15 [FreeBSD] 2004-05-23 internal error, aborting at /usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/reloc.c line 4274 in bfd_generic_get_relocated_section_contents /usr/bin/ld: Please report this bug. Then I tryed to link the binary myself explicitly against /usr/lib32, and it works: [user@server_name ~/test]$ gcc -c -m32 -o sizeof-long.o sizeof-long.c [user@server_name ~/test]$ /usr/bin/ld --eh-frame-hdr -m elf_i386_fbsd -V -dynamic-linker /libexec/ld-elf32.so.1 -o sizeof-long /usr/lib32/crt1.o /usr/lib32/crti.o /usr/lib32/crtbegin.o -L/usr/lib32 sizeof-long.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib32/crtend.o /usr/lib32/crtn.o GNU ld version 2.15 [FreeBSD] 2004-05-23 Supported emulations: elf_i386_fbsd elf_x86_64_fbsd [user@server_name ~/test]$ file sizeof-long sizeof-long: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 7.3, dynamically linked (uses shared libs), FreeBSD-style, not stripped [user@server_name ~/test]$ ./sizeof-long *sizeof(long): 4* Now I'm thinking about how cat I patch pypy source code to compile it with described below "manual" method =) 11.05.2010 20:38, Paolo Giarrusso пишет:
On Tue, May 11, 2010 at 14:08, Shadrin Eugene<shadrin@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:
[user@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.
-- Шадрин Евгений Группа разработки активных роботов Отдел разработки Антиспама разработчик
On May 11, 2010, at 9:08 AM, Shadrin Eugene 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.
You need a 64 bit python to translate a 64bit pypy, so use a 64 bit cpython that comes with freebsd if you want to do the translation. And remember, the JIT is 32bit only for now. -- Leonardo Santagada santagada at gmail.com
On May 11, 2010, at 9:08 AM, Shadrin Eugene 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.
You need a 64 bit python to translate a 64bit pypy, so use a 64 bit cpython that comes with freebsd if you want to do the translation. And remember, the JIT is 32bit only for now. But can't one build, that way, a 32bit PyPy on a 64bit platform (to use the JIT)? I remember seeing directions to use a 32bit Python on
On Tue, May 11, 2010 at 19:31, Leonardo Santagada <santagada@gmail.com> wrote: the website. -- Paolo Giarrusso
On May 11, 2010, at 2:35 PM, Paolo Giarrusso wrote:
On May 11, 2010, at 9:08 AM, Shadrin Eugene 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.
You need a 64 bit python to translate a 64bit pypy, so use a 64 bit cpython that comes with freebsd if you want to do the translation. And remember, the JIT is 32bit only for now. But can't one build, that way, a 32bit PyPy on a 64bit platform (to use the JIT)? I remember seeing directions to use a 32bit Python on
On Tue, May 11, 2010 at 19:31, Leonardo Santagada <santagada@gmail.com> wrote: the website. -- Paolo Giarrusso
Ahh I didn't understod that the poster wanted a 32 bit pypy. If that is the case then you need to do all that is necessary to compile 32 bit binaries in your system. I don't know how that works in freebsd but it can involve having another compiler, a 32bit python, and a ton o 32bit libraries (maybe even a 32bit chroot). I found this on google but seems pretty old: http://lists.freebsd.org/pipermail/freebsd-amd64/2007-November/010466.html []'s -- Leonardo Santagada santagada at gmail.com
On Tue, May 11, 2010 at 11:35 AM, Paolo Giarrusso <p.giarrusso@gmail.com> wrote:
On May 11, 2010, at 9:08 AM, Shadrin Eugene 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.
You need a 64 bit python to translate a 64bit pypy, so use a 64 bit cpython that comes with freebsd if you want to do the translation. And remember, the JIT is 32bit only for now. But can't one build, that way, a 32bit PyPy on a 64bit platform (to use the JIT)? I remember seeing directions to use a 32bit Python on
On Tue, May 11, 2010 at 19:31, Leonardo Santagada <santagada@gmail.com> wrote: the website.
Yes, that's the way.
Hello, You can find a port at: https://github.com/DragonSA/pypy Works for me.
participants (5)
-
Bradley Saulteaux
-
Leonardo Santagada
-
Maciej Fijalkowski
-
Paolo Giarrusso
-
Shadrin Eugene