Hi,
I have been trying to build IO on a PPC mac but found it was crashing on a PPC mac. The problem appeared to be in libcoro, where the version of Coro_Start() used (one in the #else block) was using the structure globalCallbackBlock. However globalCallbackBlock was never set up. I changed this by making to look like this below:
#elif defined(_BSD_PPC_SETJMP_H_)
#define buf (self->env)
#define setjmp _setjmp
#define longjmp _longjmp
void Coro_setup(Coro *self, void *arg)
{
size_t *sp = (size_t *)(((intptr_t)Coro_stack(self)
+ Coro_stackSize(self) - 64 + 15) & ~15);
setjmp(buf);
//printf("self = %p\n", self);
//printf("sp = %p\n", sp);
buf[0] = (long)sp;
buf[21] = (long)Coro_Start;
globalCallbackBlock.context=((CallbackBlock*)arg)->context;
globalCallbackBlock.func=((CallbackBlock*)arg)->func;
//sp[-4] = (size_t)self; // for G5 10.3
//sp[-6] = (size_t)self; // for G4 10.4
//printf("self = %p\n", (void *)self);
//printf("sp = %p\n", sp);
}
Seems to work.