From: sof Date: Mon, 23 Jul 2001 20:19:53 +0000 (+0000) Subject: [project @ 2001-07-23 20:19:53 by sof] X-Git-Tag: Approximately_9120_patches~1473 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b7a226fdc7a003677fef20652d5a4597f6b29c62;p=ghc-hetmet.git [project @ 2001-07-23 20:19:53 by sof] Handle leading underscores for PrelMain undefineds --- diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index 7a4fe31..75ef178 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverPipeline.hs,v 1.91 2001/07/19 14:23:16 rrt Exp $ +-- $Id: DriverPipeline.hs,v 1.92 2001/07/23 20:19:53 sof Exp $ -- -- GHC Driver -- @@ -806,8 +806,8 @@ doLink o_files = do [ "-u", "_PrelMain_mainIO_closure" , "-u", "___init_PrelMain"] #else - [ "-u", "PrelMain_mainIO_closure" , - "-u", "__init_PrelMain"] + [ "-u", prefixUnderscore "PrelMain_mainIO_closure" , + "-u", prefixUnderscore "__init_PrelMain"] #endif else []) diff --git a/ghc/compiler/main/DriverUtil.hs b/ghc/compiler/main/DriverUtil.hs index e0141ce..ad067d6 100644 --- a/ghc/compiler/main/DriverUtil.hs +++ b/ghc/compiler/main/DriverUtil.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverUtil.hs,v 1.25 2001/06/27 10:14:13 rrt Exp $ +-- $Id: DriverUtil.hs,v 1.26 2001/07/23 20:19:53 sof Exp $ -- -- Utils for the driver -- @@ -14,6 +14,7 @@ module DriverUtil where import Util import Panic +import Config ( cLeadingUnderscore ) import IOExts import Exception @@ -66,6 +67,13 @@ softGetDirectoryContents d ) ----------------------------------------------------------------------------- +-- Prefixing underscore to linker-level names +prefixUnderscore :: String -> String +prefixUnderscore + | cLeadingUnderscore == "YES" = ('_':) + | otherwise = id + +----------------------------------------------------------------------------- -- Utils unknownFlagErr :: String -> a