Subject: Re: new toolchain, cross compiler, and recent kernel
To: None <port-dreamcast@netbsd.org>
From: Brian Alliet <brian@brian-web.com>
List: port-dreamcast
Date: 03/23/2002 02:28:44
On Friday, March 22, 2002, at 09:10 PM, Christian Groessler wrote:
> I've put up a kernel on
> ftp://ftp.groessler.org/pub/chris/dreamcast/netbsd/build217/netbsd.bz2
>

Thanks, the kernel worked great. Unfortunately, I still can't run any of 
the binaries I built. I keep getting "Bad syscall". After looking around 
with gdb it looks like arguments are getting screwed up during function 
calls. I threw together a quick test program:

#include <stdio.h>

int func(int a, int b, int c, int d, int e, int f){
         int x;
         x = c + d;
         return x;
}

int main(int argc,char **argv){
         int x;
         x = func(1,2,3,4,5,6);
         printf("x=%d\n",x);
         return 0;
}

On any other system it displays 7, like it should. On the dc it displays 
0. Run gdb:
(gdb) break func
Breakpoint 1 at 0x40037e: file test.c, line 3.
(gdb) run
Starting program: /root/./test

Breakpoint 1, func (a=0, b=0, c=0, d=0, e=5, f=6) at test.c:3

Well, that isn't right is it. Guess that explains why my kernels don't 
work. I don't even know where to begin tracking down how to fix this. 
When I built the system the compiler got a sig 11 on two of the files. 
Compiling those files with -O0 fixed the problem, but now I'm beginning 
to wonder if there is something wrong with the cross compiler. Next I 
guess I'll try rebuilding the whole mess from scratch, and if that still 
doesn't work, I'll try gcc 3.0.

-Brian