passing CFLAGS and LDFLAGS to ghc via Cabal?

Jens Petersen juhpetersen at
Mon Oct 27 08:50:41 UTC 2014

On 25 October 2014 05:10, Sergei Trofimovich <slyich at> wrote:
> I believe the proper way to pass them is via
>     --ghc-option="-optc$EACH_CFLAG -optl$EACH_LDFLAG -opta$EACH_ASFLAG"
> as Cabal uses ghc to compile .c/.cpp files.

Thanks Sergei that helped a lot. :)

I can now get proper debuginfo generated for libraries,
but somehow not for executables: but that looks
like some ghc behaviour problem perhaps.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the cabal-devel mailing list