File tree 2 files changed +30
-0
lines changed 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ synopsis: Always pass `ghc-options` to GHC
2
+ packages: Cabal
3
+ prs: #8717
4
+ issues:
5
+
6
+ description: {
7
+
8
+ Previously, options set in the package field `ghc-options` would not be passed
9
+ to GHC during the link phase for shared objects (where multiple `.o` or
10
+ `.dyn_o` files are merged into a single object file). This made it impossible
11
+ to use `ghc-options` to use a different linker by setting (for example)
12
+ `ghc-options: -optl-fuse-ld=mold -optlm-fuse-ld=mold`; the options would be
13
+ dropped in the link phase, falling back to the default linker.
14
+
15
+ It was possible to work around this by duplicating the `ghc-options` to
16
+ `ghc-shared-options`, which _are_ passed in the shared link phase, but that had
17
+ the (undocumented and unfortunate) side-effect of disabling the GHC
18
+ `-dynamic-too` flag, effectively doubling compilation times when
19
+ `ghc-shared-options` are set.
20
+
21
+ Now, `ghc-options` are combined with `ghc-shared-options` (to accurately
22
+ reflect the documentation on this feature) and the fact that
23
+ `ghc-shared-options` disables `-dynamic-too` is documented.
24
+
25
+ }
Original file line number Diff line number Diff line change @@ -2045,6 +2045,11 @@ system-dependent values for these fields.
2045
2045
ones specified via :pkg-field: `ghc-options `, and are passed to GHC during
2046
2046
both the compile and link phases.
2047
2047
2048
+ Note that if any :pkg-field: `ghc-shared-options ` are set, the
2049
+ ``-dynamic-too` option will never be passed to GHC, leading to all modules
2050
+ being compiled twice (once to generate the ``.o `` files and another to
2051
+ generate the ``.dyn_o `` files).
2052
+
2048
2053
.. pkg-field :: ghcjs-options: token list
2049
2054
2050
2055
Like :pkg-field: `ghc-options ` but applies to GHCJS
You can’t perform that action at this time.
0 commit comments