... | ... | @@ -262,6 +262,42 @@ data TcPluginSolveResult |
|
|
|
|
|
This datatype bundles pattern synonyms `TcPluginOk` and `TcPluginContradiction` to recover the old behaviour, but authors of typechecking plugins will still need to account for the change in the name.
|
|
|
|
|
|
### Windows uses a Clang-based toolchain
|
|
|
|
|
|
Windows' C/C++ toolchain is now [based on Clang](https://gitlab.haskell.org/ghc/ghc/-/issues/21019) instead of GCC. While most code will be unaffected by this change, there are some situations where packages that use C or C++ code on Windows will need to be adjusted:
|
|
|
|
|
|
#### `gcc_s` no longer needs to be linked against
|
|
|
|
|
|
Some packages previously needed to link against the `gcc_s` library on Windows because the GCC-compiled code used GCC-related intrinsics behind the scenes. This situation does not occur with Clang, so one can simply drop the `gcc_s` dependency on GHC 9.4 or later:
|
|
|
|
|
|
```
|
|
|
if os(windows) && !impl(ghc >= 9.4)
|
|
|
extra-libraries: gcc_s
|
|
|
```
|
|
|
|
|
|
#### Link against `system-cxx-std-lib` instead of `stdc++`
|
|
|
|
|
|
Previously, libraries that use C++ code would need to link against GCC's `stdc++` library. Clang uses differently named C++ libraries, so this will need to be adjusted. Starting with GHC 9.4, GHC offers a virtual `system-cxx-std-lib` package that can be used to reliably link against the
|
|
|
system's C++ standard library implementation. (This works on all OSes, not just Windows.)
|
|
|
|
|
|
For example, here is how you might write a `.cabal` file that needs to link against C++ code starting with GHC 9.4:
|
|
|
|
|
|
```
|
|
|
if impl(ghc >= 9.4)
|
|
|
build-depends: system-cxx-std-lib
|
|
|
else
|
|
|
if os(windows)
|
|
|
extra-libraries: stdc++
|
|
|
else
|
|
|
-- Handle other OSes here...
|
|
|
```
|
|
|
|
|
|
TODO: Make sure this is still accurate after https://gitlab.haskell.org/ghc/ghc/-/issues/21435 and https://gitlab.haskell.org/ghc/ghc/-/issues/21618 are resolved
|
|
|
|
|
|
#### CPP preprocessing differences
|
|
|
|
|
|
TODO: If https://gitlab.haskell.org/ghc/ghc/-/issues/21668 is deemed not-a-bug, describe how to work around it.
|
|
|
|
|
|
---
|
|
|
|
|
|
## Library changes
|
... | ... | |