[Haskell-cafe] Fwd: (Solved) cabal install with external gcc tool chain not the ghc-bundled one

Duncan Coutts duncan.coutts at googlemail.com
Thu Nov 12 10:26:05 EST 2009

On Thu, 2009-11-12 at 10:46 +0100, Daniel Kahlenberg wrote:
> to answer this question myself how the use of another gcc is specified
> with effect, I used the following options with the 'cabal install' call:
>  --ghc-options="-pgmc e:/programme/ghc/mingw-gcc4/bin/gcc.exe -pgml
> e:/programme/ghc/mingw-gcc4/bin/gcc.exe"
> See
> http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#replacing-phases
> (searched in the wrong direction, too many trees...). Slightly tuned,
> this should be the way to go in all similar cases.
> One thing I haven't considered yet is if the '--with-ld' and
> '--with-gcc' options (if curious too, see logs in my previous mail -
> Subject "[Haskell-cafe] caba install with external gcc toolchain not the
> ghc-bundled one") only effect what gets written into the
> setup-config/package.conf file or what other effects these have.

Feel free to file a ticket about this. What makes me somewhat nervous is
that the gcc you want to use for say .c files is not necessarily the
same as the one ghc wants to use to compile .hc files or link stuff.
This is particularly the case on Windows where ghc includes its own copy
of gcc. Similarly on Solaris 10, ghc cannot use the /usr/bin/gcc because
it's a hacked-up gcc that uses the Sun CC backend (which doesn't grok
some of the crazy GNU C stuff that ghc uses).

So it'd certainly be possible to have cabal's --with-gcc/ld override the
ones that ghc uses by default, but the question is should it do so? I
think it's worth asking the ghc hackers about this.


More information about the Haskell-Cafe mailing list