Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass ld-options through to GHC #5451

Merged
merged 2 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
nh2 marked this conversation as resolved.
Show resolved Hide resolved
++ [ "-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