[Git][ghc/ghc][wip/backports-9.8] 13 commits: JS: Improve compatibility with recent emsdk

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Tue Aug 8 15:23:07 UTC 2023



Ben Gamari pushed to branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC


Commits:
14ed9727 by Luite Stegeman at 2023-08-08T11:22:56-04:00
JS: Improve compatibility with recent emsdk

The JavaScript code in libraries/base/jsbits/base.js had some
hardcoded offsets for fields in structs, because we expected
the layout of the data structures to remain unchanged. Emsdk
3.1.42 changed the layout of the stat struct, breaking this
assumption, and causing code in .hsc files accessing the
stat struct to fail.

This patch improves compatibility with recent emsdk by
removing the assumption that data layouts stay unchanged:

    1. offsets of fields in structs used by JavaScript code are
       now computed by the configure script, so both the .js and
       .hsc files will automatically use the new layout if anything
       changes.
    2. the distrib/configure script checks that the emsdk version
       on a user's system is the same version that a bindist was
       booted with, to avoid data layout inconsistencies

See #23641

(cherry picked from commit aa07402e9ba5a302ada9b3cecebf7fdc00aa31dd)

- - - - -
2c66f7b0 by Aaron Allen at 2023-08-08T11:22:56-04:00
[#23663] Show Flag Suggestions in GHCi

Makes suggestions when using `:set` in GHCi with a misspelled flag. This
mirrors how invalid flags are handled when passed to GHC directly. Logic
for producing flag suggestions was moved to GHC.Driver.Sesssion so it
can be shared.

resolves #23663

(cherry picked from commit a1899d8f446db6b8c59576b8e3ef1910823592b1)

- - - - -
a91d6d99 by Ben Gamari at 2023-08-08T11:22:56-04:00
testsuite: Mark MulMayOflo_full as broken rather than skipping

To ensure that we don't accidentally fix it.

See #23742.

(cherry picked from commit fd7ce39c70f8922e26b8be8a5fc4d6797987f66f)

- - - - -
523541f3 by Ben Gamari at 2023-08-08T11:22:56-04:00
nativeGen/AArch64: Fix sign extension in MulMayOflo

Previously the 32-bit implementations of MulMayOflo would use the
a non-sensical sign-extension mode. Rewrite these to reflect what gcc 11
produces. Also similarly rework the 16- and 8-bit cases.

This now passes the MulMayOflo tests in ghc/test-primops> in all four
widths, including the precision tests.

Fixes #23721.

(cherry picked from commit 824092f28f52d32b6ea3cd26e1e576524ee24969)

- - - - -
ebd818a8 by sheaf at 2023-08-08T11:22:56-04:00
Update inert_solved_dicts for ImplicitParams

When adding an implicit parameter dictionary to the inert set, we must
make sure that it replaces any previous implicit parameter dictionaries
that overlap, in order to get the appropriate shadowing behaviour, as in

  let ?x = 1 in let ?x = 2 in ?x

We were already doing this for inert_cans, but we weren't doing the same
thing for inert_solved_dicts, which lead to the bug reported in #23761.

The fix is thus to make sure that, when handling an implicit parameter
dictionary in updInertDicts, we update **both** inert_cans and
inert_solved_dicts to ensure a new implicit parameter dictionary
correctly shadows old ones.

Fixes #23761

(cherry picked from commit 41bf2c09f17aa00bf4dd13332c6d07adf21af4f8)

- - - - -
f16b9ac8 by Jan Hrček at 2023-08-08T11:22:56-04:00
Fix haddock markup in code example for coerce

(cherry picked from commit 1b15dbc4e6ee5af87cc8b36c9a50287ae5d16b03)

- - - - -
a0090ea2 by Sylvain Henry at 2023-08-08T11:22:56-04:00
JS: implement getMonotonicTime (fix #23687)

(cherry picked from commit 33598ecb624867dce36a71b265c054b689ed9701)

- - - - -
de1ac62a by Matthew Pickering at 2023-08-08T11:22:56-04:00
Fix pretty printing of WARNING pragmas

There is still something quite unsavoury going on with WARNING pragma
printing because the printing relies on the fact that for decl
deprecations the SourceText of WarningTxt is empty. However, I let that
lion sleep and just fixed things directly.

Fixes #23465

(cherry picked from commit 822ef66b54bd48df7c01fcafb99b7694952cae28)

- - - - -
8d95542a by Matthew Craven at 2023-08-08T11:22:56-04:00
Kill off gen_bytearray_addr_access_ops.py

The relevant primop descriptions are now
generated directly by genprimopcode.

This makes progress toward fixing #23490, but it is not
a complete fix since there is more than one way in which
cabal-reinstall (hadrian/build build-cabal) is broken.

(cherry picked from commit 32cae784b7bfcb6562a9ad041e7608dbcf0f5d72)

- - - - -
d95f76b3 by Jens Petersen at 2023-08-08T11:22:56-04:00
user_guide/flags.py: python-3.12 no longer includes distutils

packaging.version seems able to handle this fine

(cherry picked from commit 026991d7fcf9e3ce013081ab6d1e3d2200b694bb)

- - - - -
a7672967 by Matthew Pickering at 2023-08-08T11:22:56-04:00
simplifier: Correct InScopeSet in rule matching

The in-scope set passedto the `exprIsLambda_maybe` call lacked all the
in-scope binders. @simonpj suggests this fix where we augment the
in-scope set with the free variables of expression which fixes this
failure mode in quite a direct way.

Fixes #23630

(cherry picked from commit 4f5538a8e2a8b9bc490bcd098fa38f6f7e9f4d73)

- - - - -
092ad8f5 by Ilias Tsitsimpis at 2023-08-08T11:22:57-04:00
ghc-prim: Link against libatomic

Commit b4d39adbb58 made 'hs_cmpxchg64()' available to all architectures.
Unfortunately this made GHC to fail to build on armel, since armel needs
libatomic to support atomic operations on 64-bit word sizes.

Configure libraries/ghc-prim/ghc-prim.cabal to link against libatomic,
the same way as we do in rts/rts.cabal.

(cherry picked from commit fc186b0c0ac56d6ff6225d3f6607be37770fcb52)

- - - - -
abd9bf76 by Matthew Pickering at 2023-08-08T11:22:57-04:00
Allow users to override non-essential haddock options in a Flavour

We now supply the non-essential options to haddock using the `extraArgs`
field, which can be specified in a Flavour so that if an advanced user
wants to change how documentation is generated then they can use
something other than the `defaultHaddockExtraArgs`.

This does have the potential to regress some packaging if a user has
overridden `extraArgs` themselves, because now they also need to add
the haddock options to extraArgs. This can easily be done by appending
`defaultHaddockExtraArgs` to their extraArgs invocation but someone
might not notice this behaviour has changed.

In any case, I think passing the non-essential options in this manner is
the right thing to do and matches what we do for the "ghc" builder,
which by default doesn't pass any optmisation levels, and would likewise
be very bad if someone didn't pass suitable `-O` levels for builds.

Fixes #23625

(cherry picked from commit e4350b41b54c604e222fe3b0c4edb80beee2c0b3)

- - - - -


30 changed files:

- − compiler/GHC/Builtin/gen_bytearray_addr_access_ops.py
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Unit/Module/Warnings.hs
- configure.ac
- distrib/configure.ac.in
- docs/users_guide/flags.py
- ghc/GHCi/UI.hs
- ghc/Main.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Builders/Haddock.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Default.hs-boot
- hadrian/src/Settings/Flavours/Benchmark.hs
- hadrian/src/Settings/Flavours/Development.hs
- hadrian/src/Settings/Flavours/Performance.hs
- hadrian/src/Settings/Flavours/Validate.hs
- libraries/base/GHC/Clock.hsc
- libraries/base/GHC/Conc/POSIX.hs
- libraries/base/System/Posix/Internals.hs
- libraries/base/aclocal.m4
- libraries/base/configure.ac
- libraries/base/jsbits/base.js
- + libraries/base/tests/T23687.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2316e0c711370bb66bcb9679f208843277a0a52a...abd9bf76fe1f393ecfa2e676d17cfb4fb0f90e6e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2316e0c711370bb66bcb9679f208843277a0a52a...abd9bf76fe1f393ecfa2e676d17cfb4fb0f90e6e
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/20230808/bb19cc67/attachment-0001.html>


More information about the ghc-commits mailing list