David Barton writes:
> ghc -DOMIT_NATIVE_CODEGEN ... -c absCSyn/CLabel.lhs ...
>
> absCSyn/CLabel.lhs:315: Value not in scope: `fmtAsmLbl'
>
> absCSyn/CLabel.lhs:319: Value not in scope: `underscorePrefix'
>
> I included the entire command line on purpose; I wanted to establish
> that OMIT_NATIVE_CODEGEN is indeed present. This is because, in
> CLabel.lhs, the following lines occur:
>
> #if ! OMIT_NATIVE_CODEGEN
> import {-# SOURCE #-} MachMisc ( underscorePrefix, fmtAsmLbl )
> #endif
>
> Thus, when OMIT_NATIVE_CODEGEN is defined, the two values in question
> are not defined. Down farther in CLabel, I find that the two
> references in question are *not* enclosed in a similar if statement;
>
...
> Since it looks like a real, honest to goodness error I am not sure
> what to do about it. Any suggestions, anyone?
>
Just protect the usages of fmtAsmLabel and underscorePrefix with
#if ! OMIT_NATIVE_CODEGEN, as done by the appended patch.
--Sigbjorn
*** ghc/compiler.CLabel.lhs 1998/01/08 18:03:24 1.16
--- ghc/compiler/CLabel.lhs 1998/02/10 14:15:51 1.18
***************
*** 312,323 ****
pprCLabel :: CLabel -> SDoc
pprCLabel (AsmTempLabel u)
= text (fmtAsmLbl (showUnique u))
! pprCLabel lbl
! = getPprStyle $ \ sty ->
if asmStyle sty && underscorePrefix then
pp_cSEP <> pprCLbl lbl
else
pprCLbl lbl
--- 312,327 ----
pprCLabel :: CLabel -> SDoc
+ #if ! OMIT_NATIVE_CODEGEN
pprCLabel (AsmTempLabel u)
= text (fmtAsmLbl (showUnique u))
+ #endif
! pprCLabel lbl =
! #if ! OMIT_NATIVE_CODEGEN
! getPprStyle $ \ sty ->
if asmStyle sty && underscorePrefix then
pp_cSEP <> pprCLbl lbl
else
+ #endif
pprCLbl lbl