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.