-
Notifications
You must be signed in to change notification settings - Fork 722
Description
Describe the bug
In GHC #19350 it was noted that dynamic libraries findable via extra-lib-dirs
are not found in GHCi on POSIX platforms. While in principle GHC has the information that it needs to find these libraries from the package database registration, due to limitations of the the POSIX dynamic linking interface, it is not possible for GHC to do better here.
I believe the solution here is to (on POSIX platforms) add Cabal's extra-lib-dirs
paths to RPATH during the final link of libraries. This isn't a perfect solution (since it may result in spurious RPATH entries) but this seems to be the best we can do.
To Reproduce
See this testcase.
Expected behavior
GHCi is able to load libraries with foreign dependencies findable only via extra-lib-dirs
.
System information
- Operating system
cabal
,ghc
versions
Additional context
Add any other context about the problem here.