Add -rpath flag to GHC
Currently, GHC has special logic to handle runtime paths of dynamically linked libraries, however, clients like cabal
, cannot benefit from it because the only way to specify rpaths is by passing linker flags directly with -optl-Wl,-rpath ...
.
We should introduce an -rpath
flag that allows clients to specify rpaths to search for dyn libs at runtime which GHC can handle as it does runtime path dependencies determined internally.
This would enable a better solution for tickets like https://github.com/haskell/cabal/issues/7339