Commit 1f0df60
committed
fix: apply -rdynamic unconditionally for GHC API programs
The previous fix checked `ways_ `hasWay` WayDyn` but this condition fails
when the test isn't compiled with -dynamic flag, even when linking against
dynamic libraries. In a dynamic-only GHC build, tests compiled without
-dynamic would not get -rdynamic added.
Changed condition from:
ways_ `hasWay` WayDyn && any ((== "ghc") . unitPackageNameString) pkgs
to:
blm /= FullyStatic && any ((== "ghc") . unitPackageNameString) pkgs
This ensures -rdynamic is added for any non-static executable linking
against the ghc package, regardless of -dynamic flag. This matches the
approach in ghc-iserv.cabal.in which applies these flags unconditionally.
The GHC API may load shared libraries at runtime via dlopen() (for GHCi,
Template Haskell, etc.) even when the executable wasn't compiled with
-dynamic. Only FullyStatic executables can skip this since they won't
load dynamic libraries.1 parent 7c565de commit 1f0df60
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
271 | 277 | | |
272 | 278 | | |
273 | 279 | | |
274 | | - | |
| 280 | + | |
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| |||
0 commit comments