HiPE for darwin/amd64

Geoff Cant nem@REDACTED
Tue Jan 12 11:09:13 CET 2010


Hi all, I was poking around trying to get hipe working in my
darwin/amd64 erlang build and have prepared some patches to get this to
happen.

The changes are roughly:
* Update configure.in to stop disabling hipe
* Port the asm and m4 fixes from hipe/darwin/x86 to hipe/darwin/amd64 to
  get it to compile
* Add a -pagezero_size linker directive to stop OS X's default 4Gb
  PAGEZERO segment from clobbering all the memory hipe wants to allocate.

These changes taken together give me a bootstrap build that can compile,
load and execute a very simple erlang module (a UUID generator module I
found somewhere). I haven't tested the patches further than that - more
importantly, I haven't tested that the asm/m4/configure changes don't
break other platforms as I don't have easy access to said other platforms.

The ugliest part of the patch is making -pagezero_size a member of
LDFLAGS in erts/configure.in as this applies it to all compiled executables
instead of just the emulator target. If I could decipher where in the
autoconf/make jumble I could put it to be minimally invasive, I'd do
that instead.

The code is a fork of ccase/r13b04_dev on github:

git fetch git://github.com/archaelus/otp.git hipe_darwin_amd64

Cheers,
-- 
Geoff Cant

ps: I can't remember now if the code sets MAP_FIXED for darwin/amd64. I
don't think it does, but if it did, then it's important to remember that
mmap with MAP_FIXED on OS X replaces any existing mapping in the
requested region. I think this behaviour differs to the other platforms.  


More information about the erlang-patches mailing list