Tag ForeignCalls with the package they correspond to
[ghc-hetmet.git] / compiler / main / StaticFlags.hs
index 9553081..56242b7 100644 (file)
@@ -271,6 +271,8 @@ opt_UF_DearOp            = ( 4 :: Int)
 opt_PIC :: Bool
 #if darwin_TARGET_OS && x86_64_TARGET_ARCH
 opt_PIC                         = True
+#elif darwin_TARGET_OS
+opt_PIC                         = lookUp (fsLit "-fPIC") || not opt_Static
 #else
 opt_PIC                         = lookUp (fsLit "-fPIC")
 #endif
@@ -405,7 +407,14 @@ way_details =
 
     Way WayDyn "dyn" False "Dynamic"
        [ "-DDYNAMIC"
-       , "-optc-DDYNAMIC" ],
+       , "-optc-DDYNAMIC" 
+#if defined(mingw32_TARGET_OS)
+       -- On Windows, code that is to be linked into a dynamic library must be compiled
+       --      with -fPIC. Labels not in the current package are assumed to be in a DLL 
+       --      different from the current one.
+       , "-fPIC"
+#endif
+       ],
 
     Way WayProf "p" False "Profiling"
        [ "-fscc-profiling"