projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX part of #1372, improvements to the recompilation checker
[ghc-hetmet.git]
/
compiler
/
main
/
DriverPipeline.hs
diff --git
a/compiler/main/DriverPipeline.hs
b/compiler/main/DriverPipeline.hs
index
4dc287a
..
e9fb307
100644
(file)
--- a/
compiler/main/DriverPipeline.hs
+++ b/
compiler/main/DriverPipeline.hs
@@
-35,7
+35,7
@@
import Module
import UniqFM ( eltsUFM )
import ErrUtils
import DynFlags
import UniqFM ( eltsUFM )
import ErrUtils
import DynFlags
-import StaticFlags ( v_Ld_inputs, opt_Static, WayName(..) )
+import StaticFlags ( v_Ld_inputs, opt_Static, opt_HardwireLibPaths, WayName(..) )
import Config
import Panic
import Util
import Config
import Panic
import Util
@@
-640,15
+640,15
@@
runPhase (Hsc src_flavour) stop dflags0 basename suff input_fn get_output_fn _ma
dflags = dflags0 { includePaths = current_dir : paths }
-- gather the imports and module name
dflags = dflags0 { includePaths = current_dir : paths }
-- gather the imports and module name
- (hspp_buf,mod_name) <-
+ (hspp_buf,mod_name,imps,src_imps) <-
case src_flavour of
ExtCoreFile -> do { -- no explicit imports in ExtCore input.
; m <- getCoreModuleName input_fn
case src_flavour of
ExtCoreFile -> do { -- no explicit imports in ExtCore input.
; m <- getCoreModuleName input_fn
- ; return (Nothing, mkModuleName m) }
+ ; return (Nothing, mkModuleName m, [], []) }
other -> do { buf <- hGetStringBuffer input_fn
other -> do { buf <- hGetStringBuffer input_fn
- ; (_,_,L _ mod_name) <- getImports dflags buf input_fn
- ; return (Just buf, mod_name) }
+ ; (src_imps,imps,L _ mod_name) <- getImports dflags buf input_fn
+ ; return (Just buf, mod_name, imps, src_imps) }
-- Build a ModLocation to pass to hscMain.
-- The source filename is rather irrelevant by now, but it's used
-- Build a ModLocation to pass to hscMain.
-- The source filename is rather irrelevant by now, but it's used
@@
-735,8
+735,8
@@
runPhase (Hsc src_flavour) stop dflags0 basename suff input_fn get_output_fn _ma
ms_location = location4,
ms_hs_date = src_timestamp,
ms_obj_date = Nothing,
ms_location = location4,
ms_hs_date = src_timestamp,
ms_obj_date = Nothing,
- ms_imps = unused_field,
- ms_srcimps = unused_field }
+ ms_imps = imps,
+ ms_srcimps = src_imps }
-- run the compiler!
mbResult <- hscCompileOneShot hsc_env
-- run the compiler!
mbResult <- hscCompileOneShot hsc_env
@@
-1173,7
+1173,9
@@
linkBinary dflags o_files dep_packages = do
-- dependencies, and eliminating duplicates.
pkg_lib_paths <- getPackageLibraryPath dflags dep_packages
-- dependencies, and eliminating duplicates.
pkg_lib_paths <- getPackageLibraryPath dflags dep_packages
- let pkg_lib_path_opts = map ("-L"++) pkg_lib_paths
+ let pkg_lib_path_opts = concat (map get_pkg_lib_path_opts pkg_lib_paths)
+ get_pkg_lib_path_opts l | opt_HardwireLibPaths && not opt_Static = ["-L" ++ l, "-Wl,-rpath", "-Wl," ++ l]
+ | otherwise = ["-L" ++ l]
let lib_paths = libraryPaths dflags
let lib_path_opts = map ("-L"++) lib_paths
let lib_paths = libraryPaths dflags
let lib_path_opts = map ("-L"++) lib_paths