Remove LazyUniqFM; fixes trac #3880
[ghc-hetmet.git] / compiler / main / DriverPipeline.hs
index 0ca76a2..c0aed96 100644 (file)
@@ -35,7 +35,7 @@ import Finder
 import HscTypes
 import Outputable
 import Module
-import LazyUniqFM              ( eltsUFM )
+import UniqFM          ( eltsUFM )
 import ErrUtils
 import DynFlags
 import StaticFlags     ( v_Ld_inputs, opt_Static, WayName(..) )
@@ -1731,6 +1731,14 @@ linkDynLib dflags o_files dep_packages = do
     -----------------------------------------------------------------------------
 
     let output_fn = case o_file of { Just s -> s; Nothing -> "a.out"; }
+    let buildingRts = thisPackage dflags == rtsPackageId
+    let bsymbolicFlag = if buildingRts
+                        then -- -Bsymbolic breaks the way we implement
+                             -- hooks in the RTS
+                             []
+                        else -- we need symbolic linking to resolve
+                             -- non-PIC intra-package-relocations
+                             ["-Wl,-Bsymbolic"]
 
     SysTools.runLink dflags
         ([ SysTools.Option verb
@@ -1740,7 +1748,8 @@ linkDynLib dflags o_files dep_packages = do
         ++ map SysTools.Option (
            md_c_flags
         ++ o_files
-        ++ [ "-shared", "-Wl,-Bsymbolic" ] -- we need symbolic linking to resolve non-PIC intra-package-relocations
+        ++ [ "-shared" ]
+        ++ bsymbolicFlag
          ++ [ "-Wl,-soname," ++ takeFileName output_fn ] -- set the library soname
         ++ extra_ld_inputs
         ++ lib_path_opts