summaryrefslogtreecommitdiff
path: root/compiler/ghci
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2017-01-21 09:59:55 -0800
committerBartosz Nitka <niteria@gmail.com>2017-01-21 10:00:12 -0800
commitf9ccad236fa6042a3abbb655129f47fe9dadceaf (patch)
treeded82c41ef05fe429cbabee10ae730795e5774bc /compiler/ghci
parent15b9a85ef03e2729d487a6f8460be8880c797609 (diff)
downloadhaskell-f9ccad236fa6042a3abbb655129f47fe9dadceaf.tar.gz
Always use -Xlinker for -rpath
Currently we use `-Wl` which takes a list of comma-separated options. Unfortunately that breaks when you use it with `-rpath` and a path that has commas in them. Buck, the build system, produces paths with commas in them. `-Xlinker` doesn't have this disadvantage and as far as I can tell is supported by both `gcc` and `clang`. Anecdotally `nvcc` supports `-Xlinker`, but not `-Wl`. Test Plan: ./validate, harbourmaster Reviewers: nomeata, simonmar, austin, bgamari, hvr Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2971
Diffstat (limited to 'compiler/ghci')
-rw-r--r--compiler/ghci/Linker.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index 9252489617..76c1cdafa2 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -880,18 +880,23 @@ dynLoadObjs hsc_env pls objs = do
concatMap
(\(lp, l) ->
[ Option ("-L" ++ lp)
- , Option ("-Wl,-rpath")
- , Option ("-Wl," ++ lp)
+ , Option "-Xlinker"
+ , Option "-rpath"
+ , Option "-Xlinker"
+ , Option lp
, Option ("-l" ++ l)
])
(temp_sos pls)
++ concatMap
(\lp ->
[ Option ("-L" ++ lp)
- , Option ("-Wl,-rpath")
- , Option ("-Wl," ++ lp)
+ , Option "-Xlinker"
+ , Option "-rpath"
+ , Option "-Xlinker"
+ , Option lp
])
minus_big_ls
+ -- See Note [-Xlinker -rpath vs -Wl,-rpath]
++ map (\l -> Option ("-l" ++ l)) minus_ls,
-- Add -l options and -L options from dflags.
--