[Git][ghc/ghc][wip/andreask/9.10-backports] 25 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler

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



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


Commits:
5bc9d132 by Matthew Pickering at 2025-01-13T17:31:09+01:00
configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler

In 9.10.1 the "ld command" has been removed, so we fall back to using
the more precise "merge objects command" when it's available as
LD_STAGE0 is only used to set the object merging command in hadrian.

Fixes #24949

(cherry picked from commit 564981bda9a6a309ff0f524610af0f908432442f)

- - - - -
8746a86c by Matthew Pickering at 2025-01-13T17:31:18+01:00
hadrian: Don't build ghci object files for ./hadrian/ghci target

There is some convoluted logic which determines whether we build ghci
object files are not. In any case, if you set `ghcDynPrograms = pure
False` then it forces them to be built.

Given we aren't ever building executables with this flavour it's fine
to leave `ghcDynPrograms` as the default and it should be a bit faster
to build less.

Also fixes #24949

(cherry picked from commit a949c792388b5662dd199497541f9ad51c78d1a8)

- - - - -
01d6b09b by Matthew Pickering at 2025-01-13T17:34:34+01:00
ci: Unset ALEX/HAPPY variables when testing bootstrap jobs

Ticket #24826 reports a regression in 9.10.1 when building from a source
distribution. This patch is an attempt to reproduce the issue on CI by
more aggressively removing `alex` and `happy` from the environment.

(cherry picked from commit 3f9548fe97c728ed60ba26811e4fe248fc28d2a7)

- - - - -
bc0fc221 by Andrea Bedini at 2025-01-13T17:34:44+01:00
hadrian: Ignore build-tool-depends fields in cabal files

hadrian does not utilise the build-tool-depends fields in cabal files
and their presence can cause issues when building source distribution
(see #24826)

Ideally Cabal would support building "full" source distributions which
would remove the need for workarounds in hadrian but for now we can
patch the build-tool-depends out of the cabal files.

Fixes #24826

(cherry picked from commit aba2c9d4728262cd9a2d711eded9050ac131c6c1)

- - - - -
d6d2abe2 by Zubin Duggal at 2025-01-13T17:34:59+01:00
compiler: Fingerprint -fwrite-if-simplified-core

We need to recompile if this flag is changed because later modules might depend on the
simplified core for this module if -fprefer-bytecode is enabled.

Fixes #24656

(cherry picked from commit dddc9dff0547733a10e7f505612ab9df3a7c21b6)

- - - - -
b3322a3a by Alex Mason at 2025-01-13T17:35:10+01:00
ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956]

Implements the FSQRT machop using native assembly rather than a C call.

Implements MO_BSwap by producing assembly to do the byte swapping
instead of producing a foreign call a C function.

In `tar`, the hot loop for `deserialise` got almost 4x faster by
avoiding the foreign call which caused spilling live variables to the
stack -- this means the loop did 4x more memory read/writing than
necessary in that particular case!

(cherry picked from commit dee035bf618d75a18fe72dd3977434c0749a2156)

- - - - -
0183e434 by Sylvain Henry at 2025-01-13T17:35:20+01:00
Linker: use m32 allocator for sections when NEED_PLT (#24432)

Use M32 allocator to avoid fragmentation when allocating ELF sections.
We already did this when NEED_PLT was undefined. Failing to do this led
to relocations impossible to fulfil (#24432).

(cherry picked from commit 5104ee615503617a1c124fe1d92f6aa2d263b7d0)

- - - - -
9c5cf8f8 by Sylvain Henry at 2025-01-13T17:35:25+01:00
RTS: allow M32 allocation outside of 4GB range when assuming -fPIC

(cherry picked from commit 52d6698479f951e07def237b0474ee22d27e621a)

- - - - -
2822e96b by Sylvain Henry at 2025-01-13T17:35:31+01:00
Linker: fix stub offset

Remove unjustified +8 offset that leads to memory corruption (cf
discussion in #24432).

(cherry picked from commit c34fef56367142fa55e9861092f64cc7b9946fa1)

- - - - -
ecd99e0b by Simon Peyton Jones at 2025-01-13T17:35:45+01:00
Address #25055, by disabling case-of-runRW# in Gentle phase

See Note [Case-of-case and full laziness]
in GHC.Driver.Config.Core.Opt.Simplify

(cherry picked from commit de5d9852dbdd367611bf9e45e69c723d26351992)

- - - - -
670a8cbc by Andreas Klebinger at 2025-01-13T17:40:11+01:00
Fix -freg-graphs for FP and AARch64 NCG (#24941).

It seems we reserve 8 registers instead of four for global regs
based on the layout in Note [AArch64 Register assignments].

I'm not sure it's neccesary, but for now we just accept this state of
affairs and simple update -fregs-graph to account for this.

(cherry picked from commit 3f89ab92da74c4ed45da68fe92ff81e7b9caa53d)

- - - - -
823fec13 by Simon Peyton Jones at 2025-01-13T17:46:45+01:00
Fix nasty bug in occurrence analyser

As #25096 showed, the occurrence analyser was getting one-shot info
flat out wrong.

This commit does two things:

* It fixes the bug and actually makes the code a bit tidier too.
  The work is done in the new function
     GHC.Core.Opt.OccurAnal.mkRhsOccEnv,
  especially the bit that prepares the `occ_one_shots` for the RHS.

  See Note [The OccEnv for a right hand side]

* When floating out a binding we must be conservative about one-shot
  info.  But we were zapping the entire demand info, whereas we only
  really need zap the /top level/ cardinality.

  See Note [Floatifying demand info when floating]
  in GHC.Core.Opt.SetLevels

For some reason there is a 2.2% improvement in compile-time allocation
for CoOpt_Read.  Otherwise nickels and dimes.

Metric Decrease:
    CoOpt_Read

(cherry picked from commit f6b4c1c9be71fc6fe4688337752ffa4ad84180d9)

- - - - -
7c82602d by Arnaud Spiwack at 2025-01-13T17:47:24+01:00
Add tests for 25081

(cherry picked from commit e2f2a56e42d25bae178ae1692390bbbd6275176c)

- - - - -
84ff3c72 by Arnaud Spiwack at 2025-01-13T17:47:32+01:00
Scale multiplicity in list comprehension

Fixes #25081

(cherry picked from commit 23f50640e705c132f1a0689d4850866d0f0d76a6)

- - - - -
544f2ba7 by doyougnu at 2025-01-13T17:47:42+01:00
Rts linker: add case for pc-rel 64 relocation

part of the upstream haskell.nix patches

(cherry picked from commit bfe4b3d3bbb98b39169fad063c6c32f06d167756)

- - - - -
278b7f18 by Sylvain Henry at 2025-01-13T17:47:57+01:00
Only lookup ghcversion.h file in the RTS include-dirs by default.

The code was introduced in 3549c952b535803270872adaf87262f2df0295a4.
It used `getPackageIncludePath` which name doesn't convey that it looks
into all include paths of the preload units too. So this behavior is
probably unintentional and it should be ok to change it.

Fix #25106

(cherry picked from commit f954f42823f6ca3588425a0d543d93ace86d89e4)

- - - - -
c1d30b65 by Andreas Klebinger at 2025-01-13T17:48:11+01:00
Add since annotation for -fkeep-auto-rules.

This partially addresses #25082.

- - - - -
219d34f9 by Andreas Klebinger at 2025-01-13T17:57:21+01:00
Mention `-fkeep-auto-rules` in release notes.

It was added earlier but hadn't appeared in any release notes yet.
Partially addresses #25082.

- - - - -
df444de5 by Sylvain Henry at 2025-01-13T18:01:33+01:00
Cmm: don't perform unsound optimizations on 32-bit compiler hosts

- beef61351b240967b49169d27a9a19565cf3c4af enabled the use of
  MO_Add/MO_Sub for 64-bit operations in the C and LLVM backends
- 6755d833af8c21bbad6585144b10e20ac4a0a1ab did the same for the x86 NCG
  backend

However we store some literal values as `Int` in the compiler. As a
result, some Cmm optimizations transformed target 64-bit literals into
compiler `Int`. If the compiler is 32-bit, this leads to computing with
wrong literals (see #24893 and #24700).

This patch disables these Cmm optimizations for 32-bit compilers. This
is unsatisfying (optimizations shouldn't be compiler-word-size
dependent) but it fixes the bug and it makes the patch easy to backport.
A proper fix would be much more invasive but it shall be implemented in
the future.

Co-authored-by: amesgen <amesgen at amesgen.de>
(cherry picked from commit 7446a09a2d5b04b95cd43c03659b5647853124ce)

- - - - -
bc68b829 by Sylvain Henry at 2025-01-13T18:01:45+01:00
AARCH64 linker: skip NONE relocations

This patch is part of the patches upstreamed from haskell.nix.
See https://github.com/input-output-hk/haskell.nix/pull/1960 for the
original report/patch.

(cherry picked from commit c749bdfd3e21d712dc2b966482eb010165bdeebe)

- - - - -
0d853dcc by sheaf at 2025-01-13T18:02:24+01:00
GHCi debugger: drop record name spaces for Ids

When binding new local variables at a breakpoint, we should create
Ids with variable namespace, and not record field namespace. Otherwise
the rest of the compiler falls over because the IdDetails are wrong.

Fixes #25109

(cherry picked from commit c29b2b5a77611b2bd6c3089765079bc43aec3e22)

- - - - -
7241f7bf by Sylvain Henry at 2025-01-13T18:03:39+01:00
JS: support rubbish static literals (#25177)

Support for rubbish dynamic literals was added in #24664. This patch
does the same for static literals.

Fix #25177

(cherry picked from commit 5092dbff750ee5b6fd082b7eed8574922a2b0bf4)

- - - - -
784028b6 by Arsen Arsenović at 2025-01-13T18:04:06+01:00
ghc-toolchain: Don't leave stranded a.outs when testing for -g0

This happened because, when ghc-toolchain tests for -g0, it does so by
compiling an empty program.  This compilation creates an a.out.

Since we create a temporary directory, lets place the test program
compilation in it also, so that it gets cleaned up.

Fixes: 25b0b40467d0a12601497117c0ad14e1fcab0b74
Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/25203
(cherry picked from commit b16605e7c135f8cfd357a60c7f358132faec6a84)

- - - - -
e9403d89 by Cheng Shao at 2025-01-13T18:04:16+01:00
rts: fix checkClosure error message

This patch fixes an error message in checkClosure() when the closure
has already been evacuated. The previous logic was meant to print the
evacuated closure's type in the error message, but it was completely
wrong, given info was not really an info table, but a tagged pointer
that points to the closure's new address.

(cherry picked from commit 0d3bc2fa3a9a8c342ec34bb9d32e493655a4ec69)

- - - - -
d55abf10 by Simon Peyton Jones at 2025-01-13T18:06:05+01:00
Add ZonkAny and document it

This MR fixed #24817 by adding ZonkAny, which takes a Nat
argument.

See Note [Any types] in GHC.Builtin.Types, especially
wrinkle (Any4).

(cherry picked from commit cfbff65a8bde902b4510cdaead847bf7a52b4018)

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/AArch64/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Iface/Recomp/Flags.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToJS/Literal.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Utils/Outputable.hs
- configure.ac


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3928048eea781394a688506414566793a46cf756...d55abf10ff541174a0119f9e142ec4acaf2f2661

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3928048eea781394a688506414566793a46cf756...d55abf10ff541174a0119f9e142ec4acaf2f2661
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/20250113/ca14f86c/attachment-0001.html>


More information about the ghc-commits mailing list