[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: Add -fpolymorphic-specialisation flag (off by default at all optimisation levels)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Jun 29 08:45:58 UTC 2023



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


Commits:
9f01d14b by Matthew Pickering at 2023-06-29T04:13:41-04:00
Add -fpolymorphic-specialisation flag (off by default at all optimisation levels)

Polymorphic specialisation has led to a number of hard to diagnose
incorrect runtime result bugs (see #23469, #23109, #21229, #23445) so
this commit introduces a flag `-fpolymorhphic-specialisation` which
allows users to turn on this experimental optimisation if they are
willing to buy into things going very wrong.

Ticket #23469

- - - - -
b1e611d5 by Ben Gamari at 2023-06-29T04:14:17-04:00
Rip out runtime linker/compiler checks

We used to choose flags to pass to the toolchain at runtime based on the
platform running GHC, and in this commit we drop all of those runtime
linker checks

Ultimately, this represents a change in policy: We no longer adapt at
runtime to the toolchain being used, but rather make final decisions
about the toolchain used at /configure time/
(we have deleted Note [Run-time linker info] altogether!).

This works towards the goal of having all toolchain configuration logic
living in the same place, which facilities the work towards a
runtime-retargetable GHC (see #19877).

As of this commit, the runtime linker/compiler logic was moved to
autoconf, but soon it, and the rest of the existing toolchain
configuration logic, will live in the standalone ghc-toolchain program
(see !9263)

In particular, what used to be done at runtime is now as follows:
* The flags -Wl,--no-as-needed for needed shared libs are configured
  into settings
* The flag -fstack-check is configured into settings
* The check for broken tables-next-to-code was outdated
* We use the configured c compiler by default as the assembler program
* We drop `asmOpts` because we already configure -Qunused-arguments flag
  into settings (see !10589)

Fixes #23562

Co-author: Rodrigo Mesquita (@alt-romes)

- - - - -
ef433e69 by Ben Gamari at 2023-06-29T04:45:50-04:00
Define FFI_GO_CLOSURES

The libffi shipped with Apple's XCode toolchain does not contain a
definition of the FFI_GO_CLOSURES macro, despite containing references
to said macro. Work around this by defining the macro, following the
model of a similar workaround in OpenJDK [1].

[1] https://github.com/openjdk/jdk17u-dev/pull/741/files

- - - - -
8ac19e39 by Ben Gamari at 2023-06-29T04:45:51-04:00
base: Fix incorrect CPP guard

This was guarded on `darwin_HOST_OS` instead of `defined(darwin_HOST_OS)`.

- - - - -
aacf219b by Ben Gamari at 2023-06-29T04:45:51-04:00
rts/Trace: Ensure that debugTrace arguments are used

As debugTrace is a macro we must take care to ensure that
the fact is clear to the compiler lest we see warnings.

- - - - -
f56c6adb by Ben Gamari at 2023-06-29T04:45:51-04:00
rts: Various warnings fixes

- - - - -
db699ff6 by Ben Gamari at 2023-06-29T04:45:51-04:00
hadrian: Ignore warnings in unix and semaphore-compat

- - - - -


30 changed files:

- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Linker/ExtraObj.hs
- compiler/GHC/SysTools.hs
- − compiler/GHC/SysTools/Info.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.8.1-notes.rst
- docs/users_guide/using-optimisation.rst
- hadrian/src/Flavour.hs
- libraries/base/include/HsBase.h
- libraries/ghci/GHCi/FFI.hsc
- + m4/fp_link_supports_no_as_needed.m4
- m4/fptools_set_c_ld_flags.m4
- rts/Interpreter.c
- rts/Schedule.c
- rts/Sparks.c
- rts/Trace.h
- rts/TraverseHeap.c
- rts/adjustor/LibffiAdjustor.c
- + rts/include/rts/ghc_ffi.h
- rts/rts.cabal.in
- rts/sm/GC.c
- rts/sm/NonMoving.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/76039d53d13d76da4f1633bd9ebb9f48da55ac61...db699ff60a26760536df825f2ff8329b38a9c0f4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/76039d53d13d76da4f1633bd9ebb9f48da55ac61...db699ff60a26760536df825f2ff8329b38a9c0f4
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/20230629/ca894a5b/attachment.html>


More information about the ghc-commits mailing list