Quote file paths in linker scripts
authorBen Gamari <ben@smart-cactus.org>
Sat, 7 Nov 2015 23:21:19 +0000 (00:21 +0100)
committerBen Gamari <ben@smart-cactus.org>
Sat, 7 Nov 2015 23:54:05 +0000 (00:54 +0100)
Reviewers: bgamari, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1442

GHC Trac Issues: #11063

compiler/main/DriverPipeline.hs

index 60897a3..3a027c2 100644 (file)
@@ -2191,7 +2191,7 @@ joinObjectFiles dflags o_files output_fn = do
      then do
           script <- newTempName dflags "ldscript"
           cwd <- getCurrentDirectory
-          let o_files_abs = map (cwd </>) o_files
+          let o_files_abs = map (\x -> "\"" ++ (cwd </> x) ++ "\"") o_files
           writeFile script $ "INPUT(" ++ unwords o_files_abs ++ ")"
           ld_r [SysTools.FileOption "" script] ccInfo
      else if sLdSupportsFilelist mySettings