-
Notifications
You must be signed in to change notification settings - Fork 702
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
Update #7874: Add test, fix changelog #7900
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 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 |
OK, thanks, I got confused. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this matches the old PR and, while I'm not experienced in this area, the test looks great. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, thank you very much. :)
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 thatgcc
is 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
cabal
passing-pgmc
flag toghc
, thus overriding the C compiler. However original issue #4439 also mentioned the intention to override linker, which should have resulted in-pgml
being passed to theghc
, but this doesn't happen in the original patch.