Skip to content

Adding an explicit pgmcxx flag for interaction with GHC#11763

Draft
zlonast wants to merge 2 commits intohaskell:masterfrom
zlonast:zlonast/pgmcxx-option
Draft

Adding an explicit pgmcxx flag for interaction with GHC#11763
zlonast wants to merge 2 commits intohaskell:masterfrom
zlonast:zlonast/pgmcxx-option

Conversation

@zlonast
Copy link
Copy Markdown
Collaborator

@zlonast zlonast commented Apr 24, 2026

Add an explicit pgmcxx flag to Cabal's GHC invocation logic. This aligns
with the existing pgmc behavior and accounts for the GHC 9.4+ toolchain
requirements, resolving inconsistencies in how C++ compiler options are handled.

This change allows users to remove extra-libraries: stdc++ from their
configuration files, as g++ automatically handles C++ standard library
linking, unlike the legacy approach of invoking C++ via gcc.

Main idea #9801 (comment)

IMHO, cc-options (and ld-options and cpp-options and ...) should be always passed when invoking GHC, similarly as ghc-options should be always used when invoking ghc - regardless of what is the intention of a particular GHC-call. GHC might use or not use the options, Cabal cannot know and should not guess.

Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch from c10af43 to 8fc0a6f Compare April 24, 2026 12:52
@zlonast zlonast force-pushed the zlonast/pgmcxx-option branch from 8fc0a6f to 92d0cb0 Compare April 24, 2026 13:33
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.

1 participant