aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-10-24 16:04:41 +0200
committerSverker Eriksson <[email protected]>2016-10-24 16:04:41 +0200
commitde0c6121feb8761fe3931c32b7da54d29490c32f (patch)
tree171a9a1d56518a5d9079bd995ffaf89fbcf4c27f
parent0b5612f8770fa24081a7ce6a62190921c0478be4 (diff)
parent79abd75445dec4f1932868fcc52238a84d94cce0 (diff)
downloadotp-de0c6121feb8761fe3931c32b7da54d29490c32f.tar.gz
otp-de0c6121feb8761fe3931c32b7da54d29490c32f.tar.bz2
otp-de0c6121feb8761fe3931c32b7da54d29490c32f.zip
Merge branch 'sverker/hipe-other-64bit'
-rw-r--r--erts/configure.in46
-rw-r--r--erts/emulator/sys/common/erl_mmap.h18
2 files changed, 37 insertions, 27 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 86defd5119..4bff2ebf3d 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -2744,29 +2744,29 @@ ERL_TIME_CORRECTION
AC_CHECK_PROG(M4, m4, m4)
-dnl HiPE cannot run on 64-bit without MAP_FIXED and MAP_NORESERVE
-if test X${enable_hipe} != Xno && test X$ac_cv_sizeof_void_p != X4; then
- AC_CHECK_DECLS([MAP_FIXED, MAP_NORESERVE], [], [], [#include <sys/mman.h>])
- if test X$ac_cv_have_decl_MAP_FIXED != Xyes || test X$ac_cv_have_decl_MAP_NORESERVE != Xyes; then
- if test X${enable_hipe} = Xyes; then
- AC_MSG_ERROR([HiPE on 64-bit needs MAP_FIXED and MAP_NORESERVE flags for mmap()])
- else
- enable_hipe=no
- AC_MSG_WARN([Disable HiPE due to lack of MAP_FIXED and MAP_NORESERVE flags for mmap()])
- fi
- fi
-fi
-
-dnl HiPE cannot run on 32-bit without mprotect()
-if test X${enable_hipe} != Xno && test X$ac_cv_sizeof_void_p == X4; then
- if test X$ac_cv_func_mprotect != Xyes; then
- if test X${enable_hipe} = Xyes; then
- AC_MSG_ERROR([HiPE on 32-bit needs mprotect()])
- else
- enable_hipe=no
- AC_MSG_WARN([Disable HiPE due to lack of mprotect()])
- fi
- fi
+if test X${enable_hipe} != Xno; then
+ if test X$ac_cv_sizeof_void_p != X4 && test X$ARCH = Xamd64; then
+ dnl HiPE cannot run on x86_64 without MAP_FIXED and MAP_NORESERVE
+ AC_CHECK_DECLS([MAP_FIXED, MAP_NORESERVE], [], [], [#include <sys/mman.h>])
+ if test X$ac_cv_have_decl_MAP_FIXED != Xyes || test X$ac_cv_have_decl_MAP_NORESERVE != Xyes; then
+ if test X${enable_hipe} = Xyes; then
+ AC_MSG_ERROR([HiPE on x86_64 needs MAP_FIXED and MAP_NORESERVE flags for mmap()])
+ else
+ enable_hipe=no
+ AC_MSG_WARN([Disable HiPE due to lack of MAP_FIXED and MAP_NORESERVE flags for mmap()])
+ fi
+ fi
+ else
+ dnl HiPE cannot run without mprotect()
+ if test X$ac_cv_func_mprotect != Xyes; then
+ if test X${enable_hipe} = Xyes; then
+ AC_MSG_ERROR([HiPE needs mprotect() on $ARCH])
+ else
+ enable_hipe=no
+ AC_MSG_WARN([Disable HiPE due to lack of mprotect()])
+ fi
+ fi
+ fi
fi
dnl check to auto-enable hipe here...
diff --git a/erts/emulator/sys/common/erl_mmap.h b/erts/emulator/sys/common/erl_mmap.h
index 92e9eb9e41..1049f7affc 100644
--- a/erts/emulator/sys/common/erl_mmap.h
+++ b/erts/emulator/sys/common/erl_mmap.h
@@ -157,13 +157,23 @@ Eterm erts_mmap_info_options(ErtsMemMapper*,
# include "erl_alloc_types.h"
extern ErtsMemMapper erts_dflt_mmapper;
-# if defined(ARCH_64) && defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
+
+# if defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION)
+
+# if defined(ARCH_64)
extern ErtsMemMapper erts_literal_mmapper;
-# ifdef ERTS_ALC_A_EXEC
-# define ERTS_HAVE_EXEC_MMAPPER
+# endif
+
+# if defined(ERTS_ALC_A_EXEC) && defined(__x86_64__)
+ /*
+ * On x86_64, exec_alloc employs its own super carrier 'erts_exec_mmaper'
+ * to ensure low memory for HiPE AMD64 small code model.
+ */
+# define ERTS_HAVE_EXEC_MMAPPER
extern ErtsMemMapper erts_exec_mmapper;
-# endif
# endif
+
+# endif /* ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION */
#endif /* ERTS_WANT_MEM_MAPPERS */
/*#define HARD_DEBUG_MSEG*/