diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index ed7ca30db132..45bd5567fc4c 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -195,6 +195,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; done done + ${optionalString (self.enableSharedExecutables && self.stdenv.isLinux) '' + configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}"; + ''} + echo "configure flags: $extraConfigureFlags $configureFlags" ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \ --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \