- 18 Nov, 2011 1 commit
-
-
Simon Marlow authored
Currently it is appearing on stderr, whereas the rest of the messages from --make go to stdout, this change fixes that.
-
- 16 Nov, 2011 3 commits
-
-
Simon Marlow authored
-
Simon Marlow authored
-
Simon Marlow authored
Rather than have main() be statically compiled as part of the RTS, we now generate it into the tiny C file that we compile when linking a binary. The main motivation is that we want to pass the settings for the -rtsotps and -with-rtsopts flags into the RTS, rather than relying on fragile linking semantics to override the defaults, which don't work with DLLs on Windows (#5373). In order to do this, we need to extend the API for initialising the RTS, so now we have: void hs_init_ghc (int *argc, char **argv[], // program arguments RtsConfig rts_config); // RTS configuration hs_init_ghc() can optionally be used instead of hs_init(), and allows passing in configuration options for the RTS. RtsConfig is a struct, which currently has two fields: typedef struct { RtsOptsEnabledEnum rts_opts_enabled; const char *rts_opts; } RtsConfig; but might have more in the future. There is a default value for the struct, defaultRtsConfig, the idea being that you start with this and override individual fields as necessary. In fact, main() was in a separate static library, libHSrtsmain.a. That's now gone.
-
- 11 Nov, 2011 1 commit
-
-
Simon Marlow authored
-
- 20 Oct, 2011 1 commit
-
-
Ian Lynagh authored
-
- 19 Oct, 2011 1 commit
-
-
Thorkil Naur authored
-
- 13 Oct, 2011 1 commit
-
-
Simon Marlow authored
-
- 11 Oct, 2011 1 commit
-
-
Ian Lynagh authored
Now that we always link in an extra object, we may as well always define rtsOptsEnabled in it, rather than having a default value in rts/hooks/RtsOptsEnabled.c.
-
- 06 Oct, 2011 2 commits
-
-
Ian Lynagh authored
Without it we get warnings like: ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog
-
Ian Lynagh authored
ld gives loads of warnings like: ld: warning: text reloc in _base_GHCziArr_unsafeArray_info to _base_GHCziArr_unsafeArray_closure when linking any program. We're not sure whether this is something we ought to fix, but for now we use the -Wl,-read_only_relocs,suppress flag to silence them.
-
- 21 Aug, 2011 1 commit
-
-
kgardas authored
-
- 10 Aug, 2011 2 commits
-
-
Simon Marlow authored
that it wasn't working on Alpha, because we had explicitly listed the arches rather than having a sensible fallback).
-
Simon Marlow authored
Also refactor the check into one place.
-
- 06 Aug, 2011 1 commit
-
-
- 03 Aug, 2011 1 commit
-
-
Ian Lynagh authored
Now that the in-tree gmp has been upgraded, it should no longer be necessary, according to #5293.
-
- 27 Jul, 2011 1 commit
-
-
chak@cse.unsw.edu.au. authored
- "-Wl,-no_pie" can be removed once GMP gets updated
-
- 20 Jul, 2011 1 commit
-
-
Simon Marlow authored
being used. We now track whether a module used any TH splices in the ModIface (and at compile time in the TcGblEnv and ModGuts). If a module used TH splices last time it was compiled, then we ignore the results of the normal recompilation check and recompile anyway, *unless* the module is "stable" - that is, none of its dependencies (direct or indirect) have changed. The stability test is pretty important - otherwise ghc --make would always recompile TH modules even if nothing at all had changed, but it does require some extra plumbing to get this information from GhcMake into HscMain. test in driver/recomp009
-
- 15 Jul, 2011 2 commits
-
-
Ian Lynagh authored
-
Sergei Trofimovich authored
"inplace/bin/ghc-stage1" -H32m -O -package-name base-4.4.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/autogen -Ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build/autogen -Ilibraries/base/include -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.2.0.0 -package integer-gmp-0.3.0.0 -package rts-1.0 -split-objs -package-name base -XHaskell98 -XCPP -O2 -no-user-package-conf -rtsopts -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build -hisuf hi -osuf o -hcsuf hc -c libraries/base/./GHC/Int.hs -o libraries/base/dist-install/build/GHC/Int.o /usr/lib/gcc/sparc-unknown-linux-gnu/4.5.2/../../../../sparc-unknown-linux-gnu/bin/ld: --relax and -r may not be used together collect2: ld returned 1 exit status make[1]: *** [libraries/base/dist-install/build/GHC/Int.o] Error 1 Or with '-v' param: /usr/bin/gcc -fno-stack-protector -nostdlib -nodefaultlibs -Wl,-r -Wl,--build-id=none -Wl,-x -o libraries/base/dist-install/build/GHC/Int.o /tmp/ghc45126_0/ghc45126_0.ldscript /usr/lib/gcc/sparc-unknown-linux-gnu/4.5.2/../../../../sparc-unknown-linux-gnu/bin/ld: --relax and -r may not be used together On SPARC gcc-4.5.2 has -mrelax in it's default specs, so we explicitly pass --no-relax for ld to make sure gcc's default does not affect us. Signed-off-by:
Sergei Trofimovich <slyfox@gentoo.org>
-
- 01 Jul, 2011 1 commit
-
-
Ian Lynagh authored
-
- 30 Jun, 2011 1 commit
-
-
batterseapower authored
-
- 27 Jun, 2011 1 commit
- 18 Jun, 2011 2 commits
-
-
dterei authored
While we previously checked the safety of safe imported modules we didn't do this check transitively. This can be a problem when we depend on a trustworthy module in a package that is no longer trusted, so we should fail compilation. We already stored in an interface file the transitive list of packages a module depends on. Now we extend that list to include a flag saying if we depend on that package being trusted as well.
-
dterei authored
This patch disables the use of some GHC extensions in Safe mode and also the use of certain flags. Some are disabled completely while others are only allowed on the command line and not in source PRAGMAS. We also check that Safe imports are indeed importing a Safe or Trustworthy module.
-
- 31 May, 2011 1 commit
-
-
dterei authored
-
- 08 May, 2011 1 commit
-
-
Ian Lynagh authored
And remove cTargetOS/cTargetPlatform.
-
- 07 May, 2011 2 commits
-
-
Ian Lynagh authored
-
Ian Lynagh authored
-
- 04 May, 2011 1 commit
-
-
dterei authored
Instead of using the GNU As subsection feature on Linux/Windows for TNTC we now use the LLVM Mangler on all platforms.
-
- 01 May, 2011 1 commit
-
-
Ian Lynagh authored
-
- 29 Apr, 2011 1 commit
-
-
Ian Lynagh authored
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.
-
- 26 Apr, 2011 1 commit
-
-
dterei authored
-
- 21 Apr, 2011 1 commit
-
-
Ian Lynagh authored
-
- 17 Apr, 2011 1 commit
-
-
Ian Lynagh authored
Also a small refactoring in how the verbosity flag is handled.
-
- 14 Apr, 2011 1 commit
-
-
Simon Marlow authored
otherwise some versions of gcc complain about a missing final newline.
-
- 12 Apr, 2011 2 commits
-
-
Simon Marlow authored
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.
-
Simon Marlow authored
This code has accumulated a great deal of cruft over the years, this pass cleans up a lot of the surrounding cruft but leaves the actual argument processing alone - so there's still more that could be done. Bug fixed: - ghc_rts_opts should not be subject to the --rtsopts setting. If the programmer explicitly declares options with ghc_rts_opts, they shouldn't also have to accept command-line RTS options to make them work.
-
- 08 Apr, 2011 1 commit
-
-
Simon Marlow authored
A common sequence of commands (at least for me) is this: $ ghc hello 1 of 1] Compiling Main ( hello.hs, hello.o ) Linking hello ... $ ./hello +RTS -s hello: Most RTS options are disabled. Link with -rtsopts to enable them. $ ghc hello -rtsopts $ grr, nothing happened. I could use -fforce-recomp, but if this was a large program I probably don't want to recompile it all again, so: $ rm hello removed `hello' $ ghc hello -rtsopts Linking hello ... $ ./hello +RTS -s ./hello +RTS -s Hello World! 51,264 bytes allocated in the heap 2,904 bytes copied during GC 43,808 bytes maximum residency (1 sample(s)) 17,632 bytes maximum slop etc. With this patch, GHC notices when the options have changed and forces a relink, so you don't need to rm the binary or use -fforce-recomp. This is done by adding the pertinent stuff to the binary in a special section called ".debug-ghc-link-info": $ readelf -p .debug-ghc-link-info ./hello String dump of section 'ghc-linker-opts': [ 0] (["-lHSbase-4.3.1.0","-lHSinteger-gmp-0.2.0.2","-lgmp","-lHSghc-prim-0.2.0.0","-lHSrts","-lm","-lrt","-ldl","-u","ghczmprim_GHCziTypes_Izh_static_info","-u","ghczmprim_GHCziTypes_Czh_static_info","-u","ghczmprim_GHCziTypes_Fzh_static_info","-u","ghczmprim_GHCziTypes_Dzh_static_info","-u","base_GHCziPtr_Ptr_static_info","-u","base_GHCziWord_Wzh_static_info","-u","base_GHCziInt_I8zh_static_info","-u","base_GHCziInt_I16zh_static_info","-u","base_GHCziInt_I32zh_static_info","-u","base_GHCziInt_I64zh_static_info","-u","base_GHCziWord_W8zh_static_info","-u","base_GHCziWord_W16zh_static_info","-u","base_GHCziWord_W32zh_static_info","-u","base_GHCziWord_W64zh_static_info","-u","base_GHCziStable_StablePtr_static_info","-u","ghczmprim_GHCziTypes_Izh_con_info","-u","ghczmprim_GHCziTypes_Czh_con_info","-u","ghczmprim_GHCziTypes_Fzh_con_info","-u","ghczmprim_GHCziTypes_Dzh_con_info","-u","base_GHCziPtr_Ptr_con_info","-u","base_GHCziPtr_FunPtr_con_info","-u","base_GHCziStable_StablePtr_con_info","-u","ghczmprim_GHCziTypes_False_closure","-u","ghczmprim_GHCziTypes_True_closure","-u","base_GHCziPack_unpackCString_closure","-u","base_GHCziIOziException_stackOverflow_closure","-u","base_GHCziIOziException_heapOverflow_closure","-u","base_ControlziExceptionziBase_nonTermination_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnMVar_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnSTM_closure","-u","base_ControlziExceptionziBase_nestedAtomically_closure","-u","base_GHCziWeak_runFinalizzerBatch_closure","-u","base_GHCziTopHandler_runIO_closure","-u","base_GHCziTopHandler_runNonIO_closure","-u","base_GHCziConcziIO_ensureIOManagerIsRunning_closure","-u","base_GHCziConcziSync_runSparks_closure","-u","base_GHCziConcziSignal_runHandlers_closure","-lHSffi"],Nothing,RtsOptsAll,False,[],[]) And GHC itself uses the readelf command to extract it when deciding whether to relink. The reason for the name ".debug-ghc-link-info" is that sections beginning with ".debug" are removed automatically by strip. This currently only works on Linux; Windows and OS X still have the old behaviour.
-
- 06 Apr, 2011 1 commit
-
-
Simon Marlow authored
to the way stub files were handled.
-