[pypy-dev] Pypy translation fails on MIPS (without JIT)

Alexis BRENON abrenon at wyplay.com
Thu Jul 4 09:48:44 CEST 2013


Le 04/07/2013 08:44, Armin Rigo a écrit :
> Hi Alexis,
>
> On Wed, Jul 3, 2013 at 4:04 PM, Alexis BRENON <abrenon at wyplay.com> wrote:
>> Is anyone got any idea where I can search to debug this ?
> Check first that compiling programs works at all.  Then, still with a
> 5-lines example .c, try to add options to gcc one at a time until you
> reach a very similar command-line to the one in the generated
> Makefile.  I bet it crashes at some point.
>
>
> A bientôt,
>
> Armin.
Thanks Armin for you advice and I find where it crashes. When linking, 
there is this option:

--version-script=../dynamic-symbols-1

I read this file and remembered that I already see a similar one when I 
was searching on Google.
First this file looks like this :

{
         global:
                 rpython_startup_code;
                 get_errno;
                 set_errno;
         local:
                 *;
};

Adding the failing symbol in global make it works.

{
         global:
                 rpython_startup_code;
                 get_errno;
                 set_errno;
		__data_start;
          local:
                 *;
};

Nevertheless, the resulting executable, which must display "Hello World" 
(as usual), segfault when I launch it...
 From GDB I get this, when running it with a breakpoint on main() (so it 
fails before enterring in the main) :

Program received signal SIGSEGV, Segmentation fault.
0x77fc86a4 in dl_main (phdr=<value optimized out>, phnum=<value optimized out>, user_entry=<value optimized out>, auxv=0x7fff6e44) at rtld.c:1652
1652    rtld.c: No such file or directory.
         in rtld.c
(gdb) bt
#0  0x77fc86a4 in dl_main (phdr=<value optimized out>, phnum=<value optimized out>, user_entry=<value optimized out>, auxv=0x7fff6e44) at rtld.c:1652
#1  0x77fdd560 in _dl_sysdep_start (start_argptr=<value optimized out>, dl_main=0x77fc7a84 <dl_main>) at ../elf/dl-sysdep.c:244
#2  0x77fca5c4 in _dl_start_final (arg=0x7fff6e00, info=<value optimized out>) at rtld.c:336
#3  0x77fca860 in _dl_start (arg=0x7fff6e00) at rtld.c:564
#4  0x77fc6894 in __start () from /lib/ld.so.1
Backtrace stopped: frame did not save the PC

This bug is the same as if translate my simple Rpython file with the -O2 
option. The translation success, but I get the exactly same error on the 
resulting executable... I encouter this error when I translate (with -O2 
option) the targetpypystandalone.py file too, when it tries to execute 
platcheck_0 during translation...

Maybe there is a deeper reason of all these failures. But I can't point 
out which or where... Any idea ?

Thanks,
Alexis


More information about the pypy-dev mailing list