[MLton] Port of OpenBSD to MLton

Jesper Louis Andersen jlouis@mongers.org
Wed, 9 Jun 2004 15:42:59 +0200

After a miserable try at the ICFP contest this year, I think I'd rather
do something I know how to do (and chose SML next year as the language
for implementation instead of scheme). So I decided to give porting
MLton to OpenBSD a try. Currently the runtime C part compiles perfectly,
and I know where I need to add OpenBSD to the datatypes in the SML-part
of the code. 

My current problem is a good proper bootstrap. I can run the Linux-version
with linux-emulation perfectly. So I can produce .c and .S files and probably
.o files as well. Now, do I link them with my runtime? Or is there an easier
way than hacking it? It is obvious the linker step fails because the linux runtime
attempts to call the OpenBSD gcc and link the linux mlton.a lib with OpenBSD

SMLNJ 110.45 doesn't have a port, so that path is not one I wish to take.
My own patches for 110.43 does not apply cleanly anymore, so it seems I
am stuck here. If it is the easiest, I might be patching a compiler I'd
rather avoid to work with in order to be able to compile what I want to
work with, heh.

Furthermore, complication is that OpenBSDs GCC uses a stack protector
scheme (add a random value just before the $RA on the stack in the 
prologue. Check that it is intact in the epilogue). I can turn that
off though, if it will be a problem.