From 6eee26d55f32113e3ea4575e5500f2fc3c312fff Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 4 Oct 2016 21:46:53 +0200 Subject: erts: Enable exec_alloc for all hipe architectures For non-amd64 it's a "normal" allocator with a wrapper around mseg_alloc to call mprotect(PROT_EXEC). --- erts/configure.in | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'erts/configure.in') diff --git a/erts/configure.in b/erts/configure.in index dc85b2eafc..91358d9c36 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -2031,7 +2031,7 @@ AC_CHECK_FUNCS([getipnodebyname getipnodebyaddr gethostbyname2]) AC_CHECK_FUNCS([ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \ pread pwrite memmove strerror strerror_r strncasecmp \ - gethrtime localtime_r gmtime_r inet_pton \ + gethrtime localtime_r gmtime_r inet_pton mprotect \ mmap mremap memcpy mallopt sbrk _sbrk __sbrk brk _brk __brk \ flockfile fstat strlcpy strlcat setsid posix2time time2posix \ setlocale nl_langinfo poll mlockall ppoll]) @@ -2750,6 +2750,18 @@ if test X${enable_hipe} != Xno && test X$ac_cv_sizeof_void_p != X4; then 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 +fi + dnl check to auto-enable hipe here... if test "$cross_compiling" != "yes" && test X${enable_hipe} != Xno; then if test -z "$M4"; then @@ -3379,13 +3391,8 @@ if test X${enable_hipe} = Xyes; then AC_DEFINE(HIPE,[1],[Define to enable HiPE]) HIPE_HELPERS="xmerl syntax_tools edoc" ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS hipe" - case "$ARCH" in - amd64) - # For now exec_alloc is only used for hipe on amd64 - AC_MSG_NOTICE([Enable exec_alloc for hipe code allocation]) - ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS exec_alloc" - ;; - esac + AC_MSG_NOTICE([Enable exec_alloc for hipe code allocation]) + ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS exec_alloc" fi fi AC_SUBST(HIPE_HELPERS) -- cgit v1.2.3