Implement -fexpose-all-unfoldings, and fix a non-termination bug
[ghc-hetmet.git] / compiler / main / DriverPipeline.hs
index 1d94b49..9ed55d7 100644 (file)
@@ -997,7 +997,7 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc
                          md_c_flags
                        ++ pic_c_flags
 
-#if    defined(__PIC__) && defined(mingw32_HOST_OS)
+#if    defined(mingw32_TARGET_OS)
                -- Stub files generated for foreign exports references the runIO_closure
                -- and runNonIO_closure symbols, which are defined in the base package.
                -- These symbols are imported into the stub.c file via RtsAPI.h, and the
@@ -1447,6 +1447,12 @@ linkBinary dflags o_files dep_packages = do
                       ]
                      ++ map SysTools.Option (
                         md_c_flags
+
+#ifdef mingw32_TARGET_OS
+                      -- Permit the linker to auto link _symbol to _imp_symbol.
+                     -- This lets us link against DLLs without needing an "import library".
+                     ++ ["-Wl,--enable-auto-import"]
+#endif
                      ++ o_files
                      ++ extra_ld_inputs
                      ++ lib_path_opts
@@ -1602,6 +1608,11 @@ linkDynLib dflags o_files dep_packages = do
         ++ map (SysTools.FileOption "") o_files
         ++ map SysTools.Option (
            md_c_flags
+           
+         -- Permit the linker to auto link _symbol to _imp_symbol
+        -- This lets us link against DLLs without needing an "import library"
+        ++ ["-Wl,--enable-auto-import"]
+
         ++ extra_ld_inputs
         ++ lib_path_opts
         ++ extra_ld_opts