shecc icon indicating copy to clipboard operation
shecc copied to clipboard

Fail to self-host

Open vacantron opened this issue 11 months ago • 1 comments

The stage-1 and stage-2 ELF are not identical. Check them with the following diff command:

$ diff <(arm-linux-gnueabihf-objdump -d out/shecc-stage1.elf) <(arm-linux-gnueabihf-objdump -d out/shecc-stage2.elf)

output:

35856,35861c35856,35861
<    33074:     e59d5000        ldr     r5, [sp]
<    33078:     e58d50bc        str     r5, [sp, #188]  ; 0xbc
<    3307c:     e59d6000        ldr     r6, [sp]
<    33080:     e58d60c0        str     r6, [sp, #192]  ; 0xc0
<    33084:     e59d7000        ldr     r7, [sp]
<    33088:     e58d70c4        str     r7, [sp, #196]  ; 0xc4
---
>    33074:     e59d6000        ldr     r6, [sp]
>    33078:     e58d60bc        str     r6, [sp, #188]  ; 0xbc
>    3307c:     e59d7000        ldr     r7, [sp]
>    33080:     e58d70c0        str     r7, [sp, #192]  ; 0xc0
>    33084:     e59d2000        ldr     r2, [sp]
>    33088:     e58d20c4        str     r2, [sp, #196]  ; 0xc4
36201,36206c36201,36206
<    335d8:     e59d5000        ldr     r5, [sp]
<    335dc:     e58d50bc        str     r5, [sp, #188]  ; 0xbc
<    335e0:     e59d6000        ldr     r6, [sp]
<    335e4:     e58d60c0        str     r6, [sp, #192]  ; 0xc0
<    335e8:     e59d7000        ldr     r7, [sp]
<    335ec:     e58d70c4        str     r7, [sp, #196]  ; 0xc4
---
>    335d8:     e59d6000        ldr     r6, [sp]
>    335dc:     e58d60bc        str     r6, [sp, #188]  ; 0xbc
>    335e0:     e59d7000        ldr     r7, [sp]
>    335e4:     e58d70c0        str     r7, [sp, #192]  ; 0xc0
>    335e8:     e59d2000        ldr     r2, [sp]
>    335ec:     e58d20c4        str     r2, [sp, #196]  ; 0xc4
36463,36468c36463,36468
<    339f0:     e59d5000        ldr     r5, [sp]
<    339f4:     e58d50bc        str     r5, [sp, #188]  ; 0xbc
<    339f8:     e59d6000        ldr     r6, [sp]
<    339fc:     e58d60c0        str     r6, [sp, #192]  ; 0xc0
<    33a00:     e59d7000        ldr     r7, [sp]
<    33a04:     e58d70c4        str     r7, [sp, #196]  ; 0xc4
---
>    339f0:     e59d6000        ldr     r6, [sp]
>    339f4:     e58d60bc        str     r6, [sp, #188]  ; 0xbc
>    339f8:     e59d7000        ldr     r7, [sp]
>    339fc:     e58d70c0        str     r7, [sp, #192]  ; 0xc0
>    33a00:     e59d2000        ldr     r2, [sp]
>    33a04:     e58d20c4        str     r2, [sp, #196]  ; 0xc4

vacantron avatar Mar 21 '24 17:03 vacantron

The self-hosting on Raspberry Pi 3 is broken since d9a989d also. After enter the commend make out/shecc-stage2.elf, I got:

  CC+LD	out/inliner
  GEN	out/libc.inc
  CC	out/src/main.o
  LD	out/shecc
  SHECC	out/shecc-stage1.elf
  SHECC	out/shecc-stage2.elf
make: *** [Makefile:85: out/shecc-stage2.elf] Segmentation fault

vacantron avatar Apr 05 '24 14:04 vacantron