Repository navigation
Respect ghc-options and with-gcc when compiling C sources - #5440
syntheorem wants to merge 1 commit into
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
|
Shouldn’t this be |
No, this is using the existing program replacement infrastructure, in which the C compiler is named gcc. So
Possibly, if GHC itself respects those env vars. The problem is that we were calling GHC to compile C files without explicitly passing |
|
Fair point on What happens if |
|
Since
|
|
So I could provide Should we rather WARN or even ERROR in that case? |
|
Sure, but that applies to any argument that Cabal passes to GHC. I think that Although maybe we want to warn upon ever seeing |
|
FYI, this is the Travis CI failure, only in the
And this is the AppVeyor failure:
Not sure that these are actionable failures. |
|
What's holding this back? It looks like a simple change. |
|
This looks fine. Needs a rebase and merge conflict resolution but o/w ok to go in./ |
|
... and test(s) |
|
@syntheorem sorry this languished. do you care to resolve the conflicts against master so we can proceed with it? |
|
Hi! Heads up about #7874, which is this PR just rebased by @jberryman and we are desperate to merge it before it bitrots. We need to add a small test for that or at least test the branch on the examples you have. Please help! |
|
Please kindly also have a look (and review) at #7900, which provides a test and discusses its result. Last chance to provide feedback before we merge. Thank you! |
|
@jberryman: thank you for #7900, which is now merged, which ends the saga! Please, everybody, test and reopen if anything doesn't work as expected. |
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 -vto confirm that the correct arguments arebeing passed to GHC when compiling the C++ sources.
Resolves: #4439
[ci skip]is used to avoid triggering the build bots.