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 'ghc-shared-options' to GHC during the linking phase. #3162

Merged
merged 1 commit into from
Feb 18, 2016

Conversation

23Skidoo
Copy link
Member

See discussion in #3158.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
justinsb Justin Santa Barbara
See discussion in haskell#3158.
@23Skidoo
Copy link
Member Author

One thing I wonder about is whether we should actually set ghcOptExtra to ghc-options <> ghc-shared-options when compiling Haskell source files with ghc -shared, since ghc-shared-options seems to be either not used or used erroneously (based on grepping Hackage). Looks like we already do it this way.

@dcoutts
Copy link
Contributor

dcoutts commented Feb 18, 2016

This seems reasonable in principle.

Yes, it would indeed have to be "ghc-options <> ghc-shared-options". Look at how we do it in other cases:

vanillaOpts `mappend` mempty {
                  ...
                  ghcOptExtra       = toNubListR $ hcSharedOptions GHC libBi,
                  ...
                }

And vanillaOpts contains hcOptions GHC libBI, so it is the combination of the two. And similarly for prof options etc. So our rule is always hc-options base plus additional prof/shared/repl whatever.

We also have the ld-options field which we use for libs but only to pass to ghci. It's hard to use that one for shared libs because there's only one field so no way to change it for dynamic vs static libs. Mind you we don't use it for static libs at all. It's a bit of an odd one in the library case (it's mainly intended for exes).

23Skidoo added a commit that referenced this pull request Feb 18, 2016
Pass 'ghc-shared-options' to GHC during the linking phase.
@23Skidoo 23Skidoo merged commit c7b6804 into haskell:master Feb 18, 2016
@23Skidoo 23Skidoo deleted the ghc-shared-options-link branch February 18, 2016 16:21
@23Skidoo
Copy link
Member Author

Yes, I noticed that hcOptions gets called from componentGhcOptions after I wrote that comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants