summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2019-01-20 19:25:26 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-08-10 14:39:27 -0400
commit818602818bb8553b241271204d159d5a40971d5a (patch)
tree135e9d4f7d635b94effe709efc8e3f20cc6968f6 /configure.ac
parent83ca42de519cdfa28b38164e90d726034dba768e (diff)
downloadhaskell-818602818bb8553b241271204d159d5a40971d5a.tar.gz
Consolidate `TablesNextToCode` and `GhcUnreigsterised` in configure (#15548)
`TablesNextToCode` is now a substituted by configure, where it has the correct defaults and error handling. Nowhere else needs to duplicate that, though we may want the compiler to to guard against bogus settings files. I renamed it from `GhcEnableTablesNextToCode` to `TablesNextToCode` to: - Help me guard against any unfixed usages - Remove any lingering connotation that this flag needs to be combined with `GhcUnreigsterised`. Original reviewers: Original subscribers: TerrorJack, rwbarton, carter Original Differential Revision: https://phabricator.haskell.org/D5082
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac56
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