Zubin pushed to branch wip/9.12.3-backports at Glasgow Haskell Compiler / GHC
Commits:
8935a773 by Brandon Chinn at 2025-11-10T19:40:08+05:30
Fix tabs in string gaps (#26415)
Tabs in string gaps were broken in bb030d0d because previously, string gaps were manually parsed, but now it's lexed by the usual Alex grammar and post-processed after successful lexing.
It broke because of a discrepancy between GHC's lexer grammar and the Haskell Report. The Haskell Report includes tabs in whitechar:
whitechar → newline | vertab | space | tab | uniWhite
$whitechar used to include tabs until 18 years ago, when it was removed in order to exclude tabs from $white_no_nl in order to warn on tabs: 6e202120. In this MR, I'm adding \t back into $whitechar, and explicitly excluding \t from the $white_no_nl+ rule ignoring all whitespace in source code, which more accurately colocates the "ignore all whitespace except tabs, which is handled in the next line" logic.
As a side effect of this MR, tabs are now allowed in pragmas; currently, a pragma written as {-# \t LANGUAGE ... #-} is interpreted as the tab character being the pragma name, and GHC warns "Unrecognized pragma". With this change, tabs are ignored as whitespace, which more closely matches the Report anyway.
(cherry picked from commit e9c5e46ffdb3cd8725e2ffdc2c440ea57af97bac)
- - - - -
fe5becec by Ben Gamari at 2025-11-10T19:40:08+05:30
rts/nonmoving: Fix comment spelling
(cherry picked from commit 14281a22eb27498886def8e5d17797c9ce62f3ad)
- - - - -
75e629bf by Ben Gamari at 2025-11-10T19:40:08+05:30
rts/nonmoving: Use atomic operations to update bd->flags
(cherry picked from commit bedd38b01d6b113cb3bd10b5d784c16b32efb5bb)
- - - - -
bd06a0c8 by Ben Gamari at 2025-11-10T19:40:08+05:30
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)
- - - - -
7642aaa6 by Ben Gamari at 2025-11-10T19:40:08+05:30
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)
- - - - -
95265525 by Ben Gamari at 2025-11-10T19:40:08+05:30
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)
- - - - -
f687ce93 by Rodrigo Mesquita at 2025-11-10T19:40:08+05:30
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)
- - - - -
0d170a58 by Ben Gamari at 2025-11-10T19:40:08+05:30
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
participants (1)
-
Zubin (@wz1000)