Skip to content

Commit 776e9e2

Browse files
committed
Merge pull request #2626 from nomeata/master
Only set rpath on dynamic executables
2 parents d052980 + 6bea1db commit 776e9e2

File tree

1 file changed

+6
-4
lines changed
  • Cabal/Distribution/Simple

1 file changed

+6
-4
lines changed

Cabal/Distribution/Simple/GHC.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,9 @@ buildOrReplExe forRepl verbosity numJobs _pkg_descr lbi
787787
ghcOptLinkLibPath = toNubListR $ extraLibDirs exeBi,
788788
ghcOptLinkFrameworks = toNubListR $ PD.frameworks exeBi,
789789
ghcOptInputFiles = toNubListR
790-
[exeDir </> x | x <- cObjs],
790+
[exeDir </> x | x <- cObjs]
791+
}
792+
dynLinkerOpts = mempty {
791793
ghcOptRPaths = rpaths
792794
}
793795
replOpts = baseOpts {
@@ -833,9 +835,9 @@ buildOrReplExe forRepl verbosity numJobs _pkg_descr lbi
833835
| otherwise = doingTH && (withProfExe lbi || withDynExe lbi)
834836

835837
linkOpts = commonOpts `mappend`
836-
linkerOpts `mappend` mempty {
837-
ghcOptLinkNoHsMain = toFlag (not isHaskellMain)
838-
}
838+
linkerOpts `mappend`
839+
mempty { ghcOptLinkNoHsMain = toFlag (not isHaskellMain) } `mappend`
840+
(if withStaticExe then mempty else dynLinkerOpts)
839841

840842
-- Build static/dynamic object files for TH, if needed.
841843
when compileForTH $

0 commit comments

Comments
 (0)