[Git][ghc/ghc][ghc-9.6] 53 commits: rts: Ensure non-moving gc is not running when pausing

Zubin (@wz1000) gitlab at gitlab.haskell.org
Mon Dec 18 19:53:20 UTC 2023



Zubin pushed to branch ghc-9.6 at Glasgow Haskell Compiler / GHC


Commits:
2b65bb7f by Teo Camarasu at 2023-12-13T12:06:12+05:30
rts: Ensure non-moving gc is not running when pausing

(cherry picked from commit aa84cff4f68e09cc33129ce3fe1bad5aff19e5d9)

- - - - -
b8d7a7b0 by Teo Camarasu at 2023-12-13T12:06:20+05:30
rts: Teach listAllBlocks about nonmoving heap

List all blocks on the non-moving heap.

Resolves #22627

(cherry picked from commit 5ad776abbb7c72d65d2ae27de5b2ec48b6e72cde)

- - - - -
b40bbcc0 by Profpatsch at 2023-12-13T12:10:19+05:30
base: Improve String & IsString documentation

(cherry picked from commit d751c583d29460f033fefb45e685fa40fb3487ad)

- - - - -
51d41567 by Finley McIlwaine at 2023-12-13T19:38:08+05:30
Ensure unconstrained instance dictionaries get IPE info

In the `StgRhsCon` case of `GHC.Stg.Debug.collectStgRhs`, we were not coming up
with an initial source span based on the span of the binder, which was causing
instance dictionaries without dynamic superclass constraints to not have source
locations in their IPE info. Now they do.

Resolves #24005

(cherry picked from commit 69abb1714ade3059593297f3a5faec4c07d1f984)

- - - - -
a9099ed0 by Simon Peyton Jones at 2023-12-13T19:38:08+05:30
Use correct FunTyFlag in adjustJoinPointType

As the Lint error in #23952 showed, the function adjustJoinPointType
was failing to adjust the FunTyFlag when adjusting the type.

I don't think this caused the seg-fault reported in the ticket,
but it is definitely.  This patch fixes it.

It is tricky to come up a small test case; Krzysztof came up with
this one, but it only triggers a failure in GHC 9.6.

(cherry picked from commit 8e05c54a8cb7e5ad2d584fad5b5ad878dd5488b6)

- - - - -
b71b053e by Andreas Klebinger at 2023-12-13T20:20:02+05:30
AArch64: Fix broken conditional jumps for offsets >= 1MB

Rewrite conditional jump instructions with offsets >= 1MB to use unconditional jumps
to avoid overflowing the immediate.

Fixes #23746

(cherry picked from commit 2adc050857a9c1b992040fbfd55fbe65b2851b19)

- - - - -
fc6e4003 by Ben Gamari at 2023-12-13T20:20:02+05:30
configure: Fix #21712 again

This is a bit of a shot in the dark to fix #24033, which appears to be
another instance of #21712. For some reason the ld-override logic
*still* appears to be active on Darwin targets (or at least one).
Consequently, on misconfigured systems we may choose a non-`ld64`
linker.

It's a bit unclear exactly what happened in #24033 but ultimately the
check added for #21712 was not quite right, checking for the
`ghc_host_os` (the value of which depends upon the bootstrap compiler)
instead of the target platform. Fix this.

Fixes #24033.

(cherry picked from commit f6b2751f58df5f4f83caa7a7ca56e66659d02b09)

- - - - -
d1f94ba7 by Ben Gamari at 2023-12-13T20:20:02+05:30
rts/nonmoving: Fix on LLP64 platforms

Previously `NONMOVING_SEGMENT_MASK` and friends were defined with the `UL`
size suffix. However, this is wrong on LLP64 platforms like Windows,
where `long` is 32-bits.

Fixes #23003.
Fixes #24042.

(cherry picked from commit 8f6010b98f560200997a9d84a4e07bfd0ad6e496)

- - - - -
7a51125d by Sylvain Henry at 2023-12-13T20:20:02+05:30
Rts: expose rtsOutOfBoundsAccess symbol

(cherry picked from commit cbe4400d2690104053ec544cf7d0a9a13ee914ee)

- - - - -
9283b7d3 by Sylvain Henry at 2023-12-13T20:20:02+05:30
Avoid out-of-bound array access in bigNatIsPowerOf2 (fix #24066)

bigNatIndex# in the `where` clause wasn't guarded by "bigNatIsZero a".

(cherry picked from commit fe0675770b66a9ed393884d96e276b8d116fa2a2)

- - - - -
c284a3e8 by Sylvain Henry at 2023-12-13T20:20:02+05:30
Bignum: fix right shift of negative BigNat with native backend

(cherry picked from commit cc1625b1ffbdf086b8380bacd35abc8d85861637)

- - - - -
d5de8a2a by Sylvain Henry at 2023-12-13T20:20:02+05:30
Hadrian: enable `-fcheck-prim-bounds` in validate flavour

This allows T24066 to fail when the bug is present.

Otherwise the out-of-bound access isn't detected as it happens in
ghc-bignum which wasn't compiled with the bounds check.

(cherry picked from commit 72c7380cb780933825bc84924908e01ce0495dc4)

- - - - -
83775ebb by Moritz Angermann at 2023-12-13T20:20:02+05:30
CgUtils.fixStgRegStmt respect register width

This change ensure that the reg + offset computation is always of the
same size.  Before this we could end up with a 64bit register, and then
add a 32bit offset (on 32bit platforms).  This not only would fail type
sanity checking, but also incorrectly truncate 64bit values into 32bit
values silently on 32bit architectures.

(cherry picked from commit dafc47091c9107dcf81e1e80a105f59211927c89)
(cherry picked from commit 8e7a2065e433aa56552b335d420b5bf925082078)

- - - - -
ab7bc679 by Moritz Angermann at 2023-12-13T20:20:02+05:30
[PEi386 linker] Bounds check and null-deref guard

We should resonably be able to expect that we won't exceed the number of
sections if we assume to be dealing with legal object files. We can however
not guarantee that we get some negative values, and while we try to
special case most, we should exclude negative indexing into the sections
array.

We also need to ensure that we do not try to derefences targetSection,
if it is NULL, due to the switch statement.

(cherry picked from commit df81536f2e53abf521a05eb1e482a076f5849c21)

- - - - -
d35f5d1a by Moritz Angermann at 2023-12-13T20:20:02+05:30
nativeGen: section flags for .text$foo only

Commit 3ece9856d157c85511d59f9f862ab351bbd9b38b, was supposed to fix
#22834 in !9810.

It does however add "xr" indiscriminatly to .text sections
even if splitSections is disabled. This leads to the assembler saying:

ghc_1.s:7849:0: error:
     Warning: Ignoring changed section attributes for .text
     |
7849 | .section .text,"xr"
     | ^

(cherry picked from commit e99cf237f84db34be0468a893b10394d6b364bce)

- - - - -
54617f3b by Ilias Tsitsimpis at 2023-12-13T20:20:02+05:30
hadrian: Pass -DNOSMP to C compiler when needed

Hadrian passes the -DNOSMP flag to GHC when the target doesn't support
SMP, but doesn't pass it to CC as well, leading to the following
compilation error on mips64el:

| Run Cc (FindCDependencies CDep) Stage1: rts/sm/NonMovingScav.c => _build/stage1/rts/build/c/sm/NonMovingScav.o.d
Command line: /usr/bin/mips64el-linux-gnuabi64-gcc -E -MM -MG -MF _build/stage1/rts/build/c/hooks/FlagDefaults.thr_debug_p_o.d -MT _build/stage1/rts/build/c/hooks/FlagDefaults.o -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -Irts/include -x c rts/hooks/FlagDefaults.c -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Wundef -fno-strict-aliasing -DTHREADED_RTS -DDEBUG -fomit-frame-pointer -O2 -g -Irts -I_build/stage1/rts/build -DDEBUG -fno-omit-frame-pointer -g3 -O0
===> Command failed with error code: 1
In file included from rts/include/Stg.h:348,
                 from rts/include/Rts.h:38,
                 from rts/hooks/FlagDefaults.c:8:
rts/include/stg/SMP.h:416:2: error: #error memory barriers unimplemented on this architecture
  416 | #error memory barriers unimplemented on this architecture
      |  ^~~~~
rts/include/stg/SMP.h:440:2: error: #error memory barriers unimplemented on this architecture
  440 | #error memory barriers unimplemented on this architecture
      |  ^~~~~
rts/include/stg/SMP.h:464:2: error: #error memory barriers unimplemented on this architecture
  464 | #error memory barriers unimplemented on this architecture
      |  ^~~~~

The old make system correctly passed this flag to both GHC and CC [1].

Fix this error by passing -DNOSMP to CC as well.

[1] https://gitlab.haskell.org/ghc/ghc/-/blob/00920f176b0235d5bb52a8e054d89a664f8938fe/rts/ghc.mk#L407

Closes #24082

(cherry picked from commit 257c2807587624592813a42e06a05c5fc34cb38c)
(cherry picked from commit b2a03315f6336e2708ff54689f2241eb38198dd5)

- - - - -
f9ff2f06 by Moritz Angermann at 2023-12-13T20:20:02+05:30
[PEi386] Mask SYM_TYPE_DUP_DISCARD in makeSymbolExtra

48e391952c17ff7eab10b0b1456e3f2a2af28a9b
introduced `SYM_TYPE_DUP_DISCARD` to the bitfield.

The linker however, failed to mask the `SYM_TYPE_DUP_DISCARD` value.
Thus `== SYM_TYPE_CODE` comparisons easily failed. This lead to us
relocating DATA lookups (GOT) into E8 (call) and E9 (jump) instructions.

(cherry picked from commit 34f06334025521c2440ebedb0237697fbcc3c6de)

- - - - -
9397af86 by Claudio Bley at 2023-12-13T20:20:02+05:30
Only exit ghci in -e mode when :add command fails

Previously, when running `ghci -e ':add Sample.hs'` the process would
exit with exit code 1 if the file exists and could be loaded.

Fixes #24115

(cherry picked from commit d561073727186c7b456c9ef113ccb7fc0df4560e)

- - - - -
aee7728a by Zubin Duggal at 2023-12-13T20:20:02+05:30
driver: Don't lose track of nodes when we fail to resolve cycles

The nodes that take part in a cycle should include both hs-boot and hs files,
but when we fail to resolve a cycle, we were only counting the nodes from the
graph without boot files.

Fixes #24196

(cherry picked from commit 8db8d2fd1c881032b1b360c032b6d9d072c11723)

- - - - -
1ae57288 by Sylvain Henry at 2023-12-15T17:17:29+05:30
Fix unusable units and module reexport interaction (#21097)

This commit fixes an issue with ModUnusable introduced in df0f148feae.

In mkUnusableModuleNameProvidersMap we traverse the list of unusable
units and generate ModUnusable origin for all the modules they contain:
exposed modules, hidden modules, and also re-exported modules. To do
this we have a two-level map:

  ModuleName -> Unit:ModuleName (aka Module) -> ModuleOrigin

So for each module name "M" in broken unit "u" we have:
  "M" -> u:M -> ModUnusable reason

However in the case of module reexports we were using the *target*
module as a key. E.g. if "u:M" is a reexport for "X" from unit "o":
   "M" -> o:X -> ModUnusable reason

Case 1: suppose a reexport without module renaming (u:M -> o:M) from
unusable unit u:
   "M" -> o:M -> ModUnusable reason

Here it's claiming that the import of M is unusable because a reexport
from u is unusable. But if unit o isn't unusable we could also have in
the map:
   "M" -> o:M -> ModOrigin ...

Issue: the Semigroup instance of ModuleOrigin doesn't handle the case
(ModUnusable <> ModOrigin)

Case 2: similarly we could have 2 unusable units reexporting the same module
without renaming, say (u:M -> o:M) and (v:M -> o:M) with u and v
unusable. It gives:

  "M" -> o:M -> ModUnusable ... (for u)
  "M" -> o:M -> ModUnusable ... (for v)

Issue: the Semigroup instance of ModuleOrigin doesn't handle the case
(ModUnusable <> ModUnusable).

This led to #21097, #16996, #11050.

To fix this, in this commit we make ModUnusable track whether the module
used as key is a reexport or not (for better error messages) and we use
the re-export module as key. E.g. if "u:M" is a reexport for "o:X" and u
is unusable, we now record:

    "M" -> u:M -> ModUnusable reason reexported=True

So now, we have two cases for a reexport u:M -> o:X:
   - u unusable: "M" -> u:M -> ModUnusable ... reexported=True
   - u usable:   "M" -> o:X -> ModOrigin   ... reexportedFrom=u:M

The second case is indexed with o:X because in this case the Semigroup
instance of ModOrigin is used to combine valid expositions of a module
(directly or via reexports).

Note that module lookup functions select usable modules first (those who
have a ModOrigin value), so it doesn't matter if we add new ModUnusable
entries in the map like this:

  "M" -> {
    u:M -> ModUnusable ... reexported=True
    o:M -> ModOrigin ...
  }

The ModOrigin one will be used. Only if there is no ModOrigin or
ModHidden entry will the ModUnusable error be printed. See T21097 for an
example printing several reasons why an import is unusable.

(cherry picked from commit cee81370cd6ef256f66035e3116878d4cb82e28b)

- - - - -
cc1097f3 by Zubin Duggal at 2023-12-15T17:17:29+05:30
driver: Ensure we actually clear the interactive context before reloading

Previously we called discardIC, but immediately after set the session
back to an old HscEnv that still contained the IC

Partially addresses #24107
Fixes #23405

(cherry picked from commit fa148f6ed43f915f2ae40302dda1b8bae39512af)

- - - - -
cd61dd26 by Zubin Duggal at 2023-12-15T17:17:29+05:30
driver: Ensure we force the lookup of old build artifacts before returning the build plan

This prevents us from retaining all previous build artifacts in memory until a
recompile finishes, instead only retaining the exact artifacts we need.

Fixes #24118

(cherry picked from commit a62d4cb25b805dd7e12476db97a667fd542ea006)

- - - - -
33b3ff8a by Zubin Duggal at 2023-12-15T17:17:29+05:30
testsuite: add test for #24118 and #24107

MultiLayerModulesDefsGhci was not able to catch the leak because it uses
:l which discards the previous environment.

Using :r catches both of these leaks
(cherry picked from commit 244d3315352376eb7b946843fb0c512412842d7d)

- - - - -
27fec1c3 by Zubin Duggal at 2023-12-15T17:17:29+05:30
compiler: Add some strictness annotations to ImportSpec and related constructors
This prevents us from retaining entire HscEnvs.

Force these ImportSpecs when forcing the GlobalRdrEltX

Adds an NFData instance for Bag

Fixes #24107

(cherry picked from commit 306cb4e3e02e466f6c5a57c1a65fd2a5d13b3f89)

- - - - -
74fa25f0 by Zubin Duggal at 2023-12-15T17:17:30+05:30
compiler: Force IfGlobalRdrEnv in NFData instance.

(cherry picked from commit 77a3b580f561e62f5ac7ebf6588199575aafd3b4)

- - - - -
2e4b7832 by Pierre Le Marre at 2023-12-15T17:17:30+05:30
Update to Unicode 15.1.0

See: https://www.unicode.org/versions/Unicode15.1.0/
(cherry picked from commit 778c84b61679a8bb9dd83e2c41156abc0f39abd3)

- - - - -
b8eac3cf by Simon Peyton Jones at 2023-12-15T17:17:30+05:30
Add an extra check in kcCheckDeclHeader_sig

Fix #24083 by checking for a implicitly-scoped type variable that is not
actually bound.  See Note [Disconnected type variables] in GHC.Tc.Gen.HsType

For some reason, on aarch64-darwin we saw a 2.8% decrease in compiler
allocations for MultiLayerModulesTH_Make; but 0.0% on other architectures.

Metric Decrease:
    MultiLayerModulesTH_Make

(cherry picked from commit 6dbab1808bfbe484b3fb396aab1d105314f918d8)

- - - - -
110efc98 by Simon Peyton Jones at 2023-12-15T17:17:30+05:30
Second fix to #24083

My earlier fix turns out to be too aggressive for data/type families

See wrinkle (DTV1) in Note [Disconnected type variables]

(cherry picked from commit 2776920e642544477a38d0ed9205d4f0b48a782e)

- - - - -
01b8a66b by Alexis King at 2023-12-15T17:17:30+05:30
Don’t store the async exception masking state in CATCH frames

(cherry picked from commit 8b61dfd6dfc78bfa6bb9449dac9a336e5d668b5e)
(cherry picked from commit e538003c33251c5c843cac1e30b36f88bb859778)

- - - - -
cfbf9aa9 by Zubin Duggal at 2023-12-15T17:17:30+05:30
Bump array submodule to 0.5.6.0

- - - - -
bd31c2bb by Matthew Pickering at 2023-12-15T17:17:30+05:30
libraries: Bump filepath to 1.4.200.1 and unix to 2.8.4.0

Updates filepath submodule
Updates unix submodule

Fixes #24240

(cherry picked from commit 36b9a38cc45a26865c4e45f4949e519a5dede76d)

- - - - -
207f897a by Matthew Pickering at 2023-12-15T17:17:30+05:30
Submodule linter: Allow references to tags

We modify the submodule linter so that if the bumped commit is a
specific tag then the commit is accepted.

Fixes #24241

(cherry picked from commit 91ff0971df64b04938d011fe1562320c5d90849a)

- - - - -
1fa23f43 by Zubin Duggal at 2023-12-15T17:17:30+05:30
hadrian: set -Wno-deprecations for directory and Win32

The filepath bump to 1.4.200.1 introduces a deprecation warning.

See https://gitlab.haskell.org/ghc/ghc/-/issues/24240
    https://github.com/haskell/filepath/pull/206

(cherry picked from commit 86f652dc9a649e59e643609c287a510a565f5408)

- - - - -
76bc5445 by Ben Gamari at 2023-12-15T17:17:30+05:30
Fix thunk update ordering

Previously we attempted to ensure soundness of concurrent thunk update
by synchronizing on the access of the thunk's info table pointer field.
This was believed to be sufficient since the indirectee (which may
expose a closure allocated by another core) would not be examined
until the info table pointer update is complete.

However, it turns out that this can result in data races in the presence
of multiple threads racing a update a single thunk. For instance,
consider this interleaving under the old scheme:

            Thread A                             Thread B
            ---------                            ---------
    t=0     Enter t
      1     Push update frame
      2     Begin evaluation

      4     Pause thread
      5     t.indirectee=tso
      6     Release t.info=BLACKHOLE

      7     ... (e.g. GC)

      8     Resume thread
      9     Finish evaluation
      10    Relaxed t.indirectee=x

      11                                         Load t.info
      12                                         Acquire fence
      13                                         Inspect t.indirectee

      14    Release t.info=BLACKHOLE

Here Thread A enters thunk `t` but is soon paused, resulting in `t`
being lazily blackholed at t=6. Then, at t=10 Thread A finishes
evaluation and updates `t.indirectee` with a relaxed store.

Meanwhile, Thread B enters the blackhole. Under the old scheme this
would introduce an acquire-fence but this would only synchronize with
Thread A at t=6. Consequently, the result of the evaluation, `x`, is not
visible to Thread B, introducing a data race.

We fix this by treating the `indirectee` field as we do all other
mutable fields. This means we must always access this field with
acquire-loads and release-stores.

See #23185.

(cherry picked from commit fa63b5902389aa929af5ec04b93b601fd456633f)
(cherry picked from commit fcfb0850d1960b677a2f6b9bdf45d8ccef169aeb)

- - - - -
2de05890 by Bryan Richter at 2023-12-15T17:17:30+05:30
Work around perf note fetch failure

Addresses #24055.

(cherry picked from commit 63afb701a1638d7bd32c34fb24a9fd3ff897b634)

- - - - -
592e41e2 by Zubin Duggal at 2023-12-15T17:17:30+05:30
Bump haddock submodule to 2.29.2

- - - - -
30d1b643 by Moritz Angermann at 2023-12-15T17:17:40+05:30
Drop hard Xcode dependency

XCODE_VERSION calls out to `xcodebuild`, which is only available
when having `Xcode` installed. The CommandLineTools are not
sufficient. To install Xcode, you must have an apple id to download
the Xcode.xip from apple.

We do not use xcodebuild anywhere in our build explicilty. At best
it appears to be a proxy for checking the linker or the compiler.
These should rather be done with
```
xcrun ld -version
```
or similar, and not by proxy through Xcode. The CLR should be
sufficient for building software on macOS.

(cherry picked from commit a3ee3b99e6889fd68da75c6ea7a14d101f71da56)

- - - - -
5a77075c by Matthew Craven at 2023-12-15T17:39:36+05:30
Make 'wWarningFlagsDeps' include every WarningFlag

Fixes #24071.

(cherry picked from commit a2c0fff61afdb14b5f2624374aa5767e7b238ff4)

- - - - -
31bc8575 by Ben Gamari at 2023-12-15T17:40:16+05:30
rts/eventlog: Fix off-by-one in assertion

Previously we failed to account for the NULL terminator `postString`
asserted that there is enough room in the buffer for the string.

(cherry picked from commit d0b17576148d336b67c7d65bcf742f83001413cb)

- - - - -
a62134f2 by Ben Gamari at 2023-12-15T17:40:25+05:30
rts/eventlog: Honor result of ensureRoomForVariableEvent is

Previously we would keep plugging along, even if isn't enough room for
the event.

(cherry picked from commit a10f9b9bc510051a5b47d31238aad1174f7a1966)

- - - - -
472582dc by Ben Gamari at 2023-12-15T17:40:34+05:30
rts/eventlog: Avoid truncating event sizes

Previously ensureRoomForVariableEvent would truncate the desired size to
16-bits, resulting in #24197.

Fixes #24197.

(cherry picked from commit 0e0f41c0e3d9c67fc669e975060e88bccdc7d823)

- - - - -
65699dd6 by Ben Gamari at 2023-12-15T17:41:37+05:30
rts/EventLog: Place eliminate duplicate strlens

Previously many of the `post*` implementations would first compute the
length of the event's strings in order to determine the event length.
Later we would then end up computing the length yet again in
`postString`. Now we instead pass the string length to `postStringLen`,
avoiding the repeated work.

(cherry picked from commit c350df3ce0e5c207b90eb3e74e04c77826c56283)

- - - - -
39236678 by Ben Gamari at 2023-12-15T17:41:45+05:30
rts/eventlog: Place upper bound on IPE string field lengths

The strings in IPE events may be of unbounded length. Limit the lengths
of these fields to 64k characters to ensure that we don't exceed the
maximum event length.

(cherry picked from commit 9340d9987abe2ebf7f66659ffc48a822586f6edd)

- - - - -
bc444199 by Zubin Duggal at 2023-12-15T17:41:51+05:30
rts: drop unused postString function

(cherry picked from commit 6e03bfdfdb74de2a8b51d3008233392a6f0a9965)

- - - - -
5ac485d2 by Zubin Duggal at 2023-12-15T19:04:19+05:30
Bump base to 4.18.2.0 and add changelog

- - - - -
1405682a by Sebastian Graf at 2023-12-15T19:51:47+05:30
Cpr: Turn an assertion into a check to deal with some dead code (#23862)

See the new `Note [Dead code may contain type confusions]`.

Fixes #23862.

(cherry picked from commit 57c391c463f26b7025df9b340ad98416cff1d2b2)

- - - - -
123b0cf7 by Matthew Pickering at 2023-12-18T14:56:22+05:30
ghcup-metadata: Use dynamically linked alpine bindists

In theory these will work much better on alpine to allow people to build
statically linked applications there. We don't need to distribute a
statically linked application ourselves in order to allow that.

Fixes #23602

(cherry picked from commit e524fa7f67259a093aeb21aada139137626c581c)

- - - - -
de70b89d by Rodrigo Mesquita at 2023-12-18T14:56:22+05:30
Suppress duplicate librares linker warning of new macOS linker

Fixes #24167

XCode 15 introduced a new linker which warns on duplicate libraries being
linked. To disable this warning, we pass -Wl,-no_warn_duplicate_libraries as
suggested by Brad King in CMake issue #25297.

This flag isn't necessarily available to other linkers on darwin, so we must
only configure it into the CC linker arguments if valid.

(cherry picked from commit e98051a5e7251390799f9fdead988c61d72e82e3)

- - - - -
273f5a3f by Rodrigo Mesquita at 2023-12-18T20:33:03+05:30
darwin: Fix single_module is obsolete warning

In XCode 15's linker, -single_module is the default and otherwise
passing it as a flag results in a warning being raised:

    ld: warning: -single_module is obsolete

This patch fixes this warning by, at configure time, determining whether
the linker supports -single_module (which is likely false for all
non-darwin linkers, and true for darwin linkers in previous versions of
macOS), and using that information at runtime to decide to pass or not
the flag in the invocation.

Fixes #24168

(cherry picked from commit e6c803f702e8b09dfd0073b973b8afcd7071db50)

- - - - -
000a6a8f by Josh Meredith at 2023-12-18T20:33:03+05:30
JS: fix bounds checking (Issue 23123)

* For ByteArray-based bounds-checking, the JavaScript backend must use the
`len` field, instead of the inbuild JavaScript `length` field.

* Range-based operations must also check both the start and end of the range
for bounds

* All indicies are valid for ranges of size zero, since they are essentially no-ops

* For cases of ByteArray accesses (e.g. read as Int), the end index is
(i * sizeof(type) + sizeof(type) - 1), while the previous implementation
uses (i + sizeof(type) - 1). In the Int32 example, this is (i * 4 + 3)

* IndexByteArrayOp_Word8As* primitives use byte array indicies (unlike
the previous point), but now check both start and end indicies

* Byte array copies now check if the arrays are the same by identity and
then if the ranges overlap.

(cherry picked from commit 116d7312ec4c76f75a26bd0ad2b2815710049e0e)

- - - - -
d86cd08b by Sylvain Henry at 2023-12-18T20:40:08+05:30
Fix remaining issues with bound checking (#23123)

While fixing these I've also changed the way we store addresses into
ByteArray#. Addr# are composed of two parts: a JavaScript array and an
offset (32-bit number).

Suppose we want to store an Addr# in a ByteArray# foo at offset i.
Before this patch, we were storing both fields as a tuple in the "arr"
array field:

  foo.arr[i] = [addr_arr, addr_offset];

Now we only store the array part in the "arr" field and the offset
directly in the array:

  foo.dv.setInt32(i, addr_offset):
  foo.arr[i] = addr_arr;

It avoids wasting space for the tuple.

(cherry picked from commit 2d5c1ddecf195da9a8ee4f7b38fbb79d3b680aeb)

- - - - -
34e8cf3c by Matthew Pickering at 2023-12-18T23:29:39+05:30
testsuite: Fix T21097b test with make 4.1 (deb9)

cee81370cd6ef256f66035e3116878d4cb82e28b recently added a test which
failed on deb9 because the version of make was emitting the recipe
failure to stdout rather than stderr.

One way to fix this is to be more precise in the test about which part
of the output we care about inspecting.

(cherry picked from commit bad3765668cc5badf5d0a19100fac95125985473)

- - - - -
908c485f by Zubin Duggal at 2023-12-18T23:29:42+05:30
Prepare release 9.6.4

Metric Decrease:
    T13701

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/gen_ci.hs
- .gitlab/test-metrics.sh
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Cond.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/PPC/Instr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/X86.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Iface/Errors.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/CgUtils.hs
- compiler/GHC/StgToJS/Linker/Utils.hs
- compiler/GHC/StgToJS/Prim.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/57ea249ff147fc6a0819e7a452d40625800a2d88...908c485f27b62961cb2798a373958f5c73734beb

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/57ea249ff147fc6a0819e7a452d40625800a2d88...908c485f27b62961cb2798a373958f5c73734beb
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/20231218/6f983cce/attachment-0001.html>


More information about the ghc-commits mailing list