Update #7874: Add test, fix changelog#7900
Merged
Merged
Conversation
This fix allows users to override the C/C++ compiler, either by passing --with-gcc to configure or adding -pgmc to ghc-options in their Cabal file. Tested manually with a project using C++ sources that require a more recent version of clang than the default install (macOS). Inspected the output of `Setup.hs build -v` to confirm that the correct arguments are being passed to GHC when compiling the C++ sources. Resolves: haskell#4439
This was referenced Jan 11, 2022
Member
Collaborator
Author
|
This PR takes originall commit from #7874, rebases it on master, adds test and in another commit puts changelog entry in proper place (I hope I got it right). The original commit is not changed but |
Member
|
OK, thanks, I got confused. |
Mikolaj
approved these changes
Jan 11, 2022
Kleidukos
approved these changes
Jan 12, 2022
Member
Kleidukos
left a comment
There was a problem hiding this comment.
Fantastic, thank you very much. :)
This was referenced Jan 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added test for #7874. It works by cabal package having a c file which will only compile if all the necessary defines are defined. I'm passing defines via various ways, including
cabal configure, fields of cabal file and test thatgccis overridden by passing a custom script which defines final macro without which the c file will not compile.The original patch seems to be working fine as without it the test doesn't pass. However, I noticed that the original patch only results in
cabalpassing-pgmcflag toghc, thus overriding the C compiler. However original issue #4439 also mentioned the intention to override linker, which should have resulted in-pgmlbeing passed to theghc, but this doesn't happen in the original patch.