summaryrefslogtreecommitdiff
path: root/compiler/main/DriverPipeline.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/DriverPipeline.hs')
-rw-r--r--compiler/main/DriverPipeline.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index e0bea39020..483e5c8f59 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1676,9 +1676,10 @@ linkBinary dflags o_files dep_packages = do
then "$ORIGIN" </>
(l `makeRelativeTo` full_output_fn)
else l
- in ["-L" ++ l,
- "-Wl,-rpath", "-Wl," ++ libpath,
- "-Wl,-rpath-link", "-Wl," ++ l]
+ rpath = if dopt Opt_RPath dflags
+ then ["-Wl,-rpath", "-Wl," ++ libpath]
+ else []
+ in ["-L" ++ l, "-Wl,-rpath-link", "-Wl," ++ l] ++ rpath
| otherwise = ["-L" ++ l]
let lib_paths = libraryPaths dflags