Only add -rpath to linker invocation when -dynamic
authorClemens Fruhwirth <clemens@endorphin.org>
Wed, 1 Aug 2007 09:24:29 +0000 (09:24 +0000)
committerClemens Fruhwirth <clemens@endorphin.org>
Wed, 1 Aug 2007 09:24:29 +0000 (09:24 +0000)
compiler/main/DriverPipeline.hs

index a9e9ab4..3a0fefa 100644 (file)
@@ -1174,7 +1174,7 @@ linkBinary dflags o_files dep_packages = do
 
     pkg_lib_paths <- getPackageLibraryPath dflags dep_packages
     let pkg_lib_path_opts = concat (map get_pkg_lib_path_opts pkg_lib_paths)
-       get_pkg_lib_path_opts l | opt_HardwireLibPaths = ["-L" ++ l, "-Wl,-rpath", "-Wl," ++ l]
+       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