1. 17 Apr, 2016 2 commits
    • Tamar Christina's avatar
      Add Windows import library support to the Runtime Linker · 97f2b164
      Tamar Christina authored
      Summary:
      Import libraries are files ending in `.dll.a` and `.lib` depending on which
      compiler creates them (GCC, vs MSVC).
      
      Import Libraries are standard `archive` files that contain object files.
      These object files can have two different formats:
      
      1) The normal COFF Object format for object files
          (contains all ascii data and very little program code, so do not
           try to execute.)
      2) "short import" format which just contains a symbol name and
         the dll in which the symbol can be found.
      
      Import Libraries are useful for two things:
      
      1) Allowing applications that don't support dynamic linking to
         link against the import lib (non-short format) which then
         makes calls into the DLL by loading it at runtime.
      
      2) Allow linking of mutually recursive dlls. if `A.DLL` requires
         `B.DLL` and vice versa, import libs can be used to break the cycle
         as they can be created from the expected exports of the DLLs.
      
      A side effect of having these two capabilities is that Import libs are often
      used to hide specific versions of DLLs behind a non-versioned import lib.
      
      e.g. GCC_S.a (non-conventional import lib) will point to the correct
      `libGCC` DLL. With this support Windows Haskell files can now just link
      to `-lGCC_S` and not have to worry about what the actual name of libGCC is.
      
      Also third party libraries such as `icuuc` use import libs to forward to
      versioned DLLs. e.g. `icuuc.lib` points to `icuuc51.dll` etc.
      
      Test Plan:
      ./validate
      
      Two new tests added T11072gcc T11072msvc
      
      Two binary files have been added to the test folder because the "short"
      import library format doesn't seem to be creatable via `dlltool`
      and requires Microsoft's `lib.exe`.
      
      Reviewers: bgamari, RyanGlScott, erikd, goldfire, austin, hvr
      
      Reviewed By: RyanGlScott, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1696
      
      GHC Trac Issues: #11072
      97f2b164
    • Herbert Valerio Riedel's avatar
      4cbae1bd
  2. 16 Apr, 2016 4 commits
    • Herbert Valerio Riedel's avatar
    • Herbert Valerio Riedel's avatar
      Rework CC/CC_STAGE0 handling in `configure.ac` · 865602e0
      Herbert Valerio Riedel authored
      Rather than using the non-standard/idiomatic `--with-{gcc,clang}=...`
      scheme use the `CC=...` style scheme.
      
      The basic idea is to have Autoconf's CC/CFLAG/CPPFLAG apply to
      stage{1,2,3}, while having a separate _STAGE0 set of env-vars
      denote the bootstrap-toolchain flags/programs.
      
      This should be simpler, less confusing, and somewhat more in line with
      Autoconf's idioms (allowing us to reuse more of Autoconf rather than
      (re)inventing our own confusing non-standard m4 macros to do stuff that
      Autoconf could almost do already for us)
      
      Morever, expose CC_STAGE0 as a so-called "precious" variable.
      
      So now we can better control which bootstrapping gcc is used
      (by default the one used by the stage0 ghc, unless CC_STAGE0 is
      overriden)
      
      ```
      Some influential environment variables:
        CC_STAGE0   C compiler command (bootstrap)
        CC          C compiler command
        CFLAGS      C compiler flags
        ...
      
      Use these variables to override the choices made by `configure' or to
      help it to find libraries and programs with nonstandard names/locations.
      ```
      
      Test Plan: I've tested that cross-compiling with
      `--target=powerpc-linux-gnu` still works, and tried a few variants of
      settting `CC=` and `CC_STAGE0=`; `./validate` passed as well
      
      Reviewers: erikd, austin, bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: Phyx, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2078
      865602e0
    • Ben Gamari's avatar
      Bump haddock submodule · f4e65912
      Ben Gamari authored
      f4e65912
    • Herbert Valerio Riedel's avatar
      deriveConstants: Verify sanity of nm · bf17fd0e
      Herbert Valerio Riedel authored
      Add a sanity check ensuring that nm emits valid hexadecimal output, as
      required by POSIX. See #11744 for motivation.
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2113
      
      GHC Trac Issues: #11744
      bf17fd0e
  3. 15 Apr, 2016 16 commits
  4. 14 Apr, 2016 5 commits
    • Joachim Breitner's avatar
      Add a final demand analyzer run right before TidyCore · f4fd98c7
      Joachim Breitner authored
      in order to have precise used-once information in the exported
      strictness signatures, as well as precise used-once information on
      thunks. This avoids the bad effects of #11731.
      
      The subsequent worker-wrapper pass is responsible for removing the
      demand environment part of the strictness signature. It does not run
      after the final demand analyzer pass, so remove this also in CoreTidy.
      
      The subsequent worker-wrapper pass is also responsible for removing
      used-once-information from the demands and strictness signatures, as
      these might not be preserved by the simplifier. This is _not_ done by
      CoreTidy, because we _do_ want this information, as produced by the last
      round of the demand analyzer, to be available to the code generator.
      
      Differential Revision: https://phabricator.haskell.org/D2073
      f4fd98c7
    • Joachim Breitner's avatar
      Add a test case for #11731. · 3a34b5c3
      Joachim Breitner authored
      3a34b5c3
    • niteria's avatar
      Remove some old commented out code in StgLint · 20f90560
      niteria authored
      This looks like some traces of an experiment to check if shadowing is good for
      STG. The code refers to things that don't exist anymore and this part of
      code hasn't been touched for ages, so I think this should be safe to
      remove.
      
      Test Plan: just comments
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D2114
      20f90560
    • niteria's avatar
      Fix typos: tyars -> tyvars · 227a29d1
      niteria authored
      227a29d1
    • niteria's avatar
      Fix commented out debugging code in ByteCodeGen · 49560ba7
      niteria authored
      It changed from VarSet to DVarSet some time ago.
      49560ba7
  5. 12 Apr, 2016 7 commits
    • eir@cis.upenn.edu's avatar
      d81cdc22
    • eir@cis.upenn.edu's avatar
      0b6dcf6d
    • eir@cis.upenn.edu's avatar
      Fix #11797. · dd99f2ec
      eir@cis.upenn.edu authored
      DsMeta curiously omitted quantified tyvars in certain circumstances.
      This patch means it doesn't.
      
      Test case: th/T11797
      dd99f2ec
    • eir@cis.upenn.edu's avatar
      Fix #11811. · b1084fd7
      eir@cis.upenn.edu authored
      Previously, I had forgotten to omit variables already in scope
      from the TypeInType CUSK check. Simple enough to fix.
      
      Test case: typecheck/should_compile/T11811
      b1084fd7
    • Simon Marlow's avatar
      Allocate blocks in the GC in batches · f4446c5b
      Simon Marlow authored
      Avoids contention for the block allocator lock in the GC; this can be
      seen in the gc_alloc_block_sync counter emitted by +RTS -s.
      
      I experimented with this a while ago, and there was already
      commented-out code for it in GCUtils.c, but I've now improved it so that
      it doesn't result in significantly worse memory usage.
      
      * The old method of putting spare blocks on ws->part_list was wasteful,
        the spare blocks are now shared between all generations and retained
        between GCs.
      
      * repeated allocGroup() results in fragmentation, so I switched to using
        allocLargeChunk() instead which is fragmentation-friendly; we already
        use it for the same reason in nursery allocation.
      f4446c5b
    • Simon Marlow's avatar
      Cache the size of part_list/scavd_list (#11783) · 5c4cd0e4
      Simon Marlow authored
      After a parallel GC, it is possible to have a long list of blocks in
      ws->part_list, if we did a lot of work stealing but didn't fill up the
      blocks we stole.  These blocks persist until the next load-balanced GC,
      which might be a long time, and during every GC we were traversing this
      list to find its size.  The fix is to maintain the size all the time, so
      we don't have to compute it.
      5c4cd0e4
    • Simon Marlow's avatar
      Small simplification (#11777) · 83eb4fd9
      Simon Marlow authored
      DEAD_WEAK used to have a different layout, see
      d61c623e
      83eb4fd9
  6. 11 Apr, 2016 6 commits
    • Tamar Christina's avatar
      Add linker notes · c6e579bc
      Tamar Christina authored
      Summary: Add linker notes following #11223 and D1805
      
      Reviewers: austin, bgamari, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2102
      
      GHC Trac Issues: #11223
      c6e579bc
    • Herbert Valerio Riedel's avatar
      Use `@since` annotation in GHC.ExecutionStack · 2ef35d8f
      Herbert Valerio Riedel authored
      While ad532ded fixed the version
      number, this fixes the markup...
      2ef35d8f
    • Ryan Scott's avatar
      Deriving Functor-like classes should unify kind variables · aadde2b9
      Ryan Scott authored
      While the deriving machinery always unifies the kind of the typeclass
      argument with the kind of the datatype, this proves not to be sufficient
      to produce well kinded instances for some poly-kinded datatypes. For
      example:
      
      ```
      newtype Compose (f :: k2 -> *) (g :: k1 -> k2) (a :: k1)
        = Compose (f (g a)) deriving Functor
      ```
      
      would fail because only `k1` would get unified with `*`, causing the
      following
      ill kinded instance to be generated:
      
      ```
      instance (Functor (f :: k2 -> *), Functor (g :: * -> k2)) =>
        Functor (Compose f g) where ...
      ```
      
      To prevent this, we need to take the subtypes and unify their kinds with
      `* -> *`.
      
      Fixes #10524 for good.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, hvr, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2097
      
      GHC Trac Issues: #10524, #10561
      aadde2b9
    • duairc's avatar
      Added (more) missing instances for Identity and Const · 8b57cac5
      duairc authored
        * `Identity` and `Const` now have `Num`, `Real`, `Integral`,
          `Fractional`, `Floating`, `RealFrac` and `RealFloat` instances
      
        * `Identity` and `Const` now have `Bits` and `FiniteBits` instances
      
        * `Identity` and `Const` now have `IsString` instances
      
      Reviewers: RyanGlScott, austin, hvr, bgamari, ekmett
      
      Reviewed By: ekmett
      
      Subscribers: nomeata, ekmett, RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2079
      
      GHC Trac Issues: #11790
      8b57cac5
    • Ryan Scott's avatar
      Filter out invisible kind arguments during TH reification · 02a5c580
      Ryan Scott authored
      Previously, all kind arguments were being reified, which would cause
      something like this:
      
      ```
      type Id a = a
      data Proxy (a :: Id k) = Proxy
      ```
      
      to output
      
      ```
      data Proxy (a :: Id * k) = Proxy
      ```
      
      when `Proxy`'s `Info` is reified. The fix is simple: simply call
      `filterOutInvisibleTypes` on the kind arguments of a kind synonym
      application.
      
      Fixes #11463.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2081
      
      GHC Trac Issues: #11463
      02a5c580
    • Rik Steenkamp's avatar
      Fix a closed type family error message · 46e8f199
      Rik Steenkamp authored
      Now we check whether a closed type family's equation is headed with
      the correct type before we kind-check the equation.
      
      Also, instead of "expected only no parameters" we now generate the
      message "expected no parameters".
      
      Fixes #11623.
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: simonpj, goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2089
      
      GHC Trac Issues: #11623
      46e8f199