diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index aa48872b4e..0524d140b2 100644 --- a/configure.ac +++ b/configure.ac @@ -271,6 +271,55 @@ AC_ARG_ENABLE(unregisterised, ) AC_SUBST(Unregisterised) +dnl ** Do a build with tables next to code? +dnl +dnl Whether the target architecture supports placing info tables +dnl directly before the entry code (see TABLES_NEXT_TO_CODE in the RTS). +dnl Whether we actually compile for TABLES_NEXT_TO_CODE depends on +dnl whether we're building unregisterised code or not, which may be +dnl decided by options to the compiler later. +dnl +dnl See https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/heap-objects#tables_next_to_code +dnl -------------------------------------------------------------- +case "$Unregisterised" in + NO) + case "$TargetArch" in + ia64|powerpc64|powerpc64le) + TablesNextToCodeDefault=NO + ;; + *) + TablesNextToCodeDefault=YES + ;; + esac + ;; + YES) + TablesNextToCodeDefault=NO + ;; +esac +AC_ARG_ENABLE(tables-next-to-code, +[AC_HELP_STRING([--enable-tables-next-to-code], +[Build an tables-next-to-code compiler (enabled by default on platforms without registerised support) [default="$TablesNextToCodeDefault"]])], +[ if test x"$enableval" = x"yes"; then + TablesNextToCode=YES + else + TablesNextToCode=NO + fi +], +[TablesNextToCode="$TablesNextToCodeDefault"] +) + +fail() { + echo >&2 + echo "$1" >&2 + exit 1 +} + +if test "$TablesNextToCodeDefault" = "NO" && test "$TablesNextToCode" = "YES"; then + fail "Error: tables next to code was requested but is not supported" +fi + +AC_SUBST(TablesNextToCode) + dnl ** Does target have runtime linker support? dnl -------------------------------------------------------------- case "$target" in @@ -286,12 +335,6 @@ AC_SUBST(HaskellHaveRTSLinker) # Requires FPTOOLS_SET_PLATFORM_VARS to be run first. FP_FIND_ROOT -fail() { - echo >&2 - echo "$1" >&2 - exit 1 -} - if test "$HostOS" = "mingw32" then @@ -1335,6 +1378,7 @@ echo "\ which is version : $GccVersion Building a cross compiler : $CrossCompiling Unregisterised : $Unregisterised + TablesNextToCode : $TablesNextToCode hs-cpp : $HaskellCPPCmd hs-cpp-flags : $HaskellCPPArgs ar : $ArCmd |