[project @ 2005-04-25 13:02:31 by simonmar]
authorsimonmar <unknown>
Mon, 25 Apr 2005 13:02:31 +0000 (13:02 +0000)
committersimonmar <unknown>
Mon, 25 Apr 2005 13:02:31 +0000 (13:02 +0000)
Requested by Duncan Coutts: -optc flags get passed to the assembler
phase too.  It's not obvious, when using GHC to compile a .c file,
that options need to be passed both with -optc and -opta - gcc doesn't
need this, for example.

This is an experimental change - if it breaks anything we can back it
out.  If anyone needs to pass flags to the .c->.s phase *only*, then
we will need to add another flag for that purpose.  It seems unlikely,
though (there aren't many flags that affect the assembler only, and
those that do don't conflict with flags for the C phase).

ghc/compiler/main/DynFlags.hs

index 09932b6..518a8e9 100644 (file)
@@ -766,7 +766,7 @@ dynamic_flags = [
   ,  ( "optL"          , HasArg (upd . addOptL) )  
   ,  ( "optP"          , HasArg (upd . addOptP) )  
   ,  ( "optF"           , HasArg (upd . addOptF) )  
-  ,  ( "optc"          , HasArg (upd . addOptc) )  
+  ,  ( "optc"          , HasArg (\f -> upd (addOptc f . addOpta f)) )
   ,  ( "optm"          , HasArg (upd . addOptm) )  
   ,  ( "opta"          , HasArg (upd . addOpta) )  
   ,  ( "optl"          , HasArg (upd . addOptl) )