[Git][ghc/ghc][wip/andreask/9.10-backports] 31 commits: Add release notes for some backported 9.10.2 patches.
Andreas Klebinger (@AndreasK)
gitlab at gitlab.haskell.org
Tue Dec 17 22:10:42 UTC 2024
Andreas Klebinger pushed to branch wip/andreask/9.10-backports at Glasgow Haskell Compiler / GHC
Commits:
5cd61a7d by Andreas Klebinger at 2024-12-17T22:47:19+01:00
Add release notes for some backported 9.10.2 patches.
Contains notes for:
!11938: Escape multiple arguments in the settings file
!12201: RTS: Emit warning when -M < -H
!12495: Update autoconf scripts
!12500: GHCi: support cross-module inlining of breakpoints
!12550: wasm: use scheduler.postTask() for context switch when available
!12569: Split out the C-- preprocessor, and make it pass -g0
- - - - -
1358d141 by Andreas Klebinger at 2024-12-17T22:47:26+01:00
-fprof-late: Only insert cost centres on functions/non-workfree cafs.
They are usually useless and doing so for data values comes with
a large compile time/code size overhead.
Fixes #24103
(cherry picked from commit 9b4129a580e6c1d18197ef2ed3a8b89d52a2b133)
- - - - -
a5ec32ab by Ben Gamari at 2024-12-17T22:47:26+01:00
IPE: Eliminate dependency on Read
Instead of encoding the closure type as decimal string we now simply
represent it as an integer, eliminating the need for `Read` in
`GHC.Internal.InfoProv.Types.peekInfoProv`.
Closes #24504.
-------------------------
Metric Decrease:
T24602_perf_size
size_hello_artifact
-------------------------
(cherry picked from commit ab840ce6f83a74f36dac939d087b69f97404399a)
- - - - -
aa9b67d9 by Cheng Shao at 2024-12-17T22:47:26+01:00
testsuite: fix testwsdeque with recent clang
This patch fixes compilation of testwsdeque.c with recent versions of
clang, which will fail with the error below:
```
testwsdeque.c:95:33: error:
warning: format specifies type 'long' but the argument has type 'void *' [-Wformat]
95 | barf("FAIL: %ld %d %d", p, n, val);
| ~~~ ^
testwsdeque.c:95:39: error:
warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat]
95 | barf("FAIL: %ld %d %d", p, n, val);
| ~~ ^~~
| %lu
testwsdeque.c:133:42: error:
error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types]
133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n);
| ^~~~~
/workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error:
note: passing argument to parameter 'startProc' here
193 | OSThreadProc *startProc, void *param);
| ^
2 warnings and 1 error generated.
```
(cherry picked from commit a9979f55d0f688fabd25ee318e44b9addd904988)
- - - - -
55a4de3d by Cheng Shao at 2024-12-17T22:47:26+01:00
ghc-heap: fix typo in ghc-heap cbits
(cherry picked from commit 2b1af08b94024c104b54eadd710855e9f8a90fb6)
- - - - -
0cfc58c1 by doyougnu at 2024-12-17T22:47:26+01:00
testsuite: expand size testing infrastructure
- closes #24191
- adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so
- path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite
- adds on_windows and req_dynamic_ghc predicate to testsuite
The design is to not make the testsuite too smart and simply offload to
ghc-pkg for locations of object files and directories.
(cherry picked from commit 9bae34d87f6c978e03031c549920071857c9080c)
- - - - -
ad97368b by Matthew Pickering at 2024-12-17T22:47:26+01:00
tests: Widen acceptance window for dir and so size tests
These are testing things which are sometimes out the control of a GHC
developer. Therefore we shouldn't fail CI if something about these
dependencies change because we can't do anything about it.
It is still useful to have these statistics for visualisation in grafana
though.
Ticket #24759
(cherry picked from commit c49493f242fc78fbf23ef3642df531a19c3b4b24)
- - - - -
29da690d by Matthew Pickering at 2024-12-17T22:47:26+01:00
Disable rts_so test
It has already manifested large fluctuations and destabilising CI
Fixes #24762
(cherry picked from commit 9562808d02db67838844d874c632f18af904949c)
- - - - -
b3dafbc4 by Torsten Schmits at 2024-12-17T22:47:26+01:00
refactor quadratic search in warnMissingHomeModules
(cherry picked from commit bc672166acd8f2815d58b6d214e69373abec4486)
- - - - -
b40c76e2 by Torsten Schmits at 2024-12-17T22:47:26+01:00
add test that runs MakeDepend on thousands of modules
(cherry picked from commit 7875e8cbe5d9b69a1a77354317b2bf9478172686)
- - - - -
317a8454 by Matthew Pickering at 2024-12-17T22:47:26+01:00
driver: Fix -Wmissing-home-modules when multiple units have the same module name
It was assumed that module names were unique but that isn't true with
multiple units.
The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and
query that to see whether the module has been specified.
Fixes #25122
(cherry picked from commit 951ce3d5904a1d34d49787d444f99e251e24d4e7)
- - - - -
f268975d by Sylvain Henry at 2024-12-17T22:47:26+01:00
Reverse arguments to stgCallocBytes (fix #24828)
(cherry picked from commit 6838a7c32ca29b5d44adc9d6280d3a960f31be7c)
- - - - -
2da93f8e by Ben Gamari at 2024-12-17T22:47:26+01:00
rts: Fix size of StgOrigThunkInfo frames
Previously the entry code of the `stg_orig_thunk` frame failed to
account for the size of the profiling header as it hard-coded the frame
size. Fix this.
Fixes #24809.
(cherry picked from commit 6d7e6ad803be11cb7a79dca727c37e4ef21cda4b)
- - - - -
6a2187a9 by Fendor at 2024-12-17T22:47:26+01:00
Add regression test T24809 for stg_orig_thunk_info_frame size
(cherry picked from commit c645fe406cd4a3f4c152e51dfbcdeeb5e2930fb1)
- - - - -
df8999d9 by Andreas Klebinger at 2024-12-17T22:47:26+01:00
bindists: Check for existence of share folder before trying to copy it.
This folder isn't distributed in windows bindists
A lack of doing so resulted us copying loads of files twice.
(cherry picked from commit 4181aa40fff5653a121cd2ece33ab0f7454d421d)
- - - - -
07f4469a by Matthew Pickering at 2024-12-17T22:47:26+01:00
Remove ad-hoc installation of mingw toolchain in relocatable bindists
This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951
The choice about whether to install mingw is taken in the installation
makefile.
This is also broken on non-windows systems.
The actual issue was the EnableDistroToolchain variable wasn't declared
in mk/config.mk and therefore the check to install mingw was failing.
(cherry picked from commit d216510e43deca5a9a221d2b799face293e38299)
- - - - -
03aab781 by Cheng Shao at 2024-12-17T22:47:26+01:00
testsuite: fix T17920 for wasm backend
T17920 was marked as fragile on wasm before; it can be trivially fixed
by avoiding calling variadic printf() in cmm.
(cherry picked from commit 7b4c19983bf6bc11b519b437a6204c38672721ea)
- - - - -
587f1c03 by Simon Peyton Jones at 2024-12-17T22:47:26+01:00
Better skolemisation
As #24810 showed, it is (a little) better to skolemise en-bloc,
so that Note [Let-bound skolems] fires more often.
See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate.
(cherry picked from commit 3d9e4ce68a55f6bc5246d2d77729676010e85bbd)
- - - - -
75f53136 by Ryan Scott at 2024-12-17T22:47:26+01:00
Add missing parenthesizePat in cvtp
We need to ensure that the output of `cvtp` is parenthesized (at precedence
`sigPrec`) so that any pattern signatures with a surrounding pattern signature
can parse correctly.
Fixes #24837.
(cherry picked from commit a3cd3a1d0d186f2aa4d0273c6b3e74a442de2ef0)
- - - - -
13404003 by crumbtoo at 2024-12-17T22:47:26+01:00
user_guide: Fix typo in MultiWayIf chapter
Close #24829
(cherry picked from commit c5e00c35927d574f71bf77449817b131d1749750)
- - - - -
e97ed6ee by Cheng Shao at 2024-12-17T22:47:26+01:00
rts: fix missing function prototypes in ClosureMacros.h
(cherry picked from commit 3ca72ad974169aa39f391774875a9cc2a77ee967)
- - - - -
9f569a33 by Cheng Shao at 2024-12-17T22:47:26+01:00
rts: use __builtin_offsetof to implement STG_FIELD_OFFSET
This patch fixes the STG_FIELD_OFFSET macro definition by using
__builtin_offsetof, which is what gcc/clang uses to implement offsetof
in standard C. The previous definition that uses NULL pointer involves
subtle undefined behavior in C and thus reported by
UndefinedBehaviorSanitizer as well:
```
rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58
```
(cherry picked from commit 05c4fafbc1693164d5f06ed062fc73bbf3f78deb)
- - - - -
4d1ca681 by Cheng Shao at 2024-12-17T22:47:26+01:00
rts: fix an unaligned load in nonmoving gc
This patch fixes an unaligned load in nonmoving gc by ensuring the
closure address is properly untagged first before attempting to
prefetch its header. The unaligned load is reported by
UndefinedBehaviorSanitizer:
```
rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment
0x0042005f3a71: note: pointer points here
00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9
```
This issue had previously gone unnoticed since it didn't really harm
runtime correctness, the invalid header address directly loaded from a
tagged pointer is only used as prefetch address and will not cause
segfaults. However, it still should be corrected because the prefetch
would be rendered useless by this issue, and untagging only involves a
single bitwise operation without memory access so it's cheap enough to
add.
(cherry picked from commit c77a48af6e1f38337b305fec794e8c999f1c7f3a)
- - - - -
53c93467 by Cheng Shao at 2024-12-17T22:47:26+01:00
rts: ensure gc_thread/gen_workspace is allocated with proper alignment
gc_thread/gen_workspace are required to be aligned by 64 bytes.
However, this property has not been properly enforced before, and
numerous alignment violations at runtime has been caught by
UndefinedBehaviorSanitizer that look like:
```
rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment
0x0000027a3390: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8
rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment
0x0000027a3450: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13
```
This patch fixes the gc_thread/gen_workspace misalignment issue by
explicitly allocating them with alignment constraint.
(cherry picked from commit 7a660042395614e4b19534baf5b779f65059861e)
- - - - -
112e7d0d by Cheng Shao at 2024-12-17T22:47:26+01:00
hadrian: disable PIC for in-tree GMP on wasm32
This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC
unconditionally adds undesired code size and runtime overhead for
wasm32.
(cherry picked from commit f9c1ae122ec642c0d9236dffc971bc2d1ca38fba)
- - - - -
81e42325 by Cheng Shao at 2024-12-17T22:47:27+01:00
hadrian: disable in-tree gmp fft code path for wasm32
This patch disables in-tree GMP FFT code paths for wasm32 target in
order to give up some performance of multiplying very large operands
in exchange for reduced code size.
(cherry picked from commit 1a32f82807ae01813f14bdf12fed75eb32799e18)
- - - - -
d622a6d3 by Cheng Shao at 2024-12-17T22:47:27+01:00
hadrian: build in-tree GMP with malloc-notreentrant on wasm32
This patch makes hadrian build in-tree GMP with the
--enable-alloca=malloc-notreentrant configure option. We will only
need malloc-reentrant when we have threaded RTS and SMP support on
wasm32, which will take some time to happen, before which we should
use malloc-notreentrant to avoid undesired runtime overhead.
(cherry picked from commit 06277d56de91c8d21cbf71e8bc4096925b863acc)
- - - - -
3e9b768d by Andreas Klebinger at 2024-12-17T22:47:27+01:00
Add release notes for some backported patches.
Add entries for the following backported MRs:
!12498: -fprof-late: Don't add cost centres to static data.
!12565: IPE: Eliminate dependency on Read
!12591: ghc-heap: fix typo in ghc-heap cbits
!12607: refactor quadratic search in warnMissingHomeModules
!12621: rts: Fix size of StgOrigThunkInfo frames
!12649 # bindists: Check for existence of shared folder before trying to copy it.
!12653: Better skolemisation
!12734: Various rts fixes for issues spotted by UndefinedBehaviorSanitizer
!12592: hadrian: adjust in-tree GMP configure options for wasm32
- - - - -
53840a38 by Cheng Shao at 2024-12-17T22:47:27+01:00
hadrian: fix hadrian building with ghc-9.10.1
(cherry picked from commit be514bb48629747258416e602c8b00810b3863b0)
- - - - -
8e8dafb3 by Cheng Shao at 2024-12-17T22:47:27+01:00
linters: fix lint-whitespace compilation with ghc-9.10.1
(cherry picked from commit ad38e954bf088b43fa1cecfeaf474b6b9c11e2ed)
- - - - -
71e4f953 by Zubin Duggal at 2024-12-17T22:50:39+01:00
testsuite: Handle exceptions in framework_fail when testdir is not initialised
When `framework_fail` is called before initialising testdir, it would fail with
an exception reporting the testdir not being initialised instead of the actual failure.
Ensure we report the actual reason for the failure instead of failing in this way.
One way this can manifest is when trying to run a test that doesn't exist using `--only`
(cherry picked from commit c56d728e1f8702db02cf7e7e3cdc567b3df47ac3)
- - - - -
30 changed files:
- .gitlab/ci.sh
- compiler/GHC/Core/LateCC.hs
- compiler/GHC/Core/LateCC/TopLevelBinds.hs
- compiler/GHC/Core/LateCC/Types.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/Var.hs
- docs/users_guide/9.10.2-notes.rst
- docs/users_guide/exts/multiway_if.rst
- docs/users_guide/profiling.rst
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/cabal.project
- hadrian/hadrian.cabal
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Settings/Builders/Configure.hs
- libraries/ghc-heap/cbits/Stack.cmm
- libraries/ghc-internal/src/GHC/Internal/InfoProv/Types.hsc
- linters/lint-whitespace/lint-whitespace.cabal
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/11f32847c513a9afd54f4df06c1f08d17ae2e0ca...71e4f953e47ef6b71d6704989aadbb29e4df5c22
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/11f32847c513a9afd54f4df06c1f08d17ae2e0ca...71e4f953e47ef6b71d6704989aadbb29e4df5c22
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/20241217/a8b54250/attachment-0001.html>
More information about the ghc-commits
mailing list