[Git][ghc/ghc][wip/andreask/9.10-backports] 31 commits: 9.10.2 backport batch 5 - patch notes.

Andreas Klebinger (@AndreasK) gitlab at gitlab.haskell.org
Mon Jan 27 13:49:09 UTC 2025



Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC


Commits:
9278dc6c by Andreas Klebinger at 2025-01-23T11:00:54+01:00
9.10.2 backport batch 5 - patch notes.

- - - - -
1f01dde2 by Andreas Klebinger at 2025-01-23T11:17:36+01:00
9.10.2: Bump base to version 4.20.1

- - - - -
d96104b8 by Andreas Klebinger at 2025-01-23T11:18:35+01:00
Allow unknown fd device types for setNonBlockingMode.

This allows fds with a unknown device type to have blocking mode
set. This happens for example for fds from the inotify subsystem.

Fixes #25199.

(cherry picked from commit 620becd72ec18ca08c1ed86759d65a0e614fe43c)

- - - - -
f166369b by Sylvain Henry at 2025-01-23T11:18:49+01:00
Fix interaction between fork and kqueue (#24672)

A kqueue file descriptor isn't inherited by a child created with fork.
As such we mustn't try to close this file descriptor as we would close a
random one, e.g. the one used by timerfd.

Fix #24672

(cherry picked from commit e7a26d7a6faf1ea534e036c5085a0a027dbb6f5f)

- - - - -
9920dc74 by Sylvain Henry at 2025-01-23T11:21:41+01:00
JS: fix h$withCStringOnHeap helper (#25288)

strlen returns the length of the string without the \0 terminating byte,
hence CString weren't properly allocated on the heap (ending \0 byte was
missing).

- - - - -
2b4ae28b by Ben Gamari at 2025-01-23T15:13:54+01:00
base: Propagate `error` CallStack to thrown exception

Previously `errorCallWithCallStackException` failed to propagate its
`CallStack` argument, which represents the call-chain of the preceding
`error` call, to the exception that it returned. Consequently, the
call-stack of `error` calls were quite useless.

Unfortunately, this is the second time that I have fixed this but it
seems the first must have been lost in rebasing.

Fixes a bug in the implementation of CLC proposal 164
<https://github.com/haskell/core-libraries-committee/issues/164>

Fixes #24807.

(cherry picked from commit 5f7c20bc6b9deacabb1fb099781f00371cdb4369)

- - - - -
6dcd0eb1 by Matthew Pickering at 2025-01-23T15:21:05+01:00
driver: Fix -working-dir for foreign files

-working-dir definitely needs more serious testing, there are some easy
ways to test this.

* Modify Cabal to call ghc using -working-dir rather than changing
  directory.
* Modify the testsuite to run ghc using `-working-dir` rather than
  running GHC with cwd = temporary directory.

However this will have to wait until after 9.12.

Fixes #25150

(cherry picked from commit c20d51867c824e32c61bd1e002680bef268e4f51)

- - - - -
d18ab8f4 by Matthew Pickering at 2025-01-23T15:21:58+01:00
ci: Fix variable inheritence for ghcup-metadata testing job

Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine
how to setup all the different jobs.

On the downstream trigger this was being inherited from the default
setting in .gitlab.yml file.

Therefore this led to job failures as the necessary CONFIGURE_ARGS were
not being passed to the configure script when installing the bindist.

See docs:

* https://docs.gitlab.com/ee/ci/yaml/#inherit
* https://docs.gitlab.com/ee/ci/yaml/#triggerforward

1. inherit:variables:fals
  - This stops the global variables being inherited into the job and
    hence forwarded onto the downstream job.

2. trigger:forward:*
  - yaml_variables: true (default) pass yaml variables to downstream,
    this is important to pass the upstream pipeline id to downstream.
  - pipeline_variables: false (default) but don't pass pipeline
    variables (normal environment variables).

Fixes #25294

(cherry picked from commit 7cb7172eff9e18ed1c98f65a98018f76c4fcc9f6)

- - - - -
8f782afa by Andreas Klebinger at 2025-01-23T15:23:26+01:00
ghc-experimental: Expose primops and ghc extensions via GHC.PrimOps

This will be the new place for functions that would have gone into
GHC.Exts in the past but are not stable enough to do so now.

Addresses #25242

(cherry picked from commit 39497eeda74fc7f1e7ea89292de395b16f69cee2)

- - - - -
c7e08671 by Andreas Klebinger at 2025-01-23T15:23:43+01:00
Change versionig of ghc-experimental to follow ghc versions.

Just like ghc-internal it will now use the @ProjectVersionForLib@ macro for versioning.
This means for ghc=9.10.1, ghc-experimental's version will be 9.1001.0 and so on.

This fixes #25289

(cherry picked from commit 2293c0b7d709df7be04f596e72c97fd2435c4134)

- - - - -
d573f907 by Sven Tennie at 2025-01-23T16:15:22+01:00
AArch64: Simplify BL instruction

The BL constructor carried unused data in its third argument.

(cherry picked from commit eb612fbc8e94d50c9895c02f3d6ee076f61b7773)

- - - - -
f49d91b0 by Sven Tennie at 2025-01-23T16:16:42+01:00
AArch64: Implement switch/jump tables (#19912)

This improves the performance of Cmm switch statements (compared to a
chain of if statements.)

(cherry picked from commit 1d22611665117131d1c7c3c0287696e8efcc88f2)

- - - - -
1073f959 by Andrzej Rybczak at 2025-01-23T16:17:01+01:00
Fix typo in the @since annotation of annotateIO

(cherry picked from commit 55609880c3eeda2c13859c10c157d7df05496288)

- - - - -
7bf87706 by Cristiano Moraes at 2025-01-23T16:17:14+01:00
configure: Find C++ probing when GCC version is the latest but G++ is old #23118

(cherry picked from commit 78ad81ecef846f73fee0f6c1a86cd6f19aa29b21)

- - - - -
13bafa45 by sheaf at 2025-01-27T14:26:16+01:00
LLVM: use sse4.2 instead of sse42

LLVM expects the former instead of the latter since version 3.4.

Fixes #25019

(cherry picked from commit 694489edf35c35b29fbdf09a8e3fdc404469858f)

- - - - -
376ca25d by sheaf at 2025-01-27T14:26:16+01:00
LLVM: make SSE4.2 imply +popcnt

For consistency with the NCG as well as with Clang and GCC, we make
the SSE4.2 feature flag imply +popcnt when using the LLVM backend.

Fixes #25353

(cherry picked from commit 06ae85071b95376bd1eb354f7cc7901aed45b625)

- - - - -
6466acd2 by Ben Gamari at 2025-01-27T14:26:16+01:00
testsuite: Normalise trailing digits from hole fits output

The type variables in the holes fit output from
`abstract_refinement_hole_fits` is quite sensitive to compiler
configuration. Specifically, a slight change in the inlining
behavior of `throw` changes type variable naming in `(>>=)` and a few
others.

Ideally we would make hole fits output more deterministic but in the
meantime we simply normalise this difference away as it not relevant
to the test's goal.

(cherry picked from commit d029f1700effa626ff622700b198ed49ee8b6c19)

- - - - -
89ffc037 by Ben Gamari at 2025-01-27T14:26:16+01:00
base: Add test for #25066

(cherry picked from commit da5d7d0d8bde06a1c29612fd17b6a579fc523036)

- - - - -
f8cd7ade by Ben Gamari at 2025-01-27T14:26:16+01:00
base: Fix #25066

As noted in #25066, the exception backtrace proposal introduced a rather
subtle performance regression due to simplification producing Core which
the demand analyser concludes may diverge with a precise exception. The
nature of the problem is more completely described in the new Note
[Hiding precise exception signature in throw].

The (rather hacky) solution we use here hides the problematic
optimisation through judicious use of `noinline`. Ultimately however we
will want a more principled solution (e.g. #23847).

Fixes #255066

CLC proposal: https://github.com/haskell/core-libraries-committee/issues/290

Metric Decrease:
    T9872d

(cherry picked from commit eb7ddae1a2b3fb1be1cd635849516a6398327b29)

- - - - -
182057b9 by Ben Gamari at 2025-01-27T14:26:16+01:00
base: Improve documentation of Control.Exception.Backtrace

(cherry picked from commit 0060ece762d7a936daf28195676b6162c30dc845)

- - - - -
c2037780 by Andreas Klebinger at 2025-01-27T14:26:16+01:00
9.10.2 - more changelogs

- - - - -
b7573e17 by Cheng Shao at 2025-01-27T14:26:16+01:00
Revert "compiler: start deprecating cmmToRawCmmHook"

This reverts commit 1c064ef1f3e1aa2afc996e962ad53effa99ec5f4. Turns
out the GHC-WPC project does use it to observe Cmm in the pipeline,
see #25363.

(cherry picked from commit 525d451e175c7d6acfa968ce99d8d3fc7a8af0c7)

- - - - -
a113a83c by Cheng Shao at 2025-01-27T14:26:16+01:00
rts: fix pointer overflow undefined behavior in bytecode interpreter

This patch fixes an unnoticed undefined behavior in the bytecode
interpreter. It can be caught by building `rts/Interpreter.c` with
`-fsanitize=pointer-overflow`, the warning message is something like:

```
rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13
rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13
rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13
```

Whenever we do something like `SpW(-1)`, the negative argument is
implicitly converted to an unsigned integer type and causes pointer
arithmetic overflow. It happens to be harmless for most targets since
overflowing would wrap the result to desired value, but it's still
coincidental and undefined behavior. Furthermore, it causes real
damage to the wasm backend, given clang-20 will emit invalid wasm code
that crashes at run-time for this kind of C code! (see
https://github.com/llvm/llvm-project/issues/108770)

The fix here is adding some explicit casts to ensure we always use the
signed `ptrdiff_t` type as right hand operand of pointer arithmetic.

(cherry picked from commit 5bcfefd5bb73c18a9bad63d1813968832b696f9a)

- - - - -
dd01dd3e by Zubin Duggal at 2025-01-27T14:26:16+01:00
rel-eng: ghcup metadata generation: generated yaml anchors with meaningful names

(cherry picked from commit d83f5bd730a8aef37d8a38b3560590d9798f8e45)
(cherry picked from commit 280b627869da55a22b4b9a3458e6115b06b5fff4)

- - - - -
82916be2 by Zubin Duggal at 2025-01-27T14:26:16+01:00
release: copy zip files into the correct directory

Fixes #25446

(cherry picked from commit 346e4cd1903b2cbcc9bb7c39652666c513eb2a59)

- - - - -
fbae1dc3 by Zubin Duggal at 2025-01-27T14:26:16+01:00
release: Sign .gz bindists too

Fixes #25447

(cherry picked from commit bbdbe2254df1bfc9157cfb409afc93f8157712cd)

- - - - -
1b0612d4 by Sebastian Graf at 2025-01-27T14:26:16+01:00
DmdAnal: Make `prompt#` lazy (#25439)

This applies the same treatment to `prompt#` as for `catch#`.
See `Note [Strictness for mask/unmask/catch/prompt]`.

Fixes #25439.

(cherry picked from commit 00d58ae18a7ce8db6b2d57261a08ba8c1c2549b5)

- - - - -
80742352 by Andreas Klebinger at 2025-01-27T14:26:16+01:00
Compacting GC: Handle black holes in large objects.

As #14497 showed black holes can appear inside large objects when
we capture a computation and later blackhole it like we do for AP_STACK
closures.

Fixes #24791

(cherry picked from commit 7f90f319531c312a074d21688b05f664f0d173fc)

- - - - -
d8a682a9 by Ben Gamari at 2025-01-27T14:26:16+01:00
rts: Allow ExecPage to allocate anywhere in address space

Currently the ExecPage facility has two users:

 * GHCi, for constructing info tables, and
 * the adjustor allocation path

Despite neither of these have any spatial locality constraints ExecPage
was using the linker's `mmapAnonForLinker`, which tries hard to ensure
that mappings end up nearby the executable image. This makes adjustor
allocation needlessly subject to fragmentation concerns.

We now instead return less constrained mappings, improving the
robustness of the mechanism.

Addresses #25503.

(cherry picked from commit a104508d2ea5bbc61c4a756dca42fc043b329709)

- - - - -
7bf83cf7 by Ben Gamari at 2025-01-27T14:26:16+01:00
base: Fix incorrect mentions of GHC.Internal.Numeric

These were incorrectly changed by the automated refactoring of the
`ghc-internal` migration.

Fixes #25521.

(cherry picked from commit c3fc9b861fd00a85a4fcbd9960b8242d9fabe04b)

- - - - -
d7d9aa07 by Arnaud Spiwack at 2025-01-27T14:26:17+01:00
Add test for #25428

(cherry picked from commit e6c957e49260230c4cb297aeec16be3293381fb7)

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- .gitlab/rel_eng/recompress-all
- .gitlab/rel_eng/upload.sh
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- docs/users_guide/9.10.2-notes.rst
- libraries/base/base.cabal
- libraries/base/changelog.md
- libraries/base/src/Control/Exception/Backtrace.hs
- libraries/base/src/Data/Char.hs
- libraries/base/src/Data/Semigroup.hs
- libraries/base/src/GHC/Exts.hs
- libraries/base/src/Prelude.hs
- libraries/base/tests/T19288.stderr
- + libraries/base/tests/T24807.hs
- + libraries/base/tests/T24807.stderr
- + libraries/base/tests/T25066.hs
- + libraries/base/tests/T25066.stderr
- libraries/base/tests/all.T
- libraries/ghc-experimental/ghc-experimental.cabal
- + libraries/ghc-experimental/src/GHC/PrimOps.hs
- libraries/ghc-internal/src/GHC/Internal/Base.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c6e5b18825363b4a89d262de6d41a7844fab188d...d7d9aa07406a69daffeeedca3bb20969ba0b383e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c6e5b18825363b4a89d262de6d41a7844fab188d...d7d9aa07406a69daffeeedca3bb20969ba0b383e
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/20250127/ced733d3/attachment-0001.html>


More information about the ghc-commits mailing list