1. 24 Jun, 2019 5 commits
    • Krzysztof Gogolewski's avatar
      Fix missing unboxed tuple RuntimeReps (#16565) · 9d9eb267
      Krzysztof Gogolewski authored
      Unboxed tuples and sums take extra RuntimeRep arguments,
      which must be manually passed in a few places.
      This was not done in deSugar/Check.
      
      This error was hidden because zipping functions in TyCoRep
      ignored lists with mismatching length. This is now fixed;
      the lengths are now checked by calling zipEqual.
      
      As suggested in #16565, I moved checking for isTyVar and
      isCoVar to zipTyEnv and zipCoEnv.
      
      (cherry picked from commit 69b16331)
      9d9eb267
    • Sergei Trofimovich's avatar
      powerpc32: fix stack allocation code generation · 8a9cbe08
      Sergei Trofimovich authored
      When ghc was built for powerpc32 built failed as:
      
      It's a fallout of commit 3f46cffc
      
      
      ("PPC NCG: Refactor stack allocation code") where
      word size used to be
          II32/II64
      and changed to
          II8/panic "no width for given number of bytes"
          widthFromBytes ((platformWordSize platform) `quot` 8)
      
      The change restores initial behaviour by removing extra division.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      (cherry picked from commit bb2ee86a)
      8a9cbe08
    • Sergei Trofimovich's avatar
      powerpc32: fix 64-bit comparison (#16465) · 7ed5db87
      Sergei Trofimovich authored
      
      
      On powerpc32 64-bit comparison code generated dangling
      target labels. This caused ghc build failure as:
      
          $ ./configure --target=powerpc-unknown-linux-gnu && make
          ...
          SCCs aren't in reverse dependent order
          bad blockId n3U
      
      This happened because condIntCode' in PPC codegen generated
      label name but did not place the label into `cmp_lo` code block.
      
      The change adds the `cmp_lo` label into the case of negative
      comparison.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      (cherry picked from commit 973077ac)
      7ed5db87
    • Moritz Angermann's avatar
      llvm-targets: Add x86_64 android layout · 3d0fa737
      Moritz Angermann authored
      (cherry picked from commit e87b9f87)
      3d0fa737
    • Ben Gamari's avatar
      Fix T16737 · 5edcf949
      Ben Gamari authored
      * Disable in profasm way when GHC is dynamically linked
      * Drop -optcxx as fix for #16477 is not present in 8.8
      5edcf949
  2. 23 Jun, 2019 9 commits
    • Zejun Wu's avatar
      Pass preprocessor options to C compiler when building foreign C files (#16737) · 1c18d3b4
      Zejun Wu authored
      (cherry picked from commit cfd3e0f1)
      1c18d3b4
    • Ben Gamari's avatar
      testsuite: Add test for #16514 · c1c0ce7a
      Ben Gamari authored
      (cherry picked from commit 41bf4045)
      c1c0ce7a
    • Iavor S. Diatchki's avatar
      Add a `NOINLINE` pragma on `someNatVal` (#16586) · ab8a4a3a
      Iavor S. Diatchki authored
      This fixes #16586, see `Note [NOINLINE someNatVal]` for details.
      
      (cherry picked from commit 59f4cb6f)
      ab8a4a3a
    • Yuriy Syrovetskiy's avatar
      Replace git.haskell.org with gitlab.haskell.org (#16196) · 04a27889
      Yuriy Syrovetskiy authored
      (cherry picked from commit 75abaaea)
      04a27889
    • Shayne Fletcher's avatar
      Make Extension derive Bounded · bdb70d2e
      Shayne Fletcher authored
      (cherry picked from commit 9047f184)
      bdb70d2e
    • Ben Gamari's avatar
      ghci: Ensure that system libffi include path is searched · 0988b193
      Ben Gamari authored
      Previously hsc2hs failed when building against a system FFI.
      
      (cherry picked from commit 1abb76ab)
      0988b193
    • Ben Gamari's avatar
      users guide: Mention supported LLVM version · 0b1519b3
      Ben Gamari authored
      0b1519b3
    • Simon Peyton Jones's avatar
      Add a missing update of sc_hole_ty (#16312) · 589ad602
      Simon Peyton Jones authored
      In simplCast I totally failed to keep the sc_hole_ty field of
      ApplyToTy (see Note [The hole type in ApplyToTy]) up to date.
      When a cast goes by, of course the hole type changes.
      
      Amazingly this has not bitten us before, but #16312 finally
      triggered it.  Fortunately the fix is simple.
      
      Fixes #16312.
      
      (cherry picked from commit ef36b102)
      589ad602
    • Michael Peyton Jones's avatar
      Visibility: handle multiple units with the same name · 856cdb9d
      Michael Peyton Jones authored
      Fixes #16228. The included test case is adapted from the reproduction in
      the issue, and fails without this patch.
      
      ------
      
      We compute an initial visilibity mapping for units based on what is
      present in the package databases. To seed this, we compute a set of all
      the package configs to add visibilities for.
      
      However, this set was keyed off the unit's *package name*. This is
      correct, since we compare packages across databases by version. However,
      we would only ever consider a single, most-preferable unit from the
      database in which it was found.
      
      The effect of this was that only one of the libraries in a Cabal package
      would be added to this initial set. This would cause attempts to use
      modules from the omitted libraries to fail, claiming that the package
      was hidden (even though `ghc-pkg` would correctly show it as visible).
      
      A solution is to do the selection of the most preferable packages
      separately, and then be sure to consider exposing all units in the
      same package in the same package db. We can do this by picking a
      most-preferable unit for each package name, and then considering
      exposing all units that are equi-preferable with that unit.
      
      ------
      
      Why wasn't this bug apparent to all people trying to use sub-libraries
      in Cabal? The answer is that Cabal explicitly passes `-package` and
      `-package-id` flags for all the packages it wants to use, rather than
      relying on the state of the package database. So this bug only really
      affects people who are trying to use package databases produced by Cabal
      outside of Cabal itself.
      
      One particular example of this is the way that the
      Nixpkgs Haskell infrastructure provides wrapped GHCs: typically these
      are equipped with a package database containing all the needed
      package dependencies, and the user is not expected to pass
      `-package` flags explicitly.
      
      (cherry picked from commit 8a20bfc2)
      856cdb9d
  3. 22 Jun, 2019 1 commit
  4. 21 Jun, 2019 1 commit
  5. 19 Jun, 2019 2 commits
    • Richard Eisenberg's avatar
      Fix #16517 by bumping the TcLevel for method sigs · 4a5ab8f0
      Richard Eisenberg authored
      There were actually two bugs fixed here:
      
      1. candidateQTyVarsOfType needs to be careful that it does not
         try to zap metavariables from an outer scope as "naughty"
         quantification candidates. This commit adds a simple check
         to avoid doing so.
      
      2. We weren't bumping the TcLevel in kcHsKindSig, which was used
         only for class method sigs. This mistake led to the acceptance
         of
      
           class C a where
             meth :: forall k. Proxy (a :: k) -> ()
      
         Note that k is *locally* quantified. This patch fixes the
         problem by using tcClassSigType, which correctly bumps the
         level. It's a bit inefficient because tcClassSigType does other
         work, too, but it would be tedious to repeat much of the code
         there with only a few changes. This version works well and is
         simple.
      
      And, while updating comments, etc., I noticed that tcRnType was
      missing a pushTcLevel, leading to #16767, which this patch also
      fixes, by bumping the level. In the refactoring here, I also
      use solveEqualities. This initially failed ghci/scripts/T15415,
      but that was fixed by teaching solveEqualities to respect
      -XPartialTypeSignatures.
      
      This patch also cleans up some Notes around error generation that
      came up in conversation.
      
      Test case: typecheck/should_fail/T16517, ghci/scripts/T16767
      
      (cherry picked from commit a22e51ea)
      (cherry picked from commit 19ab32c5)
      4a5ab8f0
    • Simon Peyton Jones's avatar
      Fail fast in solveLocalEqualities · ce6a492b
      Simon Peyton Jones authored
      This patch makes us fail fast in TcSimplify.solveLocalEqualities,
      and in TcHsType.tc_hs_sig_type, if there are insoluble constraints.
      
      Previously we ploughed on even if there were insoluble constraints,
      leading to a cascade of hard-to-understand type errors. Failing
      eagerly is much better; hence a lot of testsuite error message
      changes.  Eg if we have
                f :: [Maybe] -> blah
                f xs = e
      then trying typecheck 'f x = e' with an utterly bogus type
      is just asking for trouble.
      
      I can't quite remember what provoked me to make this change,
      but I think the error messages are notably improved, by
      removing confusing clutter and focusing on the real error.
      
      (cherry picked from commit 5c1f268e)
      ce6a492b
  6. 18 Jun, 2019 1 commit
  7. 17 Jun, 2019 1 commit
    • Peter Trommler's avatar
      RTS: Add missing memory barrier · 2df05448
      Peter Trommler authored
      In the work stealing queue a load-load-barrier is required to ensure
      that a read of queue data cannot be reordered before a read of the
      bottom pointer into the queue.
      
      The added load-load-barrier ensures that the ordering of writes enforced
      at the end of `pushWSDeque` is also respected in the order of reads in
      `stealWSDeque_`. In other words, when reading `q->bottom` we want to make
      sure that we see the updates to `q->elements`.
      
      Fixes #13633
      
      (cherry picked from commit 5c084e04)
      2df05448
  8. 16 Jun, 2019 6 commits
  9. 15 Jun, 2019 3 commits
    • Ben Gamari's avatar
      PrelRules: Don't break let/app invariant in shiftRule · fee015b5
      Ben Gamari authored
      Previously shiftRule would rewrite as invalid shift like
      ```
      let x = I# (uncheckedIShiftL# n 80)
      in ...
      ```
      to
      ```
      let x = I# (error "invalid shift")
      in ...
      ```
      However, this breaks the let/app invariant as `error` is not
      okay-for-speculation. There isn't an easy way to avoid this so let's not
      try. Instead we just take advantage of the undefined nature of invalid
      shifts and return zero.
      
      Fixes #16742.
      
      (cherry picked from commit 0bd3b9dd)
      fee015b5
    • Ben Gamari's avatar
      users-guide: More release notes · 4b40bad6
      Ben Gamari authored
      4b40bad6
    • Iustin Pop's avatar
      Fix typo in 8.8.1 notes related to traceBinaryEvent · ed342f36
      Iustin Pop authored
      - fixes double mention of `traceBinaryEvent#` (the second one should be `traceEvent#`, I think)
      - fixes note about `traceEvent#` taking a `String` - the docs say it takes a zero-terminated ByteString.
      
      (cherry picked from commit 63150b9e)
      ed342f36
  10. 13 Jun, 2019 3 commits
  11. 12 Jun, 2019 8 commits
    • Ben Gamari's avatar
      rts/linker: Use mmapForLinker to map PLT · 8c862c07
      Ben Gamari authored
      The PLT needs to be located within a close distance of
      the code calling it under the small memory model.
      
      Fixes #16784.
      
      (cherry picked from commit 0b7f81f5)
      8c862c07
    • Ben Gamari's avatar
      llvm-targets: Add armv7l-unknown-linux-gnueabi · ba667f6b
      Ben Gamari authored
      Fixes #15208.
      
      [skip ci]
      
      (cherry picked from commit 9b4ff57d)
      ba667f6b
    • Ben Gamari's avatar
      rts/linker: Only mprotect GOT after it is filled · 2e8be92b
      Ben Gamari authored
      This fixes a regression, introduced by 67c422ca, where we mprotect'd the
      global offset table (GOT) region to PROT_READ before we had finished
      filling it, resulting in a linker crash.
      
      Fixes #16779.
      
      (cherry picked from commit 217e6db4)
      2e8be92b
    • Ben Gamari's avatar
      rts/linker: Make elf_got.c a bit more legible · e628c7be
      Ben Gamari authored
      (cherry picked from commit bbc752c5)
      e628c7be
    • Phuong Trinh's avatar
      Use binary search to speedup checkUnload · ce1e6538
      Phuong Trinh authored
      We are iterating through all object code for each heap objects when
      checking whether object code can be unloaded. For large projects in
      GHCi, this can be very expensive due to the large number of object code
      that needs to be loaded/unloaded. To speed it up, this arrangess all
      mapped sections of unloaded object code in a sorted array and use binary
      search to check if an address location fall on them.
      
      (cherry picked from commit f81f3964)
      ce1e6538
    • Takenobu Tani's avatar
      Add `-haddock` to prepare-system.sh and .gitlab-ci.yml · ca7173a9
      Takenobu Tani authored
      To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option
      to `.circleci/prepare-system.sh` and .gitlab-ci.yml.
      after including `mk/flavours/*`.
      
      (cherry picked from commit c4f94320)
      ca7173a9
    • Takenobu Tani's avatar
      Add `-haddock` to perf.mk rather than prepare-system.sh · b51f9ecd
      Takenobu Tani authored
      To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option
      to `mk/flavours/perf.mk` rather than `.circleci/prepare-system.sh`.
      
      Because in windows condition of ghc-8.9, `mk/flavours/*` is included
      after `prepare-system.sh`.
      
      In addition, in linux condition of ghc-8.6, `mk/flavors/perf.mk` is used.
      
      (cherry picked from commit 43a39c3c)
      b51f9ecd
    • Takenobu Tani's avatar
      Add `-haddock` option under ci condition to fix #16415 · c4b501b1
      Takenobu Tani authored
      In order to use the `:doc` command in ghci, it is necessary
      to compile for core libraries with `-haddock` option.
      
      Especially, the `-haddock` option is essential for release building.
      
      Note:
        * The `-haddock` option may affect compile time and binary size.
        * But hadrian has already set `-haddock` as the default.
        * This patch affects the make-based building.
      
      This patch has been split from !532.
      
      (cherry picked from commit 33e37d06)
      c4b501b1