1. 20 Oct, 2011 1 commit
  2. 19 Oct, 2011 1 commit
  3. 13 Oct, 2011 1 commit
  4. 11 Oct, 2011 1 commit
  5. 06 Oct, 2011 2 commits
    • Ian Lynagh's avatar
      Use -no_compact_unwind on OS X x86 (as well as x86_64) · be6e231c
      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
      be6e231c
    • Ian Lynagh's avatar
      Silence "text reloc" warnings on OS X / x86 · 20705dff
      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.
      20705dff
  6. 21 Aug, 2011 1 commit
  7. 10 Aug, 2011 2 commits
  8. 06 Aug, 2011 1 commit
  9. 03 Aug, 2011 1 commit
  10. 27 Jul, 2011 1 commit
  11. 20 Jul, 2011 1 commit
    • Simon Marlow's avatar
      Fix #481: use a safe recompilation check when Template Haskell is · 48bc81ad
      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
      48bc81ad
  12. 15 Jul, 2011 2 commits
    • Ian Lynagh's avatar
      Remove more defaultTargetPlatform uses · ec7b7512
      Ian Lynagh authored
      ec7b7512
    • Sergei Trofimovich's avatar
      An example of failure: · 3b322660
      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: default avatarSergei Trofimovich <slyfox@gentoo.org>
      3b322660
  13. 01 Jul, 2011 1 commit
  14. 30 Jun, 2011 1 commit
  15. 27 Jun, 2011 1 commit
  16. 18 Jun, 2011 2 commits
    • dterei's avatar
      SafeHaskell: Transitively check safety when compiling a module. · 77d85a4a
      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.
      77d85a4a
    • dterei's avatar
      SafeHaskell: Disable certain ghc extensions in Safe. · 45c64c1d
      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.
      45c64c1d
  17. 31 May, 2011 1 commit
  18. 08 May, 2011 1 commit
  19. 07 May, 2011 2 commits
  20. 04 May, 2011 1 commit
    • dterei's avatar
      LLVM: Support LLVM 2.9 (#5103) · 50e0db45
      dterei authored
      Instead of using the GNU As subsection feature on Linux/Windows
      for TNTC we now use the LLVM Mangler on all platforms.
      50e0db45
  21. 01 May, 2011 1 commit
  22. 29 Apr, 2011 1 commit
    • Ian Lynagh's avatar
      Add "C compiler flags" to settings file · feabe993
      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.
      feabe993
  23. 26 Apr, 2011 1 commit
  24. 21 Apr, 2011 1 commit
  25. 17 Apr, 2011 1 commit
  26. 14 Apr, 2011 1 commit
  27. 12 Apr, 2011 2 commits
    • Simon Marlow's avatar
      Change the way module initialisation is done (#3252, #4417) · a52ff761
      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 ...
      a52ff761
    • Simon Marlow's avatar
      Cleanup sweep and fix a bug in RTS flag processing. · 5463b55b
      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.
      5463b55b
  28. 08 Apr, 2011 1 commit
    • Simon Marlow's avatar
      Force re-linking if the options have changed (#4451) · 814edf44
      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.
      814edf44
  29. 06 Apr, 2011 1 commit
  30. 05 Apr, 2011 2 commits
    • Simon Marlow's avatar
      fix warning · 3745ba90
      Simon Marlow authored
      3745ba90
    • Simon Marlow's avatar
      Merge _stub.o files into the main .o file (Fixes #3687 and #706) · 7b0ff179
      Simon Marlow authored
      Now GHC still generates the _stub.c files, but the object file is
      automatically merged into the main .o file for a module.  This means
      that build systems (including GHC's own) no longer need to worry about
      looking for _stub.o files and including them when linking.
      
      I had to do lots of refactoring in DriverPipeline to make this work;
      now there's a monad to carry around all the information, and
      everything is a lot tidier.
      
      The _stub.c is now created as a temporary file and removed after
      compilation (unless the -keep-tmp-files flag is on).
      7b0ff179
  31. 04 Apr, 2011 2 commits
  32. 09 Mar, 2011 1 commit