[Git][ghc/ghc][wip/angerman/ghc-9.0-runpath-backport] 8 commits: Care with implicit-parameter superclasses

Ben Gamari gitlab at gitlab.haskell.org
Fri Oct 30 14:59:42 UTC 2020



Ben Gamari pushed to branch wip/angerman/ghc-9.0-runpath-backport at Glasgow Haskell Compiler / GHC


Commits:
7e257575 by Simon Peyton Jones at 2020-10-13T23:35:26+02:00
Care with implicit-parameter superclasses

Two bugs, #18627 and #18649, had the same cause: we were not
account for the fact that a constaint tuple might hide an implicit
parameter.

The solution is not hard: look for implicit parameters in
superclasses.  See Note [Local implicit parameters] in
GHC.Core.Predicate.

Then we use this new function in two places

* The "short-cut solver" in GHC.Tc.Solver.Interact.shortCutSolver
  which simply didn't handle implicit parameters properly at all.
  This fixes #18627

* The specialiser, which should not specialise on implicit parameters
  This fixes #18649

There are some lingering worries (see Note [Local implicit
parameters]) but things are much better.

(cherry picked from commit c7182a5c67fe8b5bd256cb8eb805562636853ea2)

- - - - -
9060a9dd by Ben Gamari at 2020-10-13T23:36:56+02:00
sdist: Include hadrian sources in source distribution

Previously the make build system's source distribution rules neglected
to include Hadrian's sources.

Fixes #18794.

(cherry picked from commit 9657f6f34a1a00008a0db935dbf25733cb483cd4)

- - - - -
fb5eb8ab by Simon Peyton Jones at 2020-10-13T23:37:29+02:00
Fix desugaring of record updates on data families

This fixes a long-standing bug in the desugaring of record
updates for data families, when the latter involves a GADT. It's
all explained in Note [Update for GADTs] in GHC.HsToCore.Expr.

Building the correct cast is surprisingly tricky, as that Note
explains.

Fixes #18809.  The test case (in indexed-types/should_compile/T18809)
contains several examples that exercise the dark corners.

(cherry picked from commit bfdccac6acce84e15292a454d12f4e0d87ef6f10)

- - - - -
64ab97bf by Krzysztof Gogolewski at 2020-10-13T23:39:06+02:00
Add -pgmlm and -optlm flags

!3798 added documentation and semantics for the flags,
but not parsing.

(cherry picked from commit fd302e938ebf48c73d9f715d67ce8cd990f972ff)

- - - - -
b1a2c5e4 by Tamar Christina at 2020-10-16T10:21:20-04:00
winio: add release note

- - - - -
51b09fe4 by Alan Zimmerman at 2020-10-21T23:53:56-04:00
API Annotations: Keep track of unicode for linear arrow notation

The linear arrow can be parsed as `%1 ->` or a direct single token unicode
equivalent.

Make sure that this distinction is captured in the parsed AST by using
IsUnicodeSyntax where it appears, and introduce a new API Annotation,
AnnMult to represent its location when unicode is not used.

Updated haddock submodule

(cherry picked from commit ea736839d85594c95490dcf02d3325c2bbc68f33)

- - - - -
5a2400c6 by Viktor Dukhovni at 2020-10-23T20:51:00-04:00
Naming, value types and tests for Addr# atomics

The atomic Exchange and CAS operations on integral types are updated to
take and return more natural `Word#` rather than `Int#` values.  These
are bit-block not arithmetic operations, and the sign bit plays no
special role.

Standardises the names to `atomic<OpType><ValType>Addr#`, where `OpType` is one
of `Cas` or `Exchange` and `ValType` is presently either `Word` or `Addr`.
Eventually, variants for `Word32` and `Word64` can and should be added,
once #11953 and related issues (e.g. #13825) are resolved.

Adds tests for `Addr#` CAS that mirror existing tests for
`MutableByteArray#`.

- - - - -
7644d85c by Moritz Angermann at 2020-10-30T10:59:36-04:00
[macOS] improved runpath handling

In b592bd98ff25730bbe3c13d6f62a427df8c78e28 we started using
-dead_strip_dylib on macOS when lining dynamic libraries and binaries.
The underlying reason being the Load Command Size Limit in macOS
Sierra (10.14) and later.

GHC will produce @rpath/libHS... dependency entries together with a
corresponding RPATH entry pointing to the location of the libHS...
library. Thus for every library we produce two Load Commands.  One to
specify the dependent library, and one with the path where to find it.
This makes relocating libraries and binaries easier, as we just need to
update the RPATH entry with the install_name_tool. The dynamic linker
will then subsitute each @rpath with the RPATH entries it finds in the
libraries load commands or the environement, when looking up @rpath
relative libraries.

-dead_strip_dylibs intructs the linker to drop unused libraries. This in
turn help us reduce the number of referenced libraries, and subsequently
the size of the load commands.  This however does not remove the RPATH
entries.  Subsequently we can end up (in extreme cases) with only a
single @rpath/libHS... entry, but 100s or more RPATH entries in the Load
Commands.

This patch rectifies this (slighly unorthodox) by passing *no* -rpath
arguments to the linker at link time, but -headerpad 8000.  The
headerpad argument is in hexadecimal and the maxium 32k of the load
command size.  This tells the linker to pad the load command section
enough for us to inject the RPATHs later.  We then proceed to link the
library or binary with -dead_strip_dylibs, and *after* the linking
inspect the library to find the left over (non-dead-stripped)
dependencies (using otool).  We find the corresponding RPATHs for each
@rpath relative dependency, and inject them into the library or binary
using the install_name_tool.  Thus achieving a deadstripped dylib (and
rpaths) build product.

We can not do this in GHC, without starting to reimplement a dynamic
linker as we do not know which symbols and subsequently libraries are
necessary.

Commissioned-by: Mercury Technologies, Inc. (mercury.com)
(cherry picked from commit 89a753308deb2c7ed012e875e220b1d39e1798d8)
Signed-off-by: Moritz Angermann <moritz.angermann at gmail.com>

- - - - -


30 changed files:

- aclocal.m4
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Runtime/Linker.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/SysTools.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Canonical.hs
- compiler/GHC/Tc/Solver/Interact.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/07385545bed6099c7e5b7fd28f0b0a7fa7910fae...7644d85ca21ca8af9cd81d64d6c88afc80e03eb5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/07385545bed6099c7e5b7fd28f0b0a7fa7910fae...7644d85ca21ca8af9cd81d64d6c88afc80e03eb5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201030/12259623/attachment.html>


More information about the ghc-commits mailing list