From 56c0170c68a83634c6e2d955723b92c70b117c64 Mon Sep 17 00:00:00 2001 From: Geoff Cant Date: Tue, 12 Jan 2010 22:30:04 +1300 Subject: Fix hipe memory allocation problems on darwin/amd64 HiPE on amd64 needs to be able to allocate memory in the 0x20000000+ range so that compiled code will be addressable with 32bit pointers (when sign extended). By default, when building 64bit executables on OS X, PAGEZERO occupies the first 4GB of virtual memory. The PAGEZERO segment cannot be mmap(ed) or vm_allocate(d) into. To avoid this problem we use the -pagezero_size linker flag to reduce the size of PAGEZERO and free up the 0x20000000+ space. --- erts/emulator/Makefile.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'erts/emulator/Makefile.in') diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index bc846d1e3d..97c21ce28f 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -167,6 +167,9 @@ ifeq ($(OPSYS),linux) ppcBEAMLDFLAGS=-Wl,-m,elf32ppc ppc64BEAMLDFLAGS=-Wl,-m,elf64ppc,-T,hipe/elf64ppc.x endif +ifeq ($(OPSYS),darwin) +amd64BEAMLDFLAGS=-pagezero_size 0x10000000 +endif HIPEBEAMLDFLAGS=$($(ARCH)BEAMLDFLAGS) endif -- cgit v1.2.3