-
Notifications
You must be signed in to change notification settings - Fork 697
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
cabal does not respect ghc-options for -pgmc, -pgml etc #4439
Comments
Linking back to the context/motivation: https://github.com/nh2/link-with-lld-example |
@nh2 If you want to attempt solving this ticket, I'd be happy to advise. I hope that this is as simple as going through the ProgramDb interface rather than doing it directly, but there may be other complications. |
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 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 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
Hi! Heads up about #7874, which is a PR solving this ticket that @jberryman has kindly just rebased and we are desperate to merge before it bitrots. We need to add a small test for that or at least test the branch on the examples you have. 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. |
Investigate regression: |
reclosing. anything future with the upstream issue were are blocked in can be handled in the other ticket. |
In this place
cabal calls ghc just like that, without respecting the C compiler and linker that the user has set in
--ghc-options
and--with-gcc
/with-ld
.To reproduce, simply
sudo mv /usr/bin/gcc /usr/bin/gcc.backup
and try to runcabal configure --with-gcc=clang --with-ld=clang -v3
. You will get:In this instance, cabal ignored
--with-gcc
.--
Next, make gcc available again (
sudo mv /usr/bin/gcc.backup /usr/bin/gcc
), complete theconfigure
, then move gcc away again and try to compile aYou will get when
Linking...
the library:The text was updated successfully, but these errors were encountered: