"Manuel M. T. Chakravarty" wrote:
> 
> Michael Hobbs <[EMAIL PROTECTED]> wrote,
> 
> > I don't know if this is a known bug or not, so I figured I'd send a
> > message and find out for sure. Anyway, I'm using a binary build of GHC
> > 4.03 for Sparc that Simon M. (?) posted a while back. Whenever I try to
> > use a 'foreign export dynamic' function, I get an undefined symbol
> > during linking: createAdjustor.
> >
> > I looked for it in all of the libraries, but was unable to find it. I'm
> > assuming that it's just not there. It's supposed to be in libHSrts.a,
> > right?
> 
> True, I just had a look at `Adjustor.c'.  The code starts
> with
> 
>   /* Heavily arch-specific, I'm afraid.. */
>   #if defined(i386_TARGET_ARCH)
> 
> and ends with
> 
>   #endif /* i386_TARGET_ARCH */
> 
> *sigh*  So, there seems only to be i386 code...
> 
> It is only a short piece of code, but it writes machine code
> - in the sense of hexadecimal digits, which happen to be
> i386 instructions - into the heap.  It is probably not too
> difficult to write for a different architecture after having
> a close look at the function call conventions of the local C
> compiler...

I wouldn't mind working on this, but I know very little about the SPARC
architecture, or the calling conventions. (I don't even know if the
stack grows up or down.) I took a look at the assembly output of gcc and
got an idea of what's going on, but I can't be sure. Does anyone know
where I can find some [free online] information about SPARC assembly?
Particularly, in relation for use with `gas' and using Solaris/gcc
calling conventions.

Thanks,
Mike Hobbs

P.S. I may not respond for a couple weeks. I'm going on vacation. :)

Reply via email to