diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2018-10-03 15:36:55 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krz.gogolewski@gmail.com> | 2018-10-03 15:40:22 +0200 |
commit | fc2ff6dd7496a33bf68165b28f37f40b7d647418 (patch) | |
tree | 4cb624e2a8046da6c0bdcb3c6acf0aa1dfd4fa5e /compiler/ghc.mk | |
parent | 3dedffa2a51952b05c22b2d08668155ac07d7320 (diff) | |
download | haskell-fc2ff6dd7496a33bf68165b28f37f40b7d647418.tar.gz |
Make GHC (the library) flexible in the choice of integer library
Summary:
We have more and more users of GHC as a library, for example the
Haskell-to-WebAssembly-compiler https://github.com/tweag/asterius.
These need to make different decisions about various aspects of
code generation than the host compiler, and ideally GHC-the-library
allows them to set the `DynFlags` as needed.
This patch adds a new `DynFlag` that configures which `integer`
library to use. This flag is initialized by `cIntegerLibraryType`
(as before), and is only used in `CorePrep` to decide whether to
use `S#` or not.
The other code paths that were varying based on `cIntegerLibraryType`
are no now longer varying: The trick is to use `integer-wired-in`
as the `-this-unit-id` when compiling either `integer-gmp` or
`integer-simple`.
Test Plan: Validate is happy.
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: TerrorJack, adamse, simonpj, rwbarton, carter
GHC Trac Issues: #13477
Differential Revision: https://phabricator.haskell.org/D5079
Diffstat (limited to 'compiler/ghc.mk')
-rw-r--r-- | compiler/ghc.mk | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 9bc6b3f278..8a4cc4317d 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -84,8 +84,6 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/. @echo 'cBooterVersion = "$(GhcVersion)"' >> $@ @echo 'cStage :: String' >> $@ @echo 'cStage = show (STAGE :: Int)' >> $@ - @echo 'cIntegerLibrary :: String' >> $@ - @echo 'cIntegerLibrary = "$(INTEGER_LIBRARY)"' >> $@ @echo 'cIntegerLibraryType :: IntegerLibrary' >> $@ ifeq "$(INTEGER_LIBRARY)" "integer-gmp" @echo 'cIntegerLibraryType = IntegerGMP' >> $@ |