1. 29 Nov, 2018 3 commits
    • David Eichmann's avatar
      Hadrian: support dynamically linking ghc · 79d5427e
      David Eichmann authored
      * (#15837 point 5) Use the -rpath gcc option and using the $ORIGIN
      variable which the dynamic linker sets to the location of the ghc
      binary.
      * (#15837 point 4) "-fPIC -dynamic" options are used when building ghc
      when either ghc or the rts have a dynamic way.
      * (#15837 point 7) "-shared -dynload deploy" options are only used when
      linking a library (no longer when linking a program).
      
      Reviewers: bgamari, alpmestan
      
      Reviewed By: alpmestan
      
      Subscribers: adamse, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5281
      79d5427e
    • Alp Mestanogullari's avatar
      Hadrian: bump Cabal submodule, install extra dynamic flavours of RTS · fb997160
      Alp Mestanogullari authored
      Previously, Hadrian was building all the appropriate dynamic ways for
      libHSrts
      but they were not picked up and installed in the package database when
      we register the rts library. Since we use Cabal for registering
      packages and
      the .cabal files of packages as sources of truth for configuring and
      installing,
      we ended up patching Cabal to add a new field,
      'extra-dynamic-library-flavours',
      to specify those extra flavours to install in .cabal files:
      
          https://github.com/haskell/cabal/pull/5606
      
      We now make use of this in rts.cabal.in to expose dynamic flavours
      behind a
      Cabal flag, which Hadrian will use whenever we are building a GHC
      flavour that
      requires dynamic libraries.
      
      This is all part of a larger plan to build a dynamic stage 2 GHC by
      default,
      like with make, which in turn will fix a lot of test failures. See
      
      Test Plan:
      hadrian/build.sh _build/stage1/lib/package.conf.d/rts-1.0.conf
      _build/stage1/lib/x86_64-.../ should contain many libHSrts-*.so
      
      Reviewers: snowleopard, DavidEichmann, bgamari, erikd, simonmar
      
      Reviewed By: snowleopard, DavidEichmann
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15837
      
      Differential Revision: https://phabricator.haskell.org/D5385
      fb997160
    • Simon Peyton Jones's avatar
      Test Trac #15943 · 1235ca95
      Simon Peyton Jones authored
      This test seems to work in HEAD
      1235ca95
  2. 28 Nov, 2018 2 commits
    • Simon Peyton Jones's avatar
      Comments only · e08d34bb
      Simon Peyton Jones authored
      e08d34bb
    • Sebastian Graf's avatar
      Add Note [Dead case binders in -O0] · 4c8bf63b
      Sebastian Graf authored
      After reverting Phab:D5358, Simon (Peyton Jones) asked for a Note
      summarising why we want to keep the dead case binder check in `cgCase`.
      
      Summary from mail conversation:
      
      * Phab:D5324 means that we no longer /recompute/ dead-ness of case-binders in
        STG-land
      
      * But TidyPgm preserves dead-ness info (see CoreTidy.tidyIdBndr)
      
      * And so we can take advantage of it to avoid a redundant load. This load
        would be eliminated by CmmSink, but that only happens with -O
      4c8bf63b
  3. 27 Nov, 2018 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: improve bindist rule · 8f52ab92
      Alp Mestanogullari authored
      As outlined in #15925, hadrian bindists had not made a clear choice with
      respect to relocatable GHCs and wrapper scripts. This commit implements
      the policy described in the ticket. That is:
      
      - the bindists ship {bin, lib} as they are, modulo the addition of
        haddock from stage2/bin
      - we now _always_ generate wrapper scripts for all the programs that
        are in the bindist's bin/ directory
      
      The idea being that anyone on Linux/Windows/OS X can just unpack
      the binary distribution anywhere and start using bin/ghc, while the
      installation process systematicaly generates wrapper scripts.
      
      Test Plan: hadrian/build.sh binary-dist ; cd
      _build/bindist/ghc-X.Y.Z-arch/; configure --prefix=/tmp/foo && make
      install
      
      Reviewers: snowleopard, bgamari, angerman
      
      Reviewed By: snowleopard, bgamari, angerman
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15925
      
      Differential Revision: https://phabricator.haskell.org/D5371
      8f52ab92
  4. 26 Nov, 2018 5 commits
    • Ryan Scott's avatar
      Fix #15941 by only special-casing visible infix applications · 984b75de
      Ryan Scott authored
      Summary:
      The iface pretty-printer had a special case for an
      application of an infix type constructor to two arguments. But this
      didn't take the visibilities of the arguments into account, which
      could lead to strange output like `@{LiftedRep} -> @{LiftedRep}` when
      `-fprint-explicit-kinds` was enabled (#15941). The fix is relatively
      straightforward: simply plumb through the visibilities of each
      argument, and only trigger the special case for infix applications
      if both arguments are visible (i.e., required).
      
      Test Plan: make test TEST=T15941
      
      Reviewers: goldfire, bgamari, monoidal
      
      Reviewed By: goldfire, monoidal
      
      Subscribers: simonpj, rwbarton, carter
      
      GHC Trac Issues: #15941
      
      Differential Revision: https://phabricator.haskell.org/D5375
      984b75de
    • Ryan Scott's avatar
      Use autoconf to generate version numbers for libiserv and friends · 8f9f52d8
      Ryan Scott authored
      Summary:
      Currently, the version numbers for `libiserv`, `iserv`, and
      `iserv-proxy` are hard-coded directly into their `.cabal` files.
      These are easy to forget to update, and in fact, this has already
      happened once (see #15866). Let's use `autoconf` to do this for us
      so that it is not forgotten in the future.
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, erikd, carter
      
      GHC Trac Issues: #15866
      
      Differential Revision: https://phabricator.haskell.org/D5302
      8f9f52d8
    • Ryan Scott's avatar
      Print explicit foralls in type family eqns when appropriate · f932b1aa
      Ryan Scott authored
      Summary:
      When `-fprint-explicit-foralls` is enabled, type family
      equations are either printed without an explict `forall` entirely,
      or with a bizarre square bracket syntax (in the case of closed type
      families). I find neither satisfying, so in this patch, I introduce
      support for printing explicit `forall`s in open type-family, closed
      type-family, and data-family equations when appropriate. (By "when
      appropriate", I refer to the conditions laid out in
      `Note [When to print foralls]` in `IfaceType`.)
      
      One tricky point in the implementation is that I had to pick a
      visibility for each type variable in a `CoAxiom`/`FamInst` in order
      to be able to pass it to `pprUserIfaceForAll` //et al.// Because
      the type variables in a type family instance equation can't be
      instantiated by the programmer anyway, the choice only really matters
      for pretty-printing purposes, so I simply went with good ol'
      trustworthy `Specified`. (This design choice is documented in
      `Note [Printing foralls in type family instances]` in `IfaceType`.)
      
      Test Plan: make test TEST=T15827
      
      Reviewers: goldfire, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, carter
      
      GHC Trac Issues: #15827
      
      Differential Revision: https://phabricator.haskell.org/D5282
      f932b1aa
    • Ömer Sinan Ağacan's avatar
      Fix build on darwin · df570d92
      Ömer Sinan Ağacan authored
      CPP error introduced with b2950e03
      df570d92
    • Ömer Sinan Ağacan's avatar
      Revert "Remove redundant check in cgCase" · 8a6aa877
      Ömer Sinan Ağacan authored
      This reverts commit d13b7d60.
      
      (See discussion in D5358)
      8a6aa877
  5. 25 Nov, 2018 1 commit
  6. 24 Nov, 2018 5 commits
  7. 23 Nov, 2018 10 commits
  8. 22 Nov, 2018 13 commits
    • David Eichmann's avatar
      Fix unused-import warnings · 6353efc7
      David Eichmann authored
      This patch fixes a fairly long-standing bug (dating back to 2015) in
      RdrName.bestImport, namely
      
         commit 9376249b
         Author: Simon Peyton Jones <simonpj@microsoft.com>
         Date:   Wed Oct 28 17:16:55 2015 +0000
      
         Fix unused-import stuff in a better way
      
      In that patch got the sense of the comparison back to front, and
      thereby failed to implement the unused-import rules described in
        Note [Choosing the best import declaration] in RdrName
      
      This led to Trac #13064 and #15393
      
      Fixing this bug revealed a bunch of unused imports in libraries;
      the ones in the GHC repo are part of this commit.
      
      The two important changes are
      
      * Fix the bug in bestImport
      
      * Modified the rules by adding (a) in
           Note [Choosing the best import declaration] in RdrName
        Reason: the previosu rules made Trac #5211 go bad again.  And
        the new rule (a) makes sense to me.
      
      In unravalling this I also ended up doing a few other things
      
      * Refactor RnNames.ImportDeclUsage to use...
      6353efc7
    • Krzysztof Gogolewski's avatar
      Don't pass -no-pie when -pgmc is supplied · 8d008b71
      Krzysztof Gogolewski authored
      Test Plan: validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15319
      
      Differential Revision: https://phabricator.haskell.org/D5317
      8d008b71
    • Alec Theriault's avatar
      Simplify 'ExtBits' in the lexer · d2fbc33c
      Alec Theriault authored
      The main change is to export 'ExtBits' instead of defining/exporting a
      bunch of boilerplate functions that test for a particular 'ExtBits'.
      In the process, I also
      
        * cleaned up an unneeded special case for 'ITstatic'
        * made 'UsePosPrags' another variant of 'ExtBits'
        * made the logic in 'reservedSymsFM' match that of 'reservedWordsFM'
      
      Test Plan: make test
      
      Reviewers: bgamari, alanz
      
      Subscribers: sjakobi, rwbarton, mpickering, carter
      
      Differential Revision: https://phabricator.haskell.org/D5332
      d2fbc33c
    • Alec Theriault's avatar
      'DynFlag'-free version of 'mkParserFlags' · 5aa29231
      Alec Theriault authored
      Obtaining a `DynFlags` is difficult, making using the lexer/parser
      for pure parsing/lexing unreasonably difficult, even with
      `mkPStatePure`.
      This is despite the fact that we only really need
      
        * language extension flags
        * warning flags
        * a handful of boolean options
      
      The new `mkParserFlags'` function makes is easier to directly construct
      a `ParserFlags`. Furthermore, since `pExtsBitmap` is just a footgun,
      I've gone ahead and made `ParserFlags` an abstract type.
      
      Reviewers: bgamari, alanz, sjakobi
      
      Reviewed By: bgamari, sjakobi
      
      Subscribers: mpickering, sjakobi, rwbarton, carter
      
      GHC Trac Issues: #11301
      
      Differential Revision: https://phabricator.haskell.org/D5269
      5aa29231
    • Alec Theriault's avatar
      Doc-only fixes · a1bbb56f
      Alec Theriault authored
      * laws are capitalized definition lists, no emphasis on the labels
      * adds missing hyperlinks
      * fixes other misc. Haddock markup issues.
      a1bbb56f
    • Peter Trommler's avatar
      9f3e22b9
    • Dario Bertini's avatar
      25489085
    • Dario Bertini's avatar
      rts/MachO: A bit of refactoring in ocGetNames · b2f6f896
      Dario Bertini authored
      Eliminates a bit of repetition.
      b2f6f896
    • Dario Bertini's avatar
      9e0a23b9
    • Dario Bertini's avatar
      circleci: Actually build with in-tree GMP on Darwin · 3584bd42
      Dario Bertini authored
      Fixes #15404.
      3584bd42
    • Gabor Greif's avatar
      llvmGen: Eliminate duplicate definition · d0fc7618
      Gabor Greif authored
      remove local
      d0fc7618
    • Jessica Clarke's avatar
      UNREG: PprC: Add support for adjacent floats · 35a89778
      Jessica Clarke authored
      When two 32-bit floats are adjacent for a 64-bit target, there is no
      padding between them to force alignment, so we must combine their bit
      representations into a single word.
      
      Reviewers: bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15853
      
      Differential Revision: https://phabricator.haskell.org/D5306
      35a89778
    • Ryan Scott's avatar
      Overhaul -fprint-explicit-kinds to use VKA · f5d20838
      Ryan Scott authored
      This patch changes the behavior of `-fprint-explicit-kinds`
      so that it displays kind argument using visible kind application.
      In other words, the flag now:
      
      1. Prints instantiations of specified variables with `@(...)`.
      2. Prints instantiations of inferred variables with `@{...}`.
      
      In addition, this patch removes the `Use -fprint-explicit-kinds to
      see the kind arguments` error message that often arises when a type
      mismatch occurs due to different kinds. Instead, whenever there is a
      kind mismatch, we now enable the `-fprint-explicit-kinds` flag
      locally to help cue to the programmer where the error lies.
      (See `Note [Kind arguments in error messages]` in `TcErrors`.)
      As a result, these funny `@{...}` things can now appear to the user
      even without turning on the `-fprint-explicit-kinds` flag explicitly,
      so I took the liberty of documenting them in the users' guide.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15871
      
      Differential Revision: https://phabricator.haskell.org/D5314
      f5d20838