ITADN

Cabal doesn’t honor `program-locations gcc-locations`, `program-default-options ghc-options: -pgmc=`, or `--with-gcc`

#11881Openessandess 创建于 2026-05-25
type: bugneeds triage
E
essandesscommented
I maintain several MacPorts `cabal`-based projects. We have an issue that these projects fail to build if `gcc` is installed. We’ve attempted all options known to us to tell `cabal` explicitly to use the C compiler `${configure.cc}`, but all these options fail, and it is clear from build logs that `cabal` is ignoring or overriding these `config` settings, as well as the command line option `--with-gcc=/usr/bin/clang`: ``` program-locations gcc-location: /usr/bin/clang program-default-options ghc-options: -pgmc=/usr/bin/clang runghc-options: -pgmc=/usr/bin/clang ``` It appears that `cabal` simply doesn’t use the directives documented to tell it which C compiler to use if `gcc` is in `PATH`. We’ve hacked around this by setting up temporary symlinks from `gcc` to `/usr/bin/clang` during the build, but this is a terrible hack. See: https://github.com/macports/macports-ports/pull/32843
0 条评论