Skip to content

Commit

Permalink
A first fix for haskell#7339
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-romes committed Nov 15, 2023
1 parent 1157461 commit c271ad9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Simple/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ buildOrReplLib mReplFlags verbosity numJobs pkg_descr lbi lib clbi = do
, ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi
, ghcOptLinkFrameworkDirs =
toNubListR $ PD.extraFrameworkDirs libBi
, ghcOptRPaths = rpaths
, ghcOptRPaths = rpaths <> toNubListR (extraLibDirs libBi)
}
ghcStaticLinkArgs =
mempty
Expand Down Expand Up @@ -1666,7 +1666,7 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do
}
dynLinkerOpts =
mempty
{ ghcOptRPaths = rpaths
{ ghcOptRPaths = rpaths <> toNubListR (extraLibDirs bnfo)
, ghcOptInputFiles =
toNubListR
[tmpDir </> x | x <- cLikeObjs ++ cxxObjs ++ cmmObjs ++ asmObjs]
Expand Down
2 changes: 2 additions & 0 deletions Cabal/src/Distribution/Simple/Program/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,8 @@ renderGhcOptions comp _platform@(Platform _arch os) opts
, ["-no-hs-main" | flagBool ghcOptLinkNoHsMain]
, ["-dynload deploy" | not (null (flags ghcOptRPaths))]
, concat
-- Ideally, this should call a hypothetical `-rpath` flag on GHC,
-- so that GHC can correctly handle the tricky -rpath logic (e.g. )
[ ["-optl-Wl,-rpath," ++ dir]
| dir <- flags ghcOptRPaths
]
Expand Down

0 comments on commit c271ad9

Please sign in to comment.