[Haskell-cafe] -fwhole-program (for gcc) in cabal files?
waldmann at imn.htwk-leipzig.de
Wed Nov 3 07:49:21 EDT 2010
In a project with Haskell + FFI,
I recently split my C program into modules (files).
I don't want to lose optimization though,
so I want to use something like
gcc -c -o complete.o -fwhole-program -combine *.c
(doing whole program optimization/inlining etc., I hope).
How do I write this in the cabal file?
It seems ghc compiles each C source individually.
Or should I use "-flto" on individual compilations?
(That's what Gimple was invented for, actually?)
But does this play nicely with ghc's linker?
(Which is gcc, so it should be fine?)
More information about the Haskell-Cafe