Skip to contentSkip to conversation

klibc: Need psABIs and #defines

DISCUSSION H. Peter Anvin 1 participant 1 message Aug 9, 2002

lore
Share & tools
lore
#0 lore raw

Hi all,

I could use some help with portability for non-x86 platforms. In particular, I need to figure out how to make crt0.[cS] to work on various platforms, which unfortunately doesn't seem to be all that obvious. Unfortunately the SysV ABI creators didn't do the obvious thing, which would have been to call _start() with its parameters using the standard C calling sequence; instead, each platform seems to put things on the stack in various ways (the sparc, for example, needs a register window save area.)

a) If you'd be willing to write crt0.c/crt0.S for any platform, let me know.

b) If you know where to get psABIs other than x86, x86-64, mips32 and sparc32, let me know.

c) If you know what #ifdefs one can use to test for any platform, let me know...

-hpa

Signature · 3 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<[email protected]>