From a7e8e270fbbe67fd2229ebe26b6d13cd8aaf69de Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 11 Mar 1999 09:46:31 +0000 Subject: [PATCH] [project @ 1999-03-11 09:46:30 by sof] -fcompiling-prelude is back! When compiling the Prelude we need to distinguish between wired-in module references that are DLL-bound or not. (Just having -static didn't cut it in the end, since it also encompasses RTS references.) On platforms that don't use Win32 DLLs, Preludes compiled with and without -fcompiling-prelude will be observationally equivalent. --- ghc/compiler/basicTypes/Module.lhs | 4 ++-- ghc/compiler/main/CmdLineOpts.lhs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/basicTypes/Module.lhs b/ghc/compiler/basicTypes/Module.lhs index deeefe1..2e6f46c 100644 --- a/ghc/compiler/basicTypes/Module.lhs +++ b/ghc/compiler/basicTypes/Module.lhs @@ -44,7 +44,7 @@ module Module #include "HsVersions.h" import OccName import Outputable -import CmdLineOpts ( opt_Static ) +import CmdLineOpts ( opt_Static, opt_CompilingPrelude ) \end{code} @@ -165,7 +165,7 @@ mkPrelModule :: UserString -> Module mkPrelModule s = Module (_PK_ (encode s)) ilk where ilk - | opt_Static = HiFile + | opt_Static || opt_CompilingPrelude = HiFile | otherwise = HiDllFile mkSrcModuleFS :: UserFS -> Module diff --git a/ghc/compiler/main/CmdLineOpts.lhs b/ghc/compiler/main/CmdLineOpts.lhs index 30412e8..89c6fc8 100644 --- a/ghc/compiler/main/CmdLineOpts.lhs +++ b/ghc/compiler/main/CmdLineOpts.lhs @@ -20,6 +20,7 @@ module CmdLineOpts ( opt_AutoSccsOnAllToplevs, opt_AutoSccsOnExportedToplevs, opt_AutoSccsOnIndividualCafs, + opt_CompilingPrelude, opt_D_dump_absC, opt_D_dump_asm, opt_D_dump_deriv, @@ -279,6 +280,14 @@ opt_AllowUndecidableInstances = lookUp SLIT("-fallow-undecidable-instances") opt_AutoSccsOnAllToplevs = lookUp SLIT("-fauto-sccs-on-all-toplevs") opt_AutoSccsOnExportedToplevs = lookUp SLIT("-fauto-sccs-on-exported-toplevs") opt_AutoSccsOnIndividualCafs = lookUp SLIT("-fauto-sccs-on-individual-cafs") + {- + It's a bit unfortunate to have to re-introduce this chap, but on Win32 + platforms we do need a way of distinguishing between the case when we're + compiling a static version of the Prelude and one that's going to be + put into a DLL. Why? Because the compiler's wired in modules need to + be attributed as either coming from a DLL or not. + -} +opt_CompilingPrelude = lookUp SLIT("-fcompiling-prelude") opt_D_dump_absC = lookUp SLIT("-ddump-absC") opt_D_dump_asm = lookUp SLIT("-ddump-asm") opt_D_dump_deriv = lookUp SLIT("-ddump-deriv") -- 1.7.10.4