Assign more accurate code sizes to primops, so that the inlining heuristics work better. Also removed the old unused "needs_wrapper" predicate for primops. This helps with #4978.
Change remaining uses of cTargetOS to platformOS And remove cTargetOS/cTargetPlatform.
Remove the OMIT_NATIVE_CODEGEN ifdef We now test cGhcWithNativeCodeGen == "YES" instead.
Small DynFlags improvements
Add "C compiler flags" to settings file I've made cpp_args include gcc_args. It effectively didn't before, but seeing as gcc_args sometimes has -D flags in, I think doing so is the right thing to do.
Move gcc's and perl's location to the settings file They were hardcoded in Config.hs
Change the way module initialisation is done (#3252, #4417) Previously the code generator generated small code fragments labelled with __stginit_M for each module M, and these performed whatever initialisation was necessary for that module and recursively invoked the initialisation functions for imported modules. This appraoch had drawbacks: - FFI users had to call hs_add_root() to ensure the correct initialisation routines were called. This is a non-standard, and ugly, API. - unless we were using -split-objs, the __stginit dependencies would entail linking the whole transitive closure of modules imported, whether they were actually used or not. In an extreme case (#4387, #4417), a module from GHC might be imported for use in Template Haskell or an annotation, and that would force the whole of GHC to be needlessly linked into the final executable. So now instead we do our initialisation with C functions marked with __attribute__((constructor)), which are automatically invoked at program startup time (or DSO load-time). The C initialisers are emitted into the stub.c file. This means that every time we compile with -prof or -hpc, we now get a stub file, but thanks to #3687 that is now invisible to the user. There are some refactorings in the RTS (particularly for HPC) to handle the fact that initialisers now get run earlier than they did before. The __stginit symbols are still generated, and the hs_add_root() function still exists (but does nothing), for backwards compatibility.
Flag for defaulting the codegen GhcStageXDefaultNewCodegen. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Remove dead code, now that -fvia-c is a no-op
Clarify the "object splitting" variable names
Keep separate linker flags, for when we want to link with gcc or ld
Build system improvements We no longer use dummy-ghc; instead we don't configure most packages until the stage1 compiler is available. We also now use Cabal for building the ghc-bin package. There are a couple more sanity checks too.
Define cTargetArch and start to use it rather than ifdefs Using Haskell conditionals means the compiler sees all the code, so there should be less rot of code specific to uncommon arches. Code for other platforms should still be optimised away, although if we want to support targetting other arches then we'll need to compile it for-real anyway.
Rename the c*Platform variables to c*PlatformString
Drop GhcWithLlvmCodeGen configuration bits The LLVM code generator is always built unconditionally, so both the configuration variable in mk/config.mk.in as well as the string in compilerInfo can be removed.
Remove dead code now that we require the bootstrapping compiler be >= 6.12
Always enable the archive-loading code If the GHCi .o lib doesn't exist, load the .a instead
Fixes for when HADDOCK_DOCS=NO
Implement archive loading for ghci
Remove some duplication of C flags We now use the CONF_CC_OPTS_STAGEn C flags in machdepCCOpts, rather than repeating them there.