diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-11-07 05:06:39 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-07 16:26:10 -0500 |
commit | 184f6bc6f17360421eb101c9deffb7f701072885 (patch) | |
tree | 09f35b655ec15d127166d2ac860a406a6be91a11 /m4/ghc_tables_next_to_code.m4 | |
parent | 3d7e3d911c3dbfc114b7af33ad4b28cd2af29bbc (diff) | |
download | haskell-184f6bc6f17360421eb101c9deffb7f701072885.tar.gz |
Factor out unregisterised and tables next to code m4 macros
These will be useful for upcoming RTS configure script.
Diffstat (limited to 'm4/ghc_tables_next_to_code.m4')
-rw-r--r-- | m4/ghc_tables_next_to_code.m4 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/m4/ghc_tables_next_to_code.m4 b/m4/ghc_tables_next_to_code.m4 new file mode 100644 index 0000000000..0f262bba57 --- /dev/null +++ b/m4/ghc_tables_next_to_code.m4 @@ -0,0 +1,41 @@ +# GHC_TABLES_NEXT_TO_CODE +# -------------------------------- +# Do a build with tables next to code? +# +# Whether the target architecture supports placing info tables +# directly before the entry code (see TABLES_NEXT_TO_CODE in the RTS). +# Whether we actually compile for TABLES_NEXT_TO_CODE depends on +# whether we're building unregisterised code or not, which may be +# decided by options to the compiler later. +# +# See https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/heap-objects#tables_next_to_code +# +AC_DEFUN([GHC_TABLES_NEXT_TO_CODE], +[ + AC_REQUIRE([GHC_UNREGISTERISED]) + AC_MSG_CHECKING(whether target supports tables next to code) + case "$Unregisterised" in + NO) + case "$TargetArch" in + ia64|powerpc64|powerpc64le|s390x) + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + ;; + *) + TablesNextToCodeDefault=YES + AC_MSG_RESULT([yes]) + ;; + esac + ;; + YES) + TablesNextToCodeDefault=NO + AC_MSG_RESULT([no]) + ;; + esac + FP_DEFAULT_CHOICE_OVERRIDE_CHECK( + [tables-next-to-code], + [tables next to code], + [tables apart from code], + [TablesNextToCode], + [Build a tool chain with info tables laid out next to code (enabled by default when using the registerised ABI, on platforms that support it)]) +]) |