[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 53 commits: EPA: Remove [AddEpAnn] commit 3

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Oct 17 09:51:04 UTC 2024



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
5f67db48 by Alan Zimmerman at 2024-10-17T05:18:43-04:00
EPA: Remove [AddEpAnn] commit 3

EPA: Remove [AddEpAnn] from HsDocTy

EPA: Remove [AddEpAnn] from HsBangTy

EPA: Remove [AddEpAnn] from HsExplicitListTy

EPA: Remove [AddEpAnn] from HsExplicitTupleTy

EPA: Remove [AddEpAnn] from HsTypedBracket

EPA: Remove [AddEpAnn] from HsUntypedBracket

EPA: Remove [AddEpAnn] from PatBuilderOpApp

EPA: break out 'EpToken "|"' from ClassDecl anns

EPA: Remove [AddEpAnn] from ClassDecl

EPA: Remove [AddEpAnn] from SynDecl

- - - - -
fbbbd010 by Daan Rijks at 2024-10-17T05:19:19-04:00
Expand the haddocks for Control.Category

- - - - -
076c1a10 by Andrew Lelechenko at 2024-10-17T05:19:19-04:00
documentation: more examples for Control.Category

- - - - -
92798629 by Cheng Shao at 2024-10-17T05:50:46-04:00
ghci: mitigate host/target word size mismatch in BCOByteArray serialization

This patch mitigates a severe host/target word size mismatch issue in
BCOByteArray serialization logic introduced since !12142, see added
note for detailed explanation.

- - - - -
04495800 by Cheng Shao at 2024-10-17T05:50:46-04:00
ghci: use plain malloc for mkConInfoTable on non-TNTC platforms

This patch avoids using mmap() to allocate executable memory for
mkConInfoTable on platforms without tables-next-to-code, see added
comment for explanation.

- - - - -
d664309b by Cheng Shao at 2024-10-17T05:50:46-04:00
ghc-internal: add missing CPPs for wasm

This patch adds some missing CPP guards to ghc-internal, given those
functions are non existent on wasm and would cause linking issues.

- - - - -
65548fe7 by Cheng Shao at 2024-10-17T05:50:46-04:00
rts: rename prelude.js to prelude.mjs

This commit renames prelude.js to prelude.mjs for wasm backend rts
jsbits, and slightly adjusts the jsbits contents. This is for
preparing the implementation of dyld.mjs that contains wasm dynamic
linker logic, which needs to import prelude.mjs as a proper ESM
module.

- - - - -
2f98356c by Cheng Shao at 2024-10-17T05:50:46-04:00
rts: add __wrapped_freeJSVal

This commit wraps imported freeJSVal in a __wrapped_freeJSVal C
function for wasm backend RTS. In general, wasm imports are only
supposed to be directly called by C; they shouldn't be used as
function pointers, which confuses wasm-ld at link-time when generating
shared libraries.

- - - - -
e89c4deb by Cheng Shao at 2024-10-17T05:50:46-04:00
rts: correct stale link in comment

- - - - -
558ea1e0 by Cheng Shao at 2024-10-17T05:50:46-04:00
rts: drop interpretBCO support from non-dyn ways on wasm

This commit drops interpretBCO support from non dynamic rts ways on
wasm. The bytecode interpreter is only useful when the RTS linker also
works, and on wasm it only works for dynamic ways anyway. An
additional benefit of dropping interpretBCO is reduction in code size
of linked wasm modules, especially since interpretBCO references
ffi_call which is an auto-generated large function in libffi-wasm and
unused by most user applications.

- - - - -
dbd031b5 by Cheng Shao at 2024-10-17T05:50:46-04:00
rts: don't build predefined GloblRegs for wasm PIC mode

This commit wraps the predefined GlobalRegs in Wasm.S under a CPP
guard to prevent building for PIC mode. When building dynamic ways of
RTS, the wasm globals that represent STG GlobalRegs will be created
and supplied by dyld.mjs. The current wasm dylink convention doesn't
properly support exporting relocatable wasm globals at all, any wasm
global exported by a .so is assumed to be a GOT.mem entry.

- - - - -
7af521ed by Cheng Shao at 2024-10-17T05:50:46-04:00
rts: fix conflicting StgRun definitions on wasm

This commit fixes conflicting StgRun definition when building dynamic
ways of RTS for wasm in unregisterised mode.

- - - - -
6692ea6f by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian: use targetSupportsRPaths predicate

This commit changes the hostSupportsRPaths predicate to
targetSupportsRPaths and use that to decide whether to pass
RPATH-related link-time options. It's not applied to stage0, we should
just use the default link-time options of stageBoot ghc.

- - - - -
d9fcf0c2 by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian: disable internal-interpreter of ghc library when cross compiling

This commit disable the internal-interpreter flag of ghc library when
cross compiling, only external interpreter works in such cases.

- - - - -
bc78a01f by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian: enable internal-interpreter for ghc-bin stage0

This commit enables internal-interpreter flag for ghc-bin even when
compiling stage0, as long as target supports ghci. It enables ghci
functionality for cross targets that support ghci, since cross ghc-bin
is really stage0.

- - - - -
5fc094fb by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian: fix CFLAGS for gmp shared objs on wasm

This commit adds -fvisibility=default to CFLAGS of gmp when building
for wasm. This is required to generate the ghc-bignum shared library
without linking errors. Clang defaults to -fvisibility=hidden for wasm
targets, which will cause issues when a symbol is expected to be
exported in a shared library but without explicit visibility attribute
annotation.

- - - - -
74f5331c by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian: re-enable PIC for gmp on wasm

This commit re-enables --with-pic=yes configuration option of gmp when
building for wasm, given we're about to include support for shared
libraries, TH and ghci.

- - - - -
fbf96ff4 by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian: add the host_fully_static flavour transformer

This commit adds the host_fully_static flavour transformer to hadrian,
which ensures stage0 is fully statically linked while still permitting
stage1 libdir to contain shared libraries. This is intended to be used
by the wasm backend to build portable linux bindists that contain wasm
shared libraries.

- - - - -
3d4a1619 by Cheng Shao at 2024-10-17T05:50:46-04:00
ci: update wasm jobs configuration

This commit bumps ci-image revision to use updated wasm toolchain, and
use host_fully_static instead of fully_static for wasm jobs so to
ensure wasm shared libraries can be properly built.

- - - - -
ec3e555f by Cheng Shao at 2024-10-17T05:50:46-04:00
hadrian/testsuite: implement config.cross logic

This commit implements the config.cross field in the testsuite driver.
It comes from the "cross compiling" ghc info field for both
in-tree/out-of-tree GHC, and is an accurate predicate of whether we're
cross-compiling or not (compared to the precense of target emulator),
and is useful to implement predicates to assert the precense of
internal interpreter (only available on non-cross GHC) for tests that
do require it (e.g. plugins).

- - - - -
b38bad63 by Cheng Shao at 2024-10-17T05:50:47-04:00
hadrian/compiler: implement targetRTSLinkerOnlySupportsSharedLibs

This patch implements the targetRTSLinkerOnlySupportsSharedLibs
predicate in hadrian. Its definition in hadrian is the single source
of truth, and the information propagates to ghc settings file, ghc
driver and testsuite driver. It is used in various places to ensure
dynamic dependency is selected when the target RTS linker only
supports loading dynamic code.

- - - - -
73720945 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: don't use host cpu features when testing cross ghc

This patch disables CPU feature detection logic when testing cross
GHC, since those features don't make sense for the target anyway.

- - - - -
23506412 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: implement & use req_plugins predicate

This commit implements req_plugins predicate to indicate that the test
requires plugin functionality. Currently this means cross GHC is
disabled since internal-interpreter doesn't work in cross GHC yet.

- - - - -
98a6a358 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: make use of config.interp_force_dyn

This commit takes config.interp_force_dyn into consideration when
setting up TH/ghci way flags.

- - - - -
f42fa8de by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: bump T17572 timeout

- - - - -
2a4122fb by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: bump T22744 pre_cmd timeout

- - - - -
2bacf5b4 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: skip terminfo_so for cross ghc

- - - - -
6f1f78db by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: fix shared library size tests for cross ghc

This commit fixes shared library size tests (e.g. array_so in
testsuite/tests/perf/size/all.T) when testing cross ghc. Previously,
if shared library file extension of host and target differs, those
tests will fail with framework errors due to not finding the right
files.

- - - - -
04a62e73 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: skip ghc api tests that attempt to spawn processes inside wasm

This commit skips a few ghc api tests on wasm, since they would
attempt to spawn processes inside wasm, which is not supported at all.

- - - - -
29e0d1ef by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: skip T22840 due to broken -dtag-inference-checks on wasm

- - - - -
989caa03 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: ensure $(ghciWayFlags) can be overridden

This commit revises boilerplate.mk in testsuite as well as a few other
places, to ensure the tests that do make use of $(ghciWayFlags) can
receive the right $(ghciWayFlags) from testsuite driver config.

- - - - -
d5b338d1 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: skip rdynamic on wasm

- - - - -
70aaeef9 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: skip T2615 on wasm

This commit marks T2615 as skip on wasm, given LD_* environment
variables aren't supported on wasm anyway.

- - - - -
61a4c165 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: mark MultiLayerModulesTH_Make/MultiLayerModulesTH_OneShot as fragile on wasm

- - - - -
d408e280 by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: fix T16180 on wasm

This commit fixes T16180 on wasm once TH support is flipped on. The
fix is simply adding right asm code for wasm.

- - - - -
8f8b3e0d by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: fix -fexternal-interpreter flag for JS backend

Previously, -fexternal-interpreter is broken for JS backend, since GHC
would attempt to launch a non-existent ghc-iserv* executable. This
commit fixes it by adjusting pattern matching order in
setTopSessionDynFlags.

- - - - -
e7c1cac4 by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: use interpreterDynamic predicate in preloadLib

This commit use the interpreterDynamic predicate in preloadLib to
decide if we should do dynLoadObjs instead of loadObj. Previously we
used hostIsDynamic which was only written with non-cross internal
interpreter in mind.

The testsuite is also adjusted to remove hard-wired -fPIC flag for
cbits (doesn't work in i386 RTS linker in vanilla way, #25260) and
properly pass ghc_th_way_flags to ghc.

- - - - -
cc32d062 by Cheng Shao at 2024-10-17T05:50:47-04:00
compiler: fix Cmm dynamic CLabels for wasm

This commit fixes the handling of dynamic CLabels for the wasm
backend. Just do the simplest handling: preserve the original CLabel,
both unreg/NCG backends can handle them properly without issue.

- - - - -
176fa668 by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: add necessary compile-time flags for wasm PIC mode

This commit adds necessary compile-time flags when compiling for wasm
PIC mode, see added comment for detailed explanation.

- - - - -
55e7fc10 by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: add necessary link-time flags for wasm shared libs

This commit adds necessary link-time flags for wasm shared libs, see
added comments for detailed explanation.

- - - - -
9131cefc by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: enforce -fno-use-rpaths for wasm

This commit ensures the GHC driver never passes any RPATH-related
link-time flags on wasm, which is not supported at all.

- - - - -
5d17bf55 by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: ensure static archives are picked when linking static .wasm modules

This commit ensures static archives are picked when linking .wasm
modules which are supposed to be fully static, even when ghc may be
invoked with -dynamic, see added comment for explanation.

- - - - -
bf143273 by Cheng Shao at 2024-10-17T05:50:47-04:00
compiler: fix dynamic_too_enable for targets that require dynamic libraries

This commit fixes dynamic_too_enable for targets whose RTS linker can
only load dynamic code.

- - - - -
25f73860 by Cheng Shao at 2024-10-17T05:50:47-04:00
compiler: fix checkNonStdWay for targets that require dynamic libraries

This commit fixes checkNonStdWay to ensure that for targets whose RTS
linker can only load dynamic code, the dynamic way of object is
selected.

- - - - -
a695ce3d by Cheng Shao at 2024-10-17T05:50:47-04:00
ghc-bin: enforce dynamic way when the target requires so

This commit makes ghc-bin use dynamic way when it is doing interactive
stuff on certain targets whose RTS linker can only handle dynamic
code.

- - - - -
bfd6f3fd by Cheng Shao at 2024-10-17T05:50:47-04:00
hadrian/ghci: add wasm dyld

This commit adds the wasm dynamic linker implementation, as well as
ghci logic to call it and hadrian logic to install it to the correct
location. See the top-level note in utils/jsffi/dyld.mjs for more
details.

- - - - -
fe1d7d8b by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: fix getGccSearchDirectory for wasm target

This commit fixes getGccSearchDirectory logic for wasm target, ensures
the correct search directory containing libc.so etc can be found by
GHC. getGccSearchDirectory is also exported so it can be used
elsewhere to obtain the wasi-sdk libdir and pass to the dyld script.

- - - - -
86c31839 by Cheng Shao at 2024-10-17T05:50:47-04:00
driver: add wasm backend iserv logic

This commit adds wasm backend iserv logic to the driver, see added
comments for explanation.

- - - - -
947431ae by Cheng Shao at 2024-10-17T05:50:47-04:00
compiler: add PIC support to wasm backend NCG

This commit adds support for generating PIC to the wasm backend NCG.

- - - - -
3c69b11b by Cheng Shao at 2024-10-17T05:50:47-04:00
hadrian/compiler: flip on support for shared libs & ghci for wasm

This commit flips on the support for shared libs and ghci for the wasm
target, given all required support logic has been added in previous
commits.

- - - - -
cec3ef7b by Cheng Shao at 2024-10-17T05:50:47-04:00
testsuite: flip on support for shared libs, TH & ghci for wasm

This commit flips on support for shared libs, TH & ghci for wasm in
the testsuite, given support has been landed in previous commits.

- - - - -
fe9ab7ab by Matthew Pickering at 2024-10-17T05:50:51-04:00
ci: Add support for ONLY_JOBS variable to trigger any validation pipeline

By setting the ONLY_JOBS variable to the name of the job (or multiple
jobs), the resulting
pipeline will include a validation job for that pipeline.

For example - if you set ONLY_JOBS="x86_64-linux-ubuntu22_04-validate"
then a ubuntu22_04 job will be included in the validation pipeline. This
is useful for testing specific jobs.

Fixes #25332

- - - - -
72e8f628 by Cheng Shao at 2024-10-17T05:50:52-04:00
rts: fix pointer overflow undefined behavior in bytecode interpreter

This patch fixes an unnoticed undefined behavior in the bytecode
interpreter. It can be caught by building `rts/Interpreter.c` with
`-fsanitize=pointer-overflow`, the warning message is something like:

```
rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13
rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13
rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13
```

Whenever we do something like `SpW(-1)`, the negative argument is
implicitly converted to an unsigned integer type and causes pointer
arithmetic overflow. It happens to be harmless for most targets since
overflowing would wrap the result to desired value, but it's still
coincidental and undefined behavior. Furthermore, it causes real
damage to the wasm backend, given clang-20 will emit invalid wasm code
that crashes at run-time for this kind of C code! (see
https://github.com/llvm/llvm-project/issues/108770)

The fix here is adding some explicit casts to ensure we always use the
signed `ptrdiff_t` type as right hand operand of pointer arithmetic.

- - - - -


23 changed files:

- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- CODEOWNERS
- compiler/GHC.hs
- compiler/GHC/CmmToAsm/PIC.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/Driver/Config/CmmToAsm.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Static.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Lexer.x


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cecae38586355beeb2d88c326dfe4d645041b7af...72e8f628cecf5502541b3ef9f6d30f71f74f4a6f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cecae38586355beeb2d88c326dfe4d645041b7af...72e8f628cecf5502541b3ef9f6d30f71f74f4a6f
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/20241017/881d4237/attachment-0001.html>


More information about the ghc-commits mailing list