Controlling -fno-unit-at-a-time

If I understand the way things work, GHC decides whether or not to emit the -fno-unit-at-a-time flag in -fvia-C compilation based on whether or not the gcc used when compiling GHC supported the flag or not. I'm running into trouble using precompiled GHC snapshots (that were compiled on machines whose gcc supports -fno-unit-at-a-time) on a machine whose gcc doesn't support it (a gcc 3.2 version, I believe). Is there any way force GHC to not emit the flag (short of recompiling from source)? Thanks, - Ravi

On Tue, Oct 03, 2006 at 04:59:58PM -0400, Ravi Nanavati wrote:
If I understand the way things work, GHC decides whether or not to emit the -fno-unit-at-a-time flag in -fvia-C compilation based on whether or not the gcc used when compiling GHC supported the flag or not. I'm running into trouble using precompiled GHC snapshots (that were compiled on machines whose gcc supports -fno-unit-at-a-time) on a machine whose gcc doesn't support it (a gcc 3.2 version, I believe).
Is there any way force GHC to not emit the flag (short of recompiling from source)?
Not really. You could use a small gcc wrapper to remove it (you can point to it with -pgmc if you don't want to contaminate your path with it). You could probably also change the 'f' to a 'D' with a hex editor, but I'm not sure why anyone would prefer that solution. Thanks Ian

Ian Lynagh wrote:
On Tue, Oct 03, 2006 at 04:59:58PM -0400, Ravi Nanavati wrote:
If I understand the way things work, GHC decides whether or not to emit the -fno-unit-at-a-time flag in -fvia-C compilation based on whether or not the gcc used when compiling GHC supported the flag or not. I'm running into trouble using precompiled GHC snapshots (that were compiled on machines whose gcc supports -fno-unit-at-a-time) on a machine whose gcc doesn't support it (a gcc 3.2 version, I believe).
Is there any way force GHC to not emit the flag (short of recompiling from source)?
Not really. You could use a small gcc wrapper to remove it (you can point to it with -pgmc if you don't want to contaminate your path with it).
You could probably also change the 'f' to a 'D' with a hex editor, but I'm not sure why anyone would prefer that solution.
It would be nice if these kind of configuration settings were in some file rather than being baked into GHC. I think it might be possible to pass in these flags via the package configuration for the rts package, for example. Cheers, Simon

On Thu, 2006-10-05 at 10:55 +0100, Simon Marlow wrote:
Ian Lynagh wrote:
On Tue, Oct 03, 2006 at 04:59:58PM -0400, Ravi Nanavati wrote:
If I understand the way things work, GHC decides whether or not to emit the -fno-unit-at-a-time flag in -fvia-C compilation based on whether or not the gcc used when compiling GHC supported the flag or not. I'm running into trouble using precompiled GHC snapshots (that were compiled on machines whose gcc supports -fno-unit-at-a-time) on a machine whose gcc doesn't support it (a gcc 3.2 version, I believe).
Is there any way force GHC to not emit the flag (short of recompiling from source)?
It would be nice if these kind of configuration settings were in some file rather than being baked into GHC. I think it might be possible to pass in these flags via the package configuration for the rts package, for example.
A few months back I looked at doing just this. Having a ghc-reconf tool that would update the flags in the rts package to reflect the current environment (basically the gcc version). I didn't finish it but my code is still around so if anyone wants to pick it up just ask me. Duncan
participants (4)
-
Duncan Coutts
-
Ian Lynagh
-
Ravi Nanavati
-
Simon Marlow