diff options
author | John Ericson <git@JohnEricson.me> | 2019-03-27 00:27:01 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-05-14 16:41:19 -0400 |
commit | e529c65eacf595006dd5358491d28c202d673732 (patch) | |
tree | 0498cb0a7023c491c240d64069e2442073e83d77 /compiler/main/CodeOutput.hs | |
parent | f9e4ea401121572d799b9db56f24aa1abdf5edf8 (diff) | |
download | haskell-e529c65eacf595006dd5358491d28c202d673732.tar.gz |
Remove all target-specific portions of Config.hs
1. If GHC is to be multi-target, these cannot be baked in at compile
time.
2. Compile-time flags have a higher maintenance than run-time flags.
3. The old way makes build system implementation (various bootstrapping
details) with the thing being built. E.g. GHC doesn't need to care
about which integer library *will* be used---this is purely a crutch
so the build system doesn't need to pass flags later when using that
library.
4. Experience with cross compilation in Nixpkgs has shown things work
nicer when compiler's can *optionally* delegate the bootstrapping the
package manager. The package manager knows the entire end-goal build
plan, and thus can make top-down decisions on bootstrapping. GHC can
just worry about GHC, not even core library like base and ghc-prim!
Diffstat (limited to 'compiler/main/CodeOutput.hs')
-rw-r--r-- | compiler/main/CodeOutput.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs index 478de594ac..1ded72111a 100644 --- a/compiler/main/CodeOutput.hs +++ b/compiler/main/CodeOutput.hs @@ -24,7 +24,6 @@ import Packages import Cmm ( RawCmmGroup ) import HscTypes import DynFlags -import Config import Stream (Stream) import qualified Stream import FileCleanup @@ -156,7 +155,7 @@ outputAsm :: DynFlags -> Module -> ModLocation -> FilePath -> Stream IO RawCmmGroup () -> IO () outputAsm dflags this_mod location filenm cmm_stream - | cGhcWithNativeCodeGen == "YES" + | sGhcWithNativeCodeGen $ settings dflags = do ncg_uniqs <- mkSplitUniqSupply 'n' debugTraceMsg dflags 4 (text "Outputing asm to" <+> text filenm) @@ -226,8 +225,9 @@ outputForeignStubs dflags mod location stubs mk_include i = "#include \"" ++ i ++ "\"\n" -- wrapper code mentions the ffi_arg type, which comes from ffi.h - ffi_includes | cLibFFI = "#include \"ffi.h\"\n" - | otherwise = "" + ffi_includes + | sLibFFI $ settings dflags = "#include \"ffi.h\"\n" + | otherwise = "" stub_h_file_exists <- outputForeignStubs_help stub_h stub_h_output_w |