Skip to content

Commit

Permalink
Merge pull request #5451 from nh2/issue-4925-pass-ld-options-to-ghc
Browse files Browse the repository at this point in the history
Pass `ld-options` through to GHC
  • Loading branch information
23Skidoo authored Aug 9, 2019
2 parents 83b27d9 + 26f5b34 commit 853414b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cabal/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
`non`) and an optics to access the modules in a component
of a `PackageDescription` by the `ComponentName`:
`componentBuildInfo` and `componentModules`
* Linker `ld-options` are now passed to GHC as `-optl` options
([#4925](https://github.com/haskell/cabal/pull/4925)).
* Add `readGhcEnvironmentFile` to parse GHC environment files.
* Drop support for GHC 7.4, since it is out of our support window
(and has been for over a year!)
Expand Down
12 changes: 10 additions & 2 deletions Cabal/Distribution/Simple/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,11 @@ buildOrReplLib mReplFlags verbosity numJobs pkg_descr lbi lib clbi = do
linkerOpts = mempty {
ghcOptLinkOptions = PD.ldOptions libBi
++ [ "-static"
| withFullyStaticExe lbi ],
| withFullyStaticExe lbi ]
-- Pass extra `ld-options` given
-- through to GHC's linker.
++ maybe [] programOverrideArgs
(lookupProgram ldProgram (withPrograms lbi)),
ghcOptLinkLibs = extraLibs libBi,
ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi,
ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi,
Expand Down Expand Up @@ -1274,7 +1278,11 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do
linkerOpts = mempty {
ghcOptLinkOptions = PD.ldOptions bnfo
++ [ "-static"
| withFullyStaticExe lbi ],
| withFullyStaticExe lbi ]
-- Pass extra `ld-options` given
-- through to GHC's linker.
++ maybe [] programOverrideArgs
(lookupProgram ldProgram (withPrograms lbi)),
ghcOptLinkLibs = extraLibs bnfo,
ghcOptLinkLibPath = toNubListR $ extraLibDirs bnfo,
ghcOptLinkFrameworks = toNubListR $
Expand Down

0 comments on commit 853414b

Please sign in to comment.