summaryrefslogtreecommitdiff
path: root/compiler/GHC/SysTools/Tasks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/SysTools/Tasks.hs')
-rw-r--r--compiler/GHC/SysTools/Tasks.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs
index 73b3835282..ded526513a 100644
--- a/compiler/GHC/SysTools/Tasks.hs
+++ b/compiler/GHC/SysTools/Tasks.hs
@@ -29,8 +29,10 @@ import GHC.Utils.Misc
import GHC.Utils.Logger
import GHC.Utils.TmpFs
import GHC.Utils.Constants (isWindowsHost)
+import GHC.Utils.Panic
import Data.List (tails, isPrefixOf)
+import Data.Maybe (fromMaybe)
import System.IO
import System.Process
@@ -325,7 +327,10 @@ ld: warning: symbol referencing errors
runMergeObjects :: Logger -> TmpFs -> DynFlags -> [Option] -> IO ()
runMergeObjects logger tmpfs dflags args =
traceToolCommand logger "merge-objects" $ do
- let (p,args0) = pgm_lm dflags
+ let (p,args0) = fromMaybe err (pgm_lm dflags)
+ err = throwGhcException $ UsageError $ unwords
+ [ "Attempted to merge object files but the configured linker"
+ , "does not support object merging." ]
optl_args = map Option (getOpts dflags opt_lm)
args2 = args0 ++ args ++ optl_args
-- N.B. Darwin's ld64 doesn't support response files. Consequently we only