[Git][ghc/ghc][wip/rip-stdcall] 13 commits: Make UnsafeSNat et al. into pattern synonyms

Cheng Shao (@TerrorJack) gitlab at gitlab.haskell.org
Fri May 31 17:24:26 UTC 2024



Cheng Shao pushed to branch wip/rip-stdcall at Glasgow Haskell Compiler / GHC


Commits:
d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00
Make UnsafeSNat et al. into pattern synonyms

...so that they do not cause coerce to bypass the nominal
role on the corresponding singleton types when they are imported.
See Note [Preventing unsafe coercions for singleton types] and
the discussion at #23478.

This also introduces unsafeWithSNatCo (and analogues for Char
and Symbol) so that users can still access the dangerous coercions
that importing the real constructors would allow, but only in a
very localized way.

- - - - -
0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00
hadrian: build C/C++ with split sections when enabled

When split sections is enabled, ensure -fsplit-sections is passed to
GHC as well when invoking GHC to compile C/C++; and pass
-ffunction-sections -fdata-sections to gcc/clang when compiling C/C++
with the hadrian Cc builder. Fixes #23381.

- - - - -
02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00
driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled

When -fsplit-sections is passed to GHC, pass -ffunction-sections
-fdata-sections to gcc/clang when building C/C++. Previously,
-fsplit-sections was only respected by the NCG/LLVM backends, but not
the unregisterised backend; the GHC driver did not pass
-fdata-sections and -ffunction-sections to the C compiler, which
resulted in excessive executable sizes.

Fixes #23381.

-------------------------
Metric Decrease:
    size_hello_artifact
    size_hello_unicode
-------------------------

- - - - -
fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00
testsuite: mark process005 as fragile on JS

- - - - -
34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00
Add -Wderiving-typeable to -Wall

Deriving `Typeable` does nothing, and it hasn't done for a long while.

There has also been a warning for a long while which warns you about
uselessly deriving it but it wasn't enabled in -Wall.

Fixes #24784

- - - - -
75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00
docs: Fix formatting of changelog entries

- - - - -
303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00
docs: Fix link to injective type families paper

Closes #24863

- - - - -
df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00
ghc-internal: Fix package description

The previous description was inherited from `base` and was inappropriate
for `ghc-internal`. Also fix the maintainer and bug reporting fields.

Closes #24906.

- - - - -
bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00
compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans

This patch removes special consideration for ArchWasm32 in
cmmDoCmmSwitchPlans, which means the compiler will now disable
cmmImplementSwitchPlans for wasm unreg backend, just like unreg
backend of other targets. We enabled it in the past to workaround some
compile-time panic in older versions of LLVM, but those panics are no
longer present, hence no need to keep this workaround.

- - - - -
812c9cea by Cheng Shao at 2024-05-31T17:05:58+00:00
compiler/ghci/rts: remove stdcall support completely

We have formally dropped i386 windows support (#18487) a long time
ago. The stdcall foreign call convention is only used by i386 windows,
and the legacy logic around it is a significant maintenance burden for
future work that adds arm64 windows support (#24603). Therefore, this
patch removes stdcall support completely from the compiler as well as
the RTS:

- stdcall is still recognized as a FFI calling convention in Haskell
  syntax. GHC will now unconditionally emit a warning
  (-Wunsupported-calling-conventions) and treat it as ccall.
- Apart from minimum logic to support the parsing and warning logic,
  all other code paths related to stdcall has been completely stripped
  from the compiler.
- ghci only supports FFI_DEFAULT_ABI and ccall convention from now on.
- FFI foreign export adjustor code on all platforms no longer handles
  the stdcall case and only handles ccall from now on.
- The Win32 specific parts of RTS no longer has special code paths for
  stdcall.

- - - - -
e63eca37 by Cheng Shao at 2024-05-31T17:20:20+00:00
libraries/utils: remove stdcall related logic

- - - - -
f789e23b by Cheng Shao at 2024-05-31T17:21:13+00:00
testsuite: adapt the testsuite for stdcall removal

This patch adjusts test cases to handle the stdcall removal:

- Some stdcall usages are replaced with ccall since stdcall doesn't
  make sense anymore
- We also preserve some stdcall usages, and check in the expected
  warning messages to ensure GHC always warn about stdcall usages
  (-Wunsupported-calling-conventions) as expected

- - - - -
ac6cc5c3 by Cheng Shao at 2024-05-31T17:23:48+00:00
docs: minor adjustments for stdcall removal

- - - - -


30 changed files:

- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/PIC.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Driver/Config/Cmm.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/JS/JStg/Syntax.hs
- compiler/GHC/JS/Syntax.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Lit.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Literal.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Types/FieldLabel.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bec5b60915d4c1edfe2a92cf7e97ba7dc90d12de...ac6cc5c3a6c22a09bf73fc75dbf436d8d23133c3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bec5b60915d4c1edfe2a92cf7e97ba7dc90d12de...ac6cc5c3a6c22a09bf73fc75dbf436d8d23133c3
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/20240531/290dbd87/attachment.html>


More information about the ghc-commits mailing list