diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ghci/Linker.lhs | 5 | ||||
-rw-r--r-- | compiler/main/DriverPipeline.hs | 9 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 3 | ||||
-rw-r--r-- | compiler/main/StaticFlags.hs | 12 |
4 files changed, 9 insertions, 20 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 7a5ca901bc..2607ca0449 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -44,7 +44,6 @@ import BasicTypes import Outputable import Panic import Util -import StaticFlags import ErrUtils import SrcLoc import qualified Maybes @@ -264,7 +263,7 @@ showLinkerState dflags -- @-l@ options in @v_Opt_l@, -- -- d) Loading any @.o\/.dll@ files specified on the command line, now held --- in @v_Ld_inputs@, +-- in @ldInputs@, -- -- e) Loading any MacOS frameworks. -- @@ -298,7 +297,7 @@ reallyInitDynLinker dflags = ; libspecs <- mapM (locateLib dflags False lib_paths) minus_ls -- (d) Link .o files from the command-line - ; cmdline_ld_inputs <- readIORef v_Ld_inputs + ; let cmdline_ld_inputs = ldInputs dflags ; classified_ld_inputs <- mapM (classifyLdInput dflags) cmdline_ld_inputs diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index a579519ae6..4db4245f0a 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -39,7 +39,6 @@ import Module import UniqFM ( eltsUFM ) import ErrUtils import DynFlags -import StaticFlags ( v_Ld_inputs ) import Config import Panic import Util @@ -357,7 +356,7 @@ linkingNeeded dflags linkables pkg_deps = do Left _ -> return True Right t -> do -- first check object files and extra_ld_inputs - extra_ld_inputs <- readIORef v_Ld_inputs + let extra_ld_inputs = ldInputs dflags e_extra_times <- mapM (tryIO . getModificationUTCTime) extra_ld_inputs let (errs,extra_times) = splitEithers e_extra_times let obj_times = map linkableTime linkables ++ extra_times @@ -1557,7 +1556,7 @@ getLinkInfo dflags dep_packages = do pkg_frameworks <- case platformOS (targetPlatform dflags) of OSDarwin -> getPackageFrameworks dflags dep_packages _ -> return [] - extra_ld_inputs <- readIORef v_Ld_inputs + let extra_ld_inputs = ldInputs dflags let link_info = (package_link_opts, pkg_frameworks, @@ -1715,7 +1714,7 @@ linkBinary dflags o_files dep_packages = do return [] -- probably _stub.o files - extra_ld_inputs <- readIORef v_Ld_inputs + let extra_ld_inputs = ldInputs dflags -- opts from -optl-<blah> (including -l<blah> options) let extra_ld_opts = getOpts dflags opt_l @@ -1913,7 +1912,7 @@ linkDynLib dflags o_files dep_packages let pkg_link_opts = collectLinkOpts dflags pkgs_no_rts -- probably _stub.o files - extra_ld_inputs <- readIORef v_Ld_inputs + let extra_ld_inputs = ldInputs dflags let extra_ld_opts = getOpts dflags opt_l diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 3f8ed450eb..b5d17ca195 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -563,6 +563,8 @@ data DynFlags = DynFlags { -- Set by @-ddump-file-prefix@ dumpPrefixForce :: Maybe FilePath, + ldInputs :: [String], + includePaths :: [String], libraryPaths :: [String], frameworkPaths :: [String], -- used on darwin only @@ -1130,6 +1132,7 @@ defaultDynFlags mySettings = dynLibLoader = SystemDependent, dumpPrefix = Nothing, dumpPrefixForce = Nothing, + ldInputs = [], includePaths = [], libraryPaths = [], frameworkPaths = [], diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index 34acd98b8a..7b89db8b52 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -66,7 +66,6 @@ module StaticFlags ( -- misc opts opt_ErrorSpans, opt_HistorySize, - v_Ld_inputs, opt_StubDeadValues, -- For the parser @@ -293,20 +292,9 @@ opt_UF_DearOp = ( 40 :: Int) opt_ErrorSpans :: Bool opt_ErrorSpans = lookUp (fsLit "-ferror-spans") --- object files and libraries to be linked in are collected here. --- ToDo: perhaps this could be done without a global, it wasn't obvious --- how to do it though --SDM. -GLOBAL_VAR(v_Ld_inputs, [], [String]) - ----------------------------------------------------------------------------- -- Tunneling our global variables into a new instance of the GHC library --- Ignore the v_Ld_inputs global because: --- a) It is mutated even once GHC has been initialised, which means that I'd --- have to add another layer of indirection to truly share the value --- b) We can get away without sharing it because it only affects the link, --- and is mutated by the GHC exe. Users who load up a new copy of the GHC --- library while another is running almost certainly won't actually access it. saveStaticFlagGlobals :: IO (Bool, [String]) saveStaticFlagGlobals = liftM2 (,) (readIORef v_opt_C_ready) (readIORef v_opt_C) |