-
cf0ed192
by Andrew Lelechenko at 2026-11-30T21:00:24+01:00
Bump submodule deepseq to 1.5.1.0
(cherry picked from commit 8e462f4d4bdf2a6c34c249e7be8084565600d300)
-
a7f8815b
by Wang Xin at 2026-11-30T21:00:24+01:00
Add -mcmodel=medium moduleflag to generated LLVM IR on LoongArch platform
With the Medium code model, the jump range of the generated jump
instruction is larger than that of the Small code model. It's a
temporary fix of the problem descriped in https://gitlab.haskell
.org/ghc/ghc/-/issues/25495. This commit requires that the LLVM
used contains the code of commit 9dd1d451d9719aa91b3bdd59c0c6679
83e1baf05, i.e., version 8.0 and later. Actually we should not
rely on LLVM, so the only way to solve this problem is to implement
the LoongArch backend.
Add new type for codemodel
(cherry picked from commit e70d41406b5d5638b42c4d8222cd03e76bbfeb86)
-
44cdffd6
by Peng Fan at 2026-11-30T21:00:24+01:00
Pass the mcmodel=medium parameter to CC via GHC
Ensure that GHC-driver builds default to mcmodel=medium, so that GHC
passes this default parameter to CC without having to add it to the
compiled project.
Commit e70d41406b5d5638b42c4d8222cd03e76bbfeb86 does not ensure that all
GHC-built object files have a default model of medium, and will raise an
R_LARCH_B26 overflow error.
(cherry picked from commit 1a3f11314cc7b8dbf9af03dd2ae2cb066a998d63)
-
ac5216c7
by Ben Gamari at 2026-11-30T21:00:24+01:00
rts: Dynamically initialize built-in closures
To resolve #26166 we need to eliminate references to undefined symbols
in the runtime system. One such source of these is the runtime's
static references to `I#` and `C#` due the `stg_INTLIKE` and
`stg_CHARLIKE` arrays.
To avoid this we make these dynamic, initializing them during RTS
start-up.
(cherry picked from commit 39eaaaba5356e3fc9218d8e27375d6de24778cbc)
-
d22054e6
by Rodrigo Mesquita at 2026-11-30T21:00:25+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
(cherry picked from commit ba3e5bddb222008591edb6c3d433d93084170571)
(cherry picked from commit f687ce93a4ef71aebac5d5eb891e72a090092ec0)
-
75f206d8
by Ben Gamari at 2026-11-30T21:00:25+01:00
rts: Avoid static symbol references to ghc-internal
This resolves #26166, a bug due to new constraints placed by Apple's
linker on undefined references.
One source of such references in the RTS is the many symbols referenced
in ghc-internal. To mitigate #26166, we make these references dynamic,
as described in Note [RTS/ghc-internal interface].
Fixes #26166
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita@gmail.com>
Co-authored-by: Cheng Shao <terrorjack@type.dance>
(cherry picked from commit f31de2a9c2405d6645998460e4b501f9279606b3)
-
d242bade
by Ben Gamari at 2026-11-30T21:00:25+01:00
compiler: Rename isMathFun -> isLibcFun
This set includes more than just math functions.
(cherry picked from commit 43fdfddc25c36ef4811941231d5755bad065796d)
(cherry picked from commit 99291e88f0498f11317e0f45c4968583c8c6ef0f)
-
f011aad8
by Ben Gamari at 2026-11-30T21:00:25+01:00
compiler: Add libc allocator functions to libc_funs
Prototypes for these are now visible from `Prim.h`, resulting in
multiple-declaration warnings in the unregisterised job.
(cherry picked from commit 4ed5138f7af532731f88380f98103487a9f15c5a)
(cherry picked from commit d5d081e38f6abf445ad50b355585d2edddfc8173)
-
38d3f9e9
by Ben Gamari at 2026-11-30T21:00:25+01:00
rts: Minimize header dependencies of Prim.h
Otherwise we will end up with redundant and incompatible declarations
resulting in warnings during the unregisterised build.
(cherry picked from commit 9a0a076b80d6fb68d7722d2bb72c17c90ba22cd1)
(cherry picked from commit ef442bd152400dc550fba2ba5fd90fb0f5454614)
-
0544f0de
by sheaf at 2026-11-30T21:00:25+01:00
Use x86_64-unknown-windows-gnu target for LLVM on Windows
(cherry picked from commit 21aaa34b703a77f68d3f94e0e9e39ea25499faa2)
-
ea6a75fd
by sheaf at 2026-11-30T21:00:26+01:00
LLVM: use -relocation-model=pic on Windows
This is necessary to avoid the segfaults reported in #22487.
Fixes #22487
(cherry picked from commit 992a7624817cdab4b566387f2e877f420f7b27d4)
-
63f22be0
by Andreas Klebinger at 2026-11-30T21:00:26+01:00
rts: CCS.h - Backport CCS_SYSTEM_OR_NULL macro
-
ab129c0f
by Ben Gamari at 2026-11-30T21:00:26+01:00
rts/posix: Enforce iteration limit on heap reservation logic
Previously we could loop indefinitely when attempting to get an address
space reservation for our heap. Limit the logic to 8 iterations to
ensure we instead issue a reasonable error message.
Addresses #26151.
(cherry picked from commit a48db5706800ed2691d219323a6fdb5d7a73c638)
-
65a110e6
by Ben Gamari at 2026-11-30T21:00:26+01:00
rts/posix: Hold on to low reservations when reserving heap
Previously when the OS gave us an address space reservation in low
memory we would immediately release it and try again. However, on some
platforms this meant that we would get the same allocation again in the
next iteration (since mmap's `hint` argument is just that, a hint).
Instead we now hold on to low reservations until we have found a
suitable heap reservation.
Fixes #26151.
(cherry picked from commit 3ab77586e6daae5c7de481d2b9532bf499b587ff)
-
4352463b
by Ben Gamari at 2026-11-30T21:00:26+01:00
rts: Eliminate uses of implicit constant arrays
Folding of `const`-sized variable-length arrays to a constant-length
array is a gnu extension which clang complains about.
Closes #26502.
(cherry picked from commit 064107a57b90a2981049e3158b5904f8f3fb506f)
-
eb814d61
by Phil Hazelden at 2026-11-30T21:00:26+01:00
Fix build with werror on glibc 2.43.
We've been defining `_XOPEN_SOURCE` and `_POSIX_C_SOURCE` to the same
values as defined in glibc prior to 2.43. But in 2.43, glibc changes
them to new values, which means we get a warning when redefining them.
By `#undef`ing them first, we no longer get a warning.
Closes #27076.
(cherry picked from commit 47a41f27ddfbf8cc3fa8c80f4acdd3d7137f29f2)
-
9dc26f78
by Sven Tennie at 2026-11-30T21:00:26+01:00
Fix C warnings (#25237)
GCC 14 treats the fixed warnings as errors by default. I.e. we're
gaining GCC 14 compatibility with these fixes.
(cherry picked from commit 3b2dc826c9d4e65546ae3083303fdd491e74bd5a)
-
97bfc232
by Brandon Chinn at 2026-11-30T21:00:27+01:00
Fix for alex-3.5.2.0 (#25623)
This INLINE pragma for alexScanUser was added in 9.12, but then I
ported the change to alex in 3.5.2.0
(https://github.com/haskell/alex/pull/262).
I didn't realize that GHC errors on duplicate INLINE pragmas, so
this ended up being a breaking change.
This change should be backported into 9.12
(cherry picked from commit a1d923786baed5b001c523fd2a76f133be510b04)
-
45e8fbeb
by Teo Camarasu at 2026-11-30T21:00:27+01:00
rts/nonmovingGC: remove n_free
We remove the nonmovingHeap.n_free variable.
We wanted this to track the length of nonmovingHeap.free.
But this isn't possible to do atomically.
When this isn't accurate we can get a segfault by going past the end of
the list.
Instead, we just count the length of the list when we grab it in
nonmovingPruneFreeSegment.
Resolves #26186
(cherry picked from commit 45efaf71d97355f76fe0db5af2fc5b4b67fddf47)
-
ed2c1fca
by Ben Gamari at 2026-11-30T21:00:27+01:00
Bump win32-tarballs to v0.9
(cherry picked from commit 7308276916232706c8c196f929ef05fdffca4ddd)
-
11228091
by Andreas Klebinger at 2026-11-30T21:00:27+01:00
Disable -fprof-late-overloaded-calls for join points.
Currently GHC considers cost centres as destructive to
join contexts. Or in other words this is not considered valid:
join f x = ...
in
... -> scc<tick> jmp
This makes the functionality of `-fprof-late-overloaded-calls` not feasible
for join points in general. We used to try to work around this by putting the
ticks on the rhs of the join point rather than around the jump. However beyond
the loss of accuracy this was broken for recursive join points as we ended up
with something like:
rec-join f x = scc<tick> ... jmp f x
Which similarly is not valid as the tick once again destroys the tail call.
One might think we could limit ourselves to non-recursive tail calls and do
something clever like:
join f x = scc<tick> ...
in ... jmp f x
And sometimes this works! But sometimes the full rhs would look something like:
join g x = ....
join f x = scc<tick> ... -> jmp g x
Which, would again no longer be valid. I believe in the long run we can make
cost centre ticks non-destructive to join points. Or we could keep track of
where we are/are not allowed to insert a cost centre. But in the short term I will
simply disable the annotation of join calls under this flag.
(cherry picked from commit 7da86e165612721c4e09f772a3fdaffc733e9293)
-
bd3e76e0
by Sebastian Graf at 2026-11-30T21:00:27+01:00
CprAnal: Detect recursive newtypes (#25944)
While `cprTransformDataConWork` handles recursive data con workers, it
did not detect the case when a newtype is responsible for the recursion.
This is now detected in the `Cast` case of `cprAnal`.
The same reproducer made it clear that `isRecDataCon` lacked congruent
handling for `AppTy` and `CastTy`, now fixed.
Furthermore, the new repro case T25944 triggered this bug via an
infinite loop in `cprFix`, caused by the infelicity in `isRecDataCon`.
While it should be much less likely to trigger such an infinite loop now
that `isRecDataCon` has been fixed, I made sure to abort the loop after
10 iterations and emitting a warning instead.
Fixes #25944.
(cherry picked from commit 4bc78496406f7469640faaa46e2f311c05760124)
-
7c0e01a8
by Ben Gamari at 2026-11-30T21:00:27+01:00
configure: Allow override of CrossCompiling
As noted in #26236, the current inference logic is a bit simplistic. In
particular, there are many cases (e.g. building for a new libc) where
the target and host triples may differ yet we are still able to run the
produced artifacts as native code.
Closes #26236.
(cherry picked from commit 81577fe7c1913c53608bf03e48f84507be904620)
-
e07ec6e8
by Ben Gamari at 2026-11-30T21:00:28+01:00
rts/linker/LoadArchive: Use bool
Improve type precision by using `bool` instead of `int` and `StgBool`.
(cherry picked from commit 580a33536e6180ce1d623d0922f7de5c975b6b3e)
-
73254817
by Ben Gamari at 2026-11-30T21:00:28+01:00
rts/linker/LoadArchive: Don't rely on file extensions for identification
Previously archive members would be identified via their file extension,
as described in #13103. We now instead use a more principled approach,
relying on the magic number in the member's header.
As well, we refactor treatment of archive format detection to improve
code clarity and error handling.
Closes #13103.
(cherry picked from commit 76d1041dfa4b96108cfdd22b07f2b3feb424dcbe)
-
f538ad86
by Julian Ospald at 2026-11-30T21:00:28+01:00
rts: Fix object file format detection in loadArchive
Commit 76d1041dfa4b96108cfdd22b07f2b3feb424dcbe seems to
have introduced this bug, ultimately leading to failure of
test T11788. I can only theorize that this test isn't run
in upstream's CI, because they don't build a static GHC.
The culprit is that we go through the thin archive, trying
to follow the members on the filesystem, but don't
re-identify the new object format of the member. This pins
`object_fmt` to `NotObject` from the thin archive.
Thanks to @angerman for spotting this.
(cherry picked from commit fc958fc9eb6f6f4db473cdda23c381da8f32163d)
-
48393971
by Andreas Klebinger at 2026-11-30T21:00:28+01:00
rts: Support COFF BigObj files in archives.
(cherry picked from commit 01136779b1d4c1576c925ef673f55c81c45d8551)
-
0284b105
by Sylvain Henry at 2026-11-30T21:00:28+01:00
Bump stack resolver to use GHC 9.6.7
Cf #26139
(cherry picked from commit e358e47756b455e167165950fb305b7413366ec4)
-
4c3f2eb3
by Simon Peyton Jones at 2026-11-30T21:00:29+01:00
Take more care in zonkEqTypes on AppTy/AppTy
This patch fixes #26256.
See Note [zonkEqTypes and the PKTI] in GHC.Tc.Solver.Equality
(cherry picked from commit 18036d5205ac648bb245217519fed2fd931a9982)
-
dd2065df
by Cheng Shao at 2026-11-30T21:00:29+01:00
libffi: update to 3.5.2
Bumps libffi submodule.
(cherry picked from commit 45dbfa23f508f221b6aeb667783a928511a7654e)
-
3a5560ff
by sheaf at 2026-11-30T21:00:29+01:00
Use tcMkScaledFunTys in matchExpectedFunTys
We should use tcMkScaledFunTys rather than mkScaledFunTys in
GHC.Tc.Utils.Unify.matchExpectedFunTys, as the latter crashes
when the kind of the result type is a bare metavariable.
We know the result is always Type-like, so we don't need scaledFunTys
to try to rediscover that from the kind.
Fixes #26277
(cherry picked from commit 624afa4a65caa8ec23f85e70574dfb606f90c173)
-
a6582453
by Andreas Klebinger at 2026-11-30T21:00:29+01:00
Bump hadrian directory bound to 1.3.9 for windows.
While it's annoying because older releases don't ship it, it seems
borderling impossible to build the branch without it on windows. So we
use the tighther bound to give builds on windows a chance to finish.
-
476d8629
by Ben Gamari at 2026-11-30T21:00:29+01:00
StgToByteCode: Don't assume that data con workers are nullary
Previously StgToByteCode assumed that all data-con workers were of a
nullary representation. This is not a valid assumption, as seen
in #23210, where an unsaturated application of a unary data
constructor's worker resulted in invalid bytecode. Sadly, I have not yet
been able to reduce a minimal testcase for this.
Fixes #23210.
(cherry picked from commit d1d9e39ec293cd1d2b539b8246a349b539c6a61a)
-
d30f7eb1
by Ben Gamari at 2026-11-30T21:00:29+01:00
testsuite: Mark T23146* as unbroken
(cherry picked from commit 3eeecd508ef80812bc8ee84ab83f496f5030d59b)
-
b2c0938c
by sheaf at 2026-11-30T21:00:29+01:00
Add test for #26216
(cherry picked from commit 2e73f3426ab6e3cf1938b53831005593f3fd351c)
-
0973a843
by Cheng Shao at 2026-11-30T21:00:30+01:00
hadrian: fix GHC.Platform.Host generation for cross stage1
This patch fixes incorrectly GHC.Platform.Host generation logic for
cross stage1 in hadrian (#26449). Also adds T26449 test case to
witness the fix.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit 8cbe006ad09d5a64e4a3cdf4c91a8b81ff1511be)
-
e0def6b9
by Ben Gamari at 2026-11-30T21:00:30+01:00
gitlab-ci: Make RELEASE_JOB an input
Rather than an undocumented variable.
(cherry picked from commit f9790ca81deb8b14ff2eabf701aecbcfd6501963)
-
327b9aea
by Ben Gamari at 2026-11-30T21:00:30+01:00
rts/nonmoving: Fix comment spelling
(cherry picked from commit 14281a22eb27498886def8e5d17797c9ce62f3ad)
-
d94974a7
by Ben Gamari at 2026-11-30T21:00:30+01:00
rts/nonmoving: Use atomic operations to update bd->flags
(cherry picked from commit bedd38b01d6b113cb3bd10b5d784c16b32efb5bb)
-
459214c2
by Ben Gamari at 2026-11-30T21:00:30+01:00
nonmoving: Use get_itbl instead of explicit loads
This is cleaner and also fixes unnecessary (and unsound) use of
`volatile`.
(cherry picked from commit 215d68414020dc4ed0636508c9eecd9f44f62168)
-
968f1664
by Ben Gamari at 2026-11-30T21:00:31+01:00
rts/Scav: Handle WHITEHOLEs in scavenge_one
`scavenge_one`, used to scavenge mutable list entries, may encounter
`WHITEHOLE`s when the non-moving GC is in use via two paths:
1. when an MVAR is being marked concurrently
2. when the object belongs to a chain of selectors being short-cutted.
Fixes #26204.
(cherry picked from commit 2c94aa3aa87c14b1ff5c4355c9a90efedd5d10f4)
-
ccdc05bf
by Cheng Shao at 2026-11-30T21:00:31+01:00
testsuite: fix T3586 for non-SSE3 platforms
`T3586.hs` contains `-fvia-C -optc-msse3` which I think is a
best-effort basis to harvest the C compiler's auto vectorization
optimizations via the C backend back when the test was added. The
`-fvia-C` part is now a deprecated no-op because GHC can't fall back
to the C backend on a non-unregisterised build, and `-optc-msse3`
might actually cause the test to fail on non x86/x64 platforms, e.g.
recent builds of wasi-sdk would report `wasm32-wasi-clang: error:
unsupported option '-msse3' for target 'wasm32-unknown-wasi'`.
So this patch cleans up this historical cruft. `-fvia-C` is removed,
and `-optc-msse3` is only passed when cpuid contains `pni` (which
indicates support of SSE3).
(cherry picked from commit 70ee825a516bcf7aac762bfedb4a017d35f8dcf3)
-
0f3942ed
by Andreas Klebinger at 2026-11-30T21:00:31+01:00
Add a perf test for #26425
(cherry picked from commit 4038a28b8594ae91c000d5bc7fceed4815eb4826)
-
72940255
by Andreas Klebinger at 2026-11-30T21:00:31+01:00
OccAnal: Be stricter for better compiler perf.
In particular we are now stricter:
* When combining usageDetails.
* When computing binder info.
In combineUsageDetails when combining the underlying adds we compute a
new `LocalOcc` for each entry by combining the two existing ones.
Rather than wait for those entries to be forced down the road we now
force them immediately. Speeding up T26425 by about 10% with little
effect on the common case.
We also force binders we put into the Core AST everywhere now.
Failure to do so risks leaking the occ env used to set the binders
OccInfo.
For T26425 compiler residency went down by a factor of ~10x.
Compile time also improved by a factor of ~1.6.
-------------------------
Metric Decrease:
T18698a
T26425
T9233
-------------------------
(cherry picked from commit f997618e08ce5aad8b7564b8073889b52bc18700)
-
bb3f9eb8
by Simon Peyton Jones at 2026-11-30T21:00:31+01:00
Fix a horrible shadowing bug in implicit parameters
Fixes #26451. The change is in GHC.Tc.Solver.Monad.updInertDicts
where we now do /not/ delete /Wanted/ implicit-parameeter constraints.
This bug has been in GHC since 9.8! But it's quite hard to provoke;
I contructed a tests in T26451, but it was hard to do so.
(cherry picked from commit c052c724d2dfc994994b6548545836969aee8ed8)
(cherry picked from commit 451c6a43809b0e300b9b09bbad1e8f1a4e2d378b)
-
8bb98726
by sheaf at 2026-11-30T21:00:31+01:00
localRegistersConflict: account for assignment LHS
This commit fixes a serious oversight in GHC.Cmm.Sink.conflicts,
specifically the code that computes which local registers conflict
between an assignment and a Cmm statement.
If we have:
assignment: <local_reg> = <expr>
node: <local_reg> = <other_expr>
then clearly the two conflict, because we cannot move one statement past
the other, as they assign two different values to the same local
register. (Recall that 'conflicts (local_reg,expr) node' is False if and
only if the assignment 'local_reg = expr' can be safely commuted past
the statement 'node'.)
The fix is to update 'GHC.Cmm.Sink.localRegistersConflict' to take into
account the following two situations:
(1) 'node' defines the LHS local register of the assignment,
(2) 'node' defines a local register used in the RHS of the assignment.
The bug is precisely that we were previously missing condition (1).
Fixes #26550
(cherry picked from commit 43fa8be89bdccbbe730daf0be7bdae8dde99ce44)
-
72afbc88
by ARATA Mizuki at 2026-11-30T21:00:32+01:00
Fix the order of spill/reload instructions
The AArch64 NCG could emit multiple instructions for a single spill/reload,
but their order was not consistent between the definition and a use.
Fixes #26537
Co-authored-by: sheaf <sam.derbyshire@gmail.com>
(cherry picked from commit aada5db93a2f0fd00c0715ad9ca4f666ffb3d9d8)
-
39525a35
by Matthew Pickering at 2026-11-30T21:00:32+01:00
rts: Fix a deadlock with eventlog flush interval and RTS shutdown
The ghc_ticker thread attempts to flush at the eventlog tick interval, this requires
waiting to take all capabilities.
At the same time, the main thread is shutting down, the schedule is
stopped and then we wait for the ticker thread to finish.
Therefore we are deadlocked.
The solution is to use `newBoundTask/exitMyTask`, so that flushing can
cooperate with the scheduler shutdown.
Fixes #26573
(cherry picked from commit b7fe744598b4569cd0236268e4f6f5b9d27e12b7)
-
275b755d
by Zubin Duggal at 2026-11-30T21:00:32+01:00
rts/linker/PEi386: Copy strings before they are inserted into LoadedDllCache. The original strings are temporary and might be freed at an arbitrary point.
Fixes #26613
(cherry picked from commit 82db70420e546fba189ddc26cc69e57961e46ac0)
-
d27f363c
by Ben Gamari at 2026-11-30T21:00:32+01:00
gitlab-ci: Run ghcup-metadata jobs on OpenCape runners
This significantly reduces our egress traffic
and makes the jobs significantly faster.
(cherry picked from commit ff3f0d09bce1c261638b572af2bac1d87f1f6df7)
-
bdab4b65
by Luite Stegeman at 2026-11-30T21:00:32+01:00
rts: Handle overflow of ELF section header string table
If the section header string table is stored in a section greater
than or equal to SHN_LORESERVE (0xff00), the 16-bit field e_shstrndx
in the ELF header does not contain the section number, but rather
an overflow value SHN_XINDEX (0xffff) indicating that we need to look
elsewhere.
This fixes the linker by not using e_shstrndx directly but calling
elf_shstrndx, which correctly handles the SHN_XINDEX value.
Fixes #26603
(cherry picked from commit c71faa7697f2d0bc8b92173aeb1f063ca8ed235a)
-
8972a5dd
by Matthew Pickering at 2026-11-30T21:00:32+01:00
hadrian: Use a response file to invoke GHC for dep gathering.
In some cases we construct an argument list too long for GHC to
handle directly on windows. This happens when we generate
the dependency file because the command line will contain
references to a large number of .hs files.
To avoid this we now invoke GHC using a response file when
generating dependencies to sidestep length limitations.
Note that we only pass the actual file names in the dependency
file. Why? Because this side-steps #26560
(cherry picked from commit 9d371d23c526fd160d7e99bef2bc7da825cf3c0f)
-
23c2e3ca
by Cheng Shao at 2026-11-30T21:00:32+01:00
testsuite: run numeric tests with optasm when available
This patch adds the `optasm` extra way to nueric tests when NCG is
available. Some numeric bugs only surface with optimization, omitting
this can hide these bugs and even make them slip into release! (e.g. #26711)
(cherry picked from commit ae1aeaabac1d49c98be2b48700dcbb4cc402ffe0)
-
4b4315f4
by Matthew Pickering at 2026-11-30T21:00:33+01:00
rts: Use INFO_TABLE_CONSTR for stg_dummy_ret_closure
Since the closure type is CONSTR_NOCAF, we need to use INFO_TABLE_CONSTR
to populate the constructor description field (this crashes ghc-debug
when decoding AP_STACK frames sometimes)
Fixes #26745
(cherry picked from commit 322dd6726b11c7101c28ffb8aeb7cb4cee34ab56)
-
3f7163cf
by Cheng Shao at 2026-11-30T21:00:33+01:00
compiler: change sectionProtection to take SectionType argument
This commit changes `sectionProtection` to only take `SectionType`
argument instead of whole `Section`, since it doesn't need the Cmm
section content anyway, and it can then be called in parts of NCG
where we only have a `SectionType` in scope.
(cherry picked from commit 2433e91d41675d56f48f82d22430a8dee915e7a0)
(cherry picked from commit dcf082dd569766ffda210b71137421954dc57ab4)
-
e65bcaa2
by Cheng Shao at 2026-11-30T21:00:33+01:00
compiler: change isInitOrFiniSection to take SectionType argument
This commit changes `isInitOrFiniSection` to only take `SectionType`
argument instead of whole `Section`, since it doesn't need the Cmm
section content anyway, and it can then be called in parts of NCG
where we only have a `SectionType` in scope. Also marks it as
exported.
(cherry picked from commit e5926fbebf341ee547227d41710d78471eecd09c)
(cherry picked from commit 19b88fab3744946ae72152f03b55c5fca24d87de)
-
35dc5f30
by Cheng Shao at 2026-11-30T21:00:33+01:00
compiler: fix split sections on windows
This patch fixes split sections on windows by emitting the right
COMDAT section header in NCG, see added comment for more explanation.
Fix #26696 #26494.
-------------------------
Metric Decrease:
LargeRecord
T9675
size_hello_artifact
size_hello_artifact_gzip
size_hello_unicode
size_hello_unicode_gzip
Metric Increase:
T13035
-------------------------
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit 244d57d79a555dcecc7590287bb14976d561291a)
(cherry picked from commit b492c8471ef93aa2108b34560f2a1a4de6b7824c)
-
d49295a1
by fendor at 2026-11-30T21:00:33+01:00
Remove `traceId` from ghc-pkg executable
(cherry picked from commit d0966e64880e9fa30ce07c0fa5ea28108c6e8ad9)
-
e15ac416
by Andreas Klebinger at 2026-11-30T21:00:34+01:00
ncg: Give Format a Ord instance to help backports.
-
182ed818
by Peter Trommler at 2026-11-30T21:00:34+01:00
PPC NCG: Fix shift right MO code
The shift amount in shift right [arithmetic] MOs is machine word
width. Therefore remove unnecessary zero- or sign-extending of
shift amount.
It looks harmless to extend the shift amount argument because the
shift right instruction uses only the seven lowest bits (i. e. mod 128).
But now we have a conversion operation from a smaller type to word width
around a memory load at word width. The types are not matching up but
there is no check done in CodeGen. The necessary conversion from word
width down to the smaller width would be translated into a no-op on
PowerPC anyway. So all seems harmless if it was not for a small
optimisation in getRegister'.
In getRegister' a load instruction with the smaller width of the
conversion operation was generated. This loaded the most significant
bits of the word in memory on a big-endian platform. These bits were
zero and hence shift right was used with shift amount zero and not one
as required in test Sized.
Fixes #26519
(cherry picked from commit c1fe009739da8b368e59b87b00d7c568ab571643)
-
e85e1e2a
by Cheng Shao at 2026-11-30T21:00:34+01:00
llvm: fix split sections for llvm backend
This patch fixes split sections for llvm backend:
- Pass missing `--data-sections`/`--function-sections` flags to
llc/opt.
- Use `@llvm.compiler.used` instead of `@llvm.used` to avoid sections
being unnecessarily retained at link-time.
Fixes #26770.
-------------------------
Metric Decrease:
libdir
size_hello_artifact
size_hello_unicode
-------------------------
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit b18b2c42c32488ad6d3480a56a1fcd753cad2023)
-
3839f343
by Andreas Klebinger at 2026-11-30T21:00:34+01:00
Update ghc-experimental changelog
-
95278d6b
by sterni at 2026-11-30T21:00:34+01:00
users_guide: fix runtime error during build with Sphinx 9.1.0
Appears that pathto is stricter about what it accepts now.
Tested Sphinx 8.2.3 and 9.1.0 on the ghc-9.10 branch.
Resolves #26810.
Co-authored-by: Martin Weinelt <hexa@darmstadt.ccc.de>
(cherry picked from commit e8f5a45de561ec80c88cd3da2c66502deb32d4c3)
-
65157e89
by Jessica Clarke at 2026-11-30T21:00:34+01:00
PPC NCG: Use libcall for 64-bit cmpxchg on 32-bit PowerPC
There is no native instruction for this, and even if there were a
register pair version we could use, the implementation here is assuming
the values fit in a single register, and we end up only using / defining
the low halves of the registers.
Fixes: b4d39adbb5 ("PrimOps: Add CAS op for all int sizes")
Fixes: #23969
(cherry picked from commit ce2d62fba69d2ea0c74c46c50628feb8b81719d2)
-
258ebf01
by Michael Karcher at 2026-11-30T21:00:34+01:00
NCG for PPC: add pattern for CmmRegOff to iselExpr64
Closes #26828
(cherry picked from commit 43d977619de65c0cf87695fa5d86f1a3ff3176c3)
-
1ba015b6
by Andreas Klebinger at 2026-11-30T21:00:35+01:00
testsuite: Explicitly use utf-8 encoding in rts-includes linter.
Not doing so caused failures on windows, as python failed to pick a
reasonable encoding even with locale set.
Fixes #26850
(cherry picked from commit 01ecb61234b03b94d08ab649395e2da074a4f9d3)
-
63244144
by Matthew Pickering at 2026-11-30T21:00:35+01:00
determinism: Use a stable sort in WithHsDocIdentifiers binary instance
`WithHsDocIdentifiers` is defined as
```
71 data WithHsDocIdentifiers a pass = WithHsDocIdentifiers
72 { hsDocString :: !a
73 , hsDocIdentifiers :: ![Located (IdP pass)]
74 }
```
This list of names is populated from `rnHsDocIdentifiers`, which calls
`lookupGRE`, which calls `lookupOccEnv_AllNameSpaces`, which calls
`nonDetEltsUFM` and returns the results in an order depending on
uniques.
Sorting the list with a stable sort before returning the interface makes
the output deterministic and follows the approach taken by other fields
in `Docs`.
Fixes #26858
(cherry picked from commit 0020e38a021b5f0371c48fe73cddf8987acb1eb1)
-
d26a686c
by John Paul Adrian Glaubitz at 2026-11-30T21:00:35+01:00
rts: Switch prim to use modern atomic compiler builtins
The __sync_*() atomic compiler builtins have been deprecated in GCC
for a while now and also don't provide variants for 64-bit values
such as __sync_fetch_and_add_8().
Thus, replace them with the modern __atomic_*() compiler builtins and
while we're at it, also drop the helper macro CAS_NAND() which is now
no longer needed since we stopped using the __sync_*() compiler builtins
altogether.
Co-authored-by: Ilias Tsitsimpis <iliastsi@debian.org>
Fixes #26729
(cherry picked from commit 7c52c4f9bc8d6ae6404039ec02efe48fbf7a4778)
-
095ff134
by sheaf at 2026-11-30T21:00:35+01:00
System.Info.fullCompilerVersion: add 'since' annot
Fixes #26973
(cherry picked from commit fc8b8e27398b4d9d901fb65d15a7d8b23df428b8)
-
1f80e27e
by Andreas Klebinger at 2026-11-30T21:00:35+01:00
Fix missing profiling header for origin_thunk frame.
Fixes #27007
(cherry picked from commit 63ae8eb38c54eaba77949b048a3621a5f4ca76e3)
-
57286ab5
by Andreas Klebinger at 2026-11-30T21:00:35+01:00
Configure: Fix check for --target support in stage0 CC
The check FP_PROG_CC_LINKER_TARGET used $CC unconditionally to check for
--target support. However this fails for the stage0 config where the C
compiler used is not $CC but $CC_STAGE0.
Since we already pass the compiler under test into the macro I simply
changed it to use that instead.
Fixes #26999
(cherry picked from commit 43638643adbe999de8d2288a40bdd15c602f6481)
-
3780675a
by Zubin Duggal at 2026-11-30T21:00:35+01:00
compiler/ffi: Collapse void pointer chains in capi wrappers
New gcc/clang treat -Wincompatible-pointer-types as an error by
default. Since C only allows implicit conversion from void*, not void**,
capi wrappers for functions taking e.g. abstract** would fail to compile
when the Haskell type Ptr (Ptr Abstract) was naively translated to void**.
Collapse nested void pointers to a single void* when the pointee type
has no known C representation.
Fixes #26852
(cherry picked from commit 80e2dd4f084eff9cc857b31daf9ea2e9e460c727)
-
47204bd3
by Ian Duncan at 2026-11-30T21:00:36+01:00
AArch64: fix MOVK regUsageOfInstr to mark dst as both read and written
MOVK (move with keep) modifies only a 16-bit slice of the destination
register, so the destination is both read and written. The register
allocator must know this to avoid clobbering live values. Update
regUsageOfInstr to list the destination in both src and dst sets.
No regression test: triggering the misallocation requires specific
register pressure around a MOVK sequence, which is difficult to
reliably provoke from Haskell source.
(cherry picked from commit 2823b03966e495581f4695f07649c5885306b656)
-
24464149
by Matthew Pickering at 2026-11-30T21:00:36+01:00
testsuite: Add test for foreign import prim with unboxed tuple return
This commit just adds a test that foreign import prim works with unboxed
sums.
(cherry picked from commit d57f01a4dd8b3886a02731c8ca27ee758baa768a)
-
a74bf3b8
by Matthew Pickering at 2026-11-30T21:00:36+01:00
Return a valid pointer in advanceStackFrameLocationzh
When there is no next stack chunk, `advanceStackFrameLocationzh` used to
return NULL in the pointer-typed StackSnapshot# result slot.
Even though the caller treats that case as "no next frame", the result is
still materialized in a GC-visible pointer slot. If a GC observes the raw
NULL there, stack decoding can crash.
Fix this by ensuring the dead pointer slot contains a valid closure
pointer. Also make the optional result explicit by returning an unboxed
sum instead of a tuple with a separate tag.
Fixes #27009
(cherry picked from commit 23d111ce0b2bef9bbf1fae2224359b2e1e79be65)
-
05d21c4b
by Matthew Pickering at 2026-11-30T21:00:36+01:00
rts: forward clone-stack messages after TSO migration
MSG_CLONE_STACK assumed that the target TSO was still owned by the
capability that received the message. This is not always true: the TSO
can migrate before the inbox entry is handled.
When that happened, handleCloneStackMessage could clone a live stack from
the wrong capability and use the wrong capability for allocation and
performTryPutMVar, leading to stack sanity failures such as
checkStackFrame: weird activation record found on stack.
Fix this by passing the current capability into
handleCloneStackMessage, rechecking msg->tso->cap at handling time, and
forwarding the message if the TSO has migrated. Once ownership matches,
use the executing capability consistently for cloneStack, rts_apply, and
performTryPutMVar.
Fixes #27008
(cherry picked from commit 5b550754ca0153a705ec607407074fe5716c1f7e)
-
5ef7182a
by Zubin Duggal at 2026-11-30T21:00:36+01:00
driver: recognise .dyn_o as a valid object file to link if passed on the command line.
This allows plugins compiled with this suffix to run.
Fixes #24486
(cherry picked from commit bc4b44870d096d43e8cbc530da1fd613d9e4514f)
-
e3cf0fe6
by Zubin Duggal at 2026-11-30T21:00:37+01:00
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
(cherry picked from commit 07267f79d91169f474cacc8bcd38d76a6e97887d)
-
508606a2
by Cheng Shao at 2026-11-30T21:00:37+01:00
testsuite: mark T22159 as fragile
This patch marks T22159 as fragile on Windows for issue described in #27248.
Before we get to the bottom of those failures, this unblocks newer
Windows runners.
(cherry picked from commit 38b76b2f1d918f10d2f9d3e57bd0459dfe671d4f)
-
37e7d264
by Ian Duncan at 2026-11-30T21:00:37+01:00
AArch64: use ASR not LSR for MO_U_Shr at W8/W16
The unsigned right shift (MO_U_Shr) for sub-word widths (W8, W16)
with a variable shift amount was emitting ASR (arithmetic/signed shift
right) after zero-extending with UXTB/UXTH. This should be LSR
(logical/unsigned shift right). After zero-extension the upper bits
happen to be 0 so ASR produces the same result, but it is semantically
wrong and would break if the zero-extension were ever optimized away.
Includes assembly output test (grep for lsr) and runtime test
verifying unsigned right shift of Word8 and Word16 values.
(cherry picked from commit 50188615342098345fc2822ea223ab23791bbf49)
-
2a19a116
by Tom McLaughlin at 2026-11-30T21:00:37+01:00
Event/Windows.hsc: rethrow exceptions in overlapped IO
This prevents the WinIO manager from swallowing exceptions in overlapped IO. It
was added to make WinIO support possible in the `network` library. See
https://gitlab.haskell.org/ghc/ghc/-/issues/27283.
We also bump __IO_MANAGER_WINIO__ to 2 so libraries can gate on this using CPP.
(cherry picked from commit 037a80dc65d3975adf4a35d46876850e644bc80e)
-
10f0f23c
by Ben Gamari at 2026-11-30T21:00:37+01:00
Cmm/Parser: Add surface syntax for Mul2 MachOps
These are otherwise very hard to test in isolation.
(cherry picked from commit ef5470a226dd8fe84df500a6a68672548624559e)
-
702ed9d9
by sheaf at 2026-11-30T21:00:37+01:00
Fix AArch64 clobbering bug for MUL2
On AArch64, the code generator could clobber one of the input operands
when computing the lower bits of a MUL2 operation. This rendered invalid
the subsequent computation of the high bits.
This commit fixes that by using a temporary register. The register
allocator can remove the redundant move in the common case when the
registers do not conflict.
Fixes #27046
(cherry picked from commit c9015f0953e72829e89ac768b6ad9ece34c7e187)
-
187fd45d
by Cheng Shao at 2026-11-30T21:00:38+01:00
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit ca79475f6b4dfba991e2c933bac9c22d54a4950d)
-
52571225
by mangoiv at 2026-11-30T21:00:38+01:00
libraries/process: bump submodule to v1.6.30.0
- bump the submodule to the appropriate tag
- suppress benign warning resulting from the change
(cherry picked from commit d9ea2d76545452a7df567b162340079cb024a40c)
-
99f454ef
by Zubin Duggal at 2026-11-30T21:00:38+01:00
rts: fix validate build with gcc 16. `__attribute__((regparm(1)))` is ignored on x86_64 and now
gcc warns that it is ignored:
rts/sm/Evac.h:35:1: error:
error: ‘regparm’ attribute ignored [-Werror=attributes]
See https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ccead81bbc39668376eb5cf47066acb446cc43f3
Fixes #27366
(cherry picked from commit 9438bec7117433bbc70449d4288f6ee32dbbbec4)
-
d78e8709
by Sylvain Henry at 2026-11-30T21:00:38+01:00
RTS: fix warnings with doing*Profiling (#24918)
(cherry picked from commit 5132754b80d468e0c24e39b63eea525dc1ee3a5b)
-
51f6d628
by Ian Duncan at 2026-11-30T21:00:38+01:00
AArch64: use SXTH, not SXTW, for W32 signExtendReg
signExtendReg was using SXTH (sign-extend halfword, 16-bit) for
W32-to-W64 sign extension. This should be SXTW (sign-extend word,
32-bit). SXTH only sign-extends the lower 16 bits, producing wrong
results for 32-bit values whose bit 15 differs from bit 31.
Other fixes:
- At sub-W64, code gen for MO_S_Mul2 should use W32 registers for
SMULL source operands as per the ARM spec (SMULL Xd, Wn, Wm),
and not W64.
- Ensure signExtendReg uses the source width for the source operand
in SXTW/SXTH/SXTB instructions. GNU as requires sxtw Xd,Wn (not
sxtw Xd,Xn), while LLVM's integrated assembler on macOS is lenient.
- Fix overflow flag computation for `MO_S_Mul2`. The overflow bit
was exactly inverted for sub-W64 operands.
Fixes #26978 and #27047
(cherry picked from commit 636c1c7ae47495f022affa501ea0a40cb55cd4a4)
-
48c7b0e0
by Ben Gamari at 2026-11-30T21:00:38+01:00
testsuite: Only run T14497_compact in normal way
This test targets the compacting GC so it makes little sense to run it
across all ways. Moreover, it outright conflicts with the `nonmoving`
way.
(cherry picked from commit ef2052a86393c406342f32e7c1a310c932c9ac8f)
-
568d3b4f
by Ben Gamari at 2026-11-30T21:00:39+01:00
testsuite: Mark T23071 and T2047 as fragile on FreeBSD
These inexplicably fail on FreeBSD on CI. Sadly I am unable to reproduce
this locally but regardless this is holding up Marge so I will mark them
as fragile for now.
Addresses #25751.
(cherry picked from commit ef0e6cfc4e348a8c598578052c5b24e2d685e91c)
-
f2456af2
by Sven Tennie at 2026-11-30T21:00:39+01:00
Add reproducer for dealloc instructions in switch table jump expressions (#25733)
Measures taken to make the test stable:
- Use 'a' as variable prefix, because X86 32bit stumbled over the
variable name 'i386'
- Flush stdout to make test output deterministic
- Use type annotations to support 32bit archs
(cherry picked from commit 39e51ddbc03afda71608bcef75c64f57c6175183)
-
0159252e
by Cheng Shao at 2026-11-30T21:00:39+01:00
compiler: fix missing handling of CmmUnsafeForeignCall node in LayoutStack
This patch fixes missing handling of `CmmUnsafeForeignCall` middle
node in the `LayoutStack` pass.
Before proc-points splitting, this pass computes liveliness of local
registers, and spills those alive across a Cmm native call onto the
stack. It need to traverse all middle nodes in each block and check
whether a local register is an assignee, if so then the previous
mapping in `sm_regs` is invalidated and needs to be dropped. However,
it didn't handle `CmmUnsafeForeignCall` node which may also assign to
a local register. When proc-points splitting is enabled, this can
produce an invalid basic block that doesn't properly backup the
updated local register to the stack before doing a Cmm call, resulting
in completely invalid runtime behavior.
The patch also adds a `T27447` regression test. With no-TNTC or with
LLVM backend, without the fix the test case would output a stale
0x1111111111111111 value, instead of the expected 0x2222222222222222
output.
Fixes #27447.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit 3f00f234d0d5b3b3b2a23a5dc70ce372eb9bbdb4)
-
00486a78
by mangoiv at 2026-11-30T21:00:39+01:00
ci: retry fetching test metrics
Retry fetching test metrics to make the CI not fail if the services is
temporarily unavailable
(cherry picked from commit b7e24044fde064cb3f0d44c36872a86d024cd7d4)
-
b31d61e8
by Zubin Duggal at 2026-11-30T21:00:40+01:00
Update to semaphore-compat 2.0.0 using v2 of the protocol
On Linux and other POSIX platforms, GHC's -jsem jobserver client now
speaks v2 of the semaphore-compat protocol, which uses Unix domain
sockets in place of POSIX named semaphores. This avoids the libc-ABI
issues that affected the old implementation. Windows is unaffected
and continues to use the v1 protocol (Win32 named semaphores); its
reported protocol version remains v1.
When GHC receives a -jsem name whose protocol version it does not
support, it emits a -Wsemaphore-version-mismatch warning and falls
back to -j<N> rather than crashing. ghc --info exposes the supported
version in a new "Semaphore version" entry so cabal-install can detect
a mismatch before invoking GHC.
Users on a cabal-install that predates the v2 update will continue to
build successfully on Linux/POSIX, but will lose the cross-process
-jsem coordination and fall back to -j<N> per GHC invocation. Users
must upgrade to a cabal-install that supports protocol v2 to recover
full parallelism.
Also fix a leak in cleanupSem (#27253): cleanupSem used to snapshot
heldTokens and release them before killing the loop, while the loop's
in-flight acquire/release children could still be mutating it.
Cleanup now runs inside the loop's own exit handler, after draining
the active child via a new activeChild TVar, so the snapshot has no
concurrent mutator.
See also:
- GHC proposal amendment: https://github.com/ghc-proposals/ghc-proposals/pull/673
- cabal-install patch: https://github.com/haskell/cabal/pull/11628
- semaphore-compat MR: https://gitlab.haskell.org/ghc/semaphore-compat/-/merge_requests/8
Bump semaphore-compat submodule to 2.0.0
Fixes #25087 and #27253
(cherry picked from commit 8db331a381ae47ad9ad5c8613f5d3e2588d5dd55)
-
cb1078c6
by Andreas Klebinger at 2026-11-30T21:00:40+01:00
Fix a profiling race condition resulting in segfaults.
StgToCmm: Don't assume tagged FUN closures in closureCodeBody.
When entering a closure the self/node pointer might not be tagged in
some situations when a thunk is evaluated by multiple threads.
So we most AND away the tag bits rather than subtracting an expected tag.
Apply.cmm: Fix a race condition occuring when a thunk is mutated during GC.
In stg_ap_0_fast when might need to run GC before entering a thunk. If this happens
another thread or the GC itself might mutate the closure making entering it no longer
valid. We now check for this.
Add test and changelog for #27123 fixes.
(cherry picked from commit ed09895d7de1ca116a561868c151fd825a16ad0c)
-
ded1bf7d
by Cheng Shao at 2026-11-30T21:00:40+01:00
ghc-heap: fix invalid srtlen returned by peekItbl when no-TNTC
This patch fixes the no-TNTC code path of `peekItbl` so that it looks
at the right memory address when reading the `srt` field from the
`StgInfoTable_` struct. Also adds a `T27465` regression test that
reproduces the bug on no-TNTC builds before the fix. Fixes #27465.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit 67c03eb2c762fdfeb646eb8345341173dd4268b2)
-
8cb7ce11
by Cheng Shao at 2026-11-30T21:00:40+01:00
compiler: fix miscompiled %load_relaxed, add missing %store_relaxed
This patch fixes the %load_relaxed cmm primop compilation logic to
correctly use relaxed memory ordering, and adds the missing
%store_relaxed primop. Parsing logic of %load/%store with explicit
ordering is covered in the AtomicFetch test case. Fixes #27483.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit eee8ec5b25ef0f83ba4822e7a0a941df7b0bec5f)
-
30260cad
by Cheng Shao at 2026-11-30T21:00:40+01:00
rts: fix missing UNTAG in stg_readTVarIOzh
This patch fixes missing UNTAG on the current value closure read from
StgTVar. UNTAG is a no-op when it's stg_TREC_HEADER_info which is word
aligned; it may be a tagged closure, and reading info table from the
tagged address is an unaligned load which may cause issues on
platforms with strict alignment requirements.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit d377e83e51d39a06e1f0bf2e35a923a3210b21a2)
-
d93f42ec
by Cheng Shao at 2026-11-30T21:00:40+01:00
rts: fix missing UNTAG in stg_control0zh_ll
This patch fixes missing UNTAG on the cont closure returned by
captureContinuationAndAbort. In case it's not NULL,
captureContinuationAndAbort returns a tagged StgContinuation closure,
in which case it must be untagged before accessing the
apply_mask_frame field.
In the past it worked out of luck: when apply_mask_frame was NULL then
mask_frame_offset is also 0 so the control flow didn't diverge to a
wrong path. Still, this is horribly wrong and will crash once
StgContinuation struct is refactored and fields are shuffled around.
Co-authored-by: Codex <codex@openai.com>
(cherry picked from commit 8ed038421a20e3e4e681973b2f5098e5bd2144b5)
-
d5ae819d
by Ben Gamari at 2026-11-30T21:00:41+01:00
base: Don't drop exception context in SomeException(toException)
For reasons that are lost to time, the implementation of [CLC #200]
that was merged inappropriately dropped `ExceptionContext` in the
`toException` implementation given to `SomeException`.
Fix this infelicity.
[CLC #200]: https://github.com/haskell/core-libraries-committee/issues/200
(cherry picked from commit 2ab02c579a9625438f5281a258051cb32ba40004)
-
aa47d37d
by Zubin Duggal at 2026-11-30T21:00:41+01:00
hadrian: Fix links to remaining doc sites to not use the package hash for haddock links
In 07267f79d91169f474cacc8bcd38d76a6e97887d we changed hadrian to not include the package hash in the haddock
directory. This patch takes care of a few remaining links that were missed in that patch
Fixes #27671
(cherry picked from commit 1446bb039a635f2b836be19f062cbffa568fe4c5)
-
6537959d
by Luite Stegeman at 2026-11-30T21:00:41+01:00
rts: Fix missing memory barrier in eval_thunk_selector (#27477)
unchain_thunk_selectors() was missing an ACQUIRE_LOAD for the
indirectee, leading to segfaults and corruption during GC on
weakly-ordered architectures.
Fixes #27477
(cherry picked from commit 06eee015be4e361fe9cb33e8a608ab2ea1386b52)
-
6760531f
by Luite Stegeman at 2026-11-30T21:00:41+01:00
rts: initialise the stack frame header for mask_frame and apply_mask_frame
We must leave the stack in consistent state before jumping to
mask_frame or apply_mask_frame because they may result. Failing
to do so could lead to a crash if there were waiting exceptions.
Fixes #27651
(cherry picked from commit 5796aa637cca079854fc7e84e7e0fa497aacab3c)
-
116b9f70
by Luite Stegeman at 2026-11-30T21:00:41+01:00
rts: make stg_threadLabelzh return a valid pointer for unlabeled threads.
This fixes a segfault in the GC caused by stg_threadLabelzh returning
a 0 pointer in a GC pointer field.
stg_threadLabelzh returns a tuple of type (# Int#, ByteArray# #). If a
thread has no label, the second field is unused. We must still return
a valid heap object pointer.
Instead of returning 0, we now return stg_DEAD_SLOT_closure.
fixes #27618
(cherry picked from commit 809294f14cf6939b249d93af92c0ae174dda5b4a)
-
941b81bd
by Peng Fan at 2026-11-30T21:00:41+01:00
backport: add LoongArch NCG support for v9.10
Also bump ci-images and add cross build for CI.
Make the behaviour of the autoconf scripts consistent on
cross-buildding.
(cherry picked from commit 9586998d09d6be7ca4478b344c7db04ecd512c03)
-
48d3b2e3
by Luite Stegeman at 2026-11-30T21:00:42+01:00
rts: move stack check to the start of the stg_unpack_cstring thunks
fixes a deadlock
see #27272
(cherry picked from commit 9af64305adb72f31a68f10751956a8277f321568)
-
c5b00c2c
by Luite Stegeman at 2026-11-30T21:00:42+01:00
rts: handle large AP closures in compacting GC
The function update_fwd_large in the compacting GC could run into
an unexpected object with the following error:
internal error: update_fwd_large: unknown/strange object 24
Closure type 24 is the AP closure, which was not handled in
upd_fwd_large. This patch adds handling them.
fixes #27434
(cherry picked from commit cca0d58963f802a8b2e43aa2dbc58592f8ad07bb)
-
abce4824
by Luite Stegeman at 2026-11-30T21:00:42+01:00
rts: handle large CONSTR closures in compacting GC
The function update_fwd_large in the compacting GC could run into
an unexpected object with the following error:
internal error: update_fwd_large: unknown/strange object 1
Closure type 1 is CONSTR. This patch adds cases for CONSTR and
CONSTR_NOCAF.
This is the same problem as #27434 (large AP closures, fixed by
cca0d58963), which missed this case.
Fixes #27649
(cherry picked from commit 749d2448eb56367046b2de890f1bf89a856ce53f)
-
8767dd51
by Luite Stegeman at 2026-11-30T21:00:42+01:00
testsuite: fix T27434 test with compacting GC
Ensure that the interpreter is actually run with the compacting GC
(cherry picked from commit 177d615518a44dde595f3166f56ec604e0675b3b)
-
4600dea0
by Ben Gamari at 2026-11-30T21:18:20+01:00
rts/LoadArchive: Handle null terminated string tables
As of `llvm-ar` now emits filename tables terminated with null
characters instead of the usual POSIX `/\n` sequence.
Fixes #26150.
(cherry picked from commit 3b63b254cb8b1832f32751aed6d05ceaabdeb826)
-
9673a7bf
by Tamar Christina at 2026-11-30T21:18:20+01:00
rts: rename label so name doesn't conflict with param
(cherry picked from commit 195f6527264d2a32bacdb34953ec471f632ef320)
-
56668291
by Ben Gamari at 2026-11-30T21:18:20+01:00
rts/LoadArchive: Handle string table entries terminated with /
llvm-ar appears to terminate string table entries with `/\n` [1]. This
matters in the case of thin archives, since the filename is used. In the
past this worked since `llvm-ar` would produce archives with "small"
filenames when possible. However, now it appears to always use the
string table.
[1] https://github.com/llvm/llvm-project/blob/bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8/llvm/lib/Object/ArchiveWriter.cpp#L314
(cherry picked from commit 65f19293124acbc2c6493ca9c098fc74150e184a)
-
8d05445c
by Ben Gamari at 2026-11-30T21:18:20+01:00
testsuite: Mark T12497 as fixed
Thanks to the LLVM toolchain update.
Closes #22694.
(cherry picked from commit 9cbb3ef5254439eaaaeb3cc8f627dd9d86ccd9d6)
-
12ae8ddb
by Ben Gamari at 2026-11-30T21:18:20+01:00
testsuite: Accept new output of T11223_link_order_a_b_2_fail on Windows
The archive member number changed due to the fact that llvm-ar now uses a
string table.
(cherry picked from commit 2854407eccb97a20a98bac370a0fb731f3776750)
-
62307cd3
by Ben Gamari at 2026-11-30T21:18:20+01:00
rts/linker/PEi386: Implement IMAGE_REL_AMD64_SECREL
This appears to now be used by libc++ as distributed by msys2.
(cherry picked from commit 284395931894150441620c72cccbc046ffcfc177)
-
6f806e16
by Tamar Christina at 2026-11-30T21:18:20+01:00
rts: Cleanup merge resolution residue in lookupSymbolInDLL_PEi386 and make safe without dependent
(cherry picked from commit 2b05375510674e6d6cdfffe68dca51a39f6dd869)