cross compiling ?

Chris Lewis clewis at ferret.ocunix.on.ca
Sat Mar 9 06:18:57 AEST 1991


In article <jms.668278528 at wits-end> jms at informix.com (John Stephens) writes:
>I heard an interesting rumor that some of the more esoteric switches available
>in the Sparc Station compiler (notably the 68000 code generator) code be used
>to build code that would execute on the 3b1.

>This would make the building of some of the larger GNU sources possible, to
>say nothing of speeding up the build time.

>Can it be done ?  Have you done it ?

I haven't done it in this particular context, but I have done similar
things (eg: object module format conversions to permit execution
of NCR tower binaries on 68020 Xenix systems...).  The 68000 ABI is
actually pretty standard - surprised the hell out of me that NCR's SVR2
system call conventions were identical to (incredibably archaic LISA!)
Xenix.

It'll probably work.  Provided that the Sparc (or whatever) generates
a compatible COFF format file, and that the function calling convention
is the same (this only for the main function).  If the latter isn't true,
a rewrite of crt0.o will fix things so that argc, argv and envp get in
to the main function properly.  (Not hard - disassemble and add
a bit)  Things to watch out for: inlining of system calls (yipes!) - but
even that would work as long as the system call convention was the same.
Another: some systems have the function prologs do pokes to
memory to ensure that stack gets allocated - you may have to fake that
somehow if the 3b1 needs it - though I think some of the old Suns needed
it too.

You'll probably also have to copy over the include files and libraries if
you want to do the link on the Sparc.  The 3b1 has lots of non-SVID stuff.
I doubt you could do links with the shared library, but you might.  Or,
postpone the link to the 3b1.

-- 
Chris Lewis,
clewis at ferret.ocunix.on.ca or ...uunet!mitel!cunews!latour!ecicrl!clewis
Psroff support: psroff-request at eci386.uucp, or call 613-832-0541 (Canada)



More information about the Comp.sys.3b1 mailing list