[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-mes] mescc arm progress
From: |
Danny Milosavljevic |
Subject: |
Re: [bug-mes] mescc arm progress |
Date: |
Mon, 8 Apr 2019 19:16:23 +0200 |
Hi Janneke,
On Sun, 07 Apr 2019 23:59:37 +0200
Jan Nieuwenhuizen <address@hidden> wrote:
>I found that something
> weird happens an EOF on arm, not exactly sure what's going on there but
> I found a workaround for now.
Hmm, EOF is famously (int) -1 and char is unsigned on ARM (if not changed by
compiler flag). Might have something to do with it.
Also not sure whether we are officially allowed to unread EOF--although the
ungetter is our implementation, right? That one seems to allow it.
> So, I added two ugly commits on top that now enable mescc to compile run
> on mes, with pretty good results:
>
> --8<---------------cut here---------------start------------->8---
> $ make check recheck=true
> GNUmakefile:165: skipping man: no help2man
> GNUmakefile:285: update-hash: no guix
> /bin/bash check.sh
> FAIL: lib/tests/scaffold/t.c
> FAIL: lib/tests/scaffold/06-not-call-1.c
> FAIL: lib/tests/scaffold/06-call-variable.c
> FAIL: lib/tests/scaffold/08-assign-global.c
> FAIL: lib/tests/scaffold/12-if-eq.c
> FAIL: lib/tests/scaffold/13-if-neq.c
> FAIL: lib/tests/scaffold/14-if-goto.c
> FAIL: lib/tests/scaffold/17-compare-char.c
> FAIL: lib/tests/scaffold/17-compare-ge.c
> FAIL: lib/tests/scaffold/17-compare-gt.c
> FAIL: lib/tests/scaffold/17-compare-lt.c
> ...
> --8<---------------cut here---------------end--------------->8---
Nice short failure list! (some of them ridiculous ones that I apparently broke
again--oops).
I've taken a look at your commits and saw:
>+#if 0 ///Error: thumb conditional instruction should be in IT block -- `moveq
>r1,#1'
Hmm, that means that thumb mode is enabled which means it will use a different
frame pointer (r7). That's very bad because that frame pointer is not set up
by our runtime. (it might be also why you had to comment out r7 from the
syscall clobber list. Though I think the clobber list is much too paranoid
anyway--but better than debugging forever :) )
Do you pass "-marm" to eventual gcc invocations (if any) and to the assembler?
That should disable Thumb mode.
As for syscalls, for some reason, the following construct doesn't do what I
think it should do in gcc:
unsigned int foo(a,b,c)
unsigned int a asm("r7");
unsigned int b asm("r0");
unsigned int c asm("r1");
{
asm("swi $0");
}
int main() {
foo(1,2,3);
}
That's too bad.
pgp7YwyNluGZf.pgp
Description: OpenPGP digital signature
- [bug-mes] mescc arm progress, Jan Nieuwenhuizen, 2019/04/07
- Re: [bug-mes] mescc arm progress,
Danny Milosavljevic <=
- Re: [bug-mes] mescc arm progress, Jan Nieuwenhuizen, 2019/04/08
- Re: [bug-mes] mescc arm progress, Danny Milosavljevic, 2019/04/10
- Re: [bug-mes] mescc arm progress, Jan Nieuwenhuizen, 2019/04/10
- Re: [bug-mes] mescc arm progress, Danny Milosavljevic, 2019/04/11
- Re: [bug-mes] mescc arm progress, Jan Nieuwenhuizen, 2019/04/11
- Re: [bug-mes] mescc arm progress, Jan Nieuwenhuizen, 2019/04/12