driver: use absolute paths in ld scripts (#7452)
authorAustin Seipp <austin@well-typed.com>
Sun, 20 Jul 2014 15:13:15 +0000 (10:13 -0500)
committerAustin Seipp <austin@well-typed.com>
Sun, 20 Jul 2014 21:55:52 +0000 (16:55 -0500)
Patch contributed by slowmo.

Signed-off-by: Austin Seipp <austin@well-typed.com>
compiler/main/DriverPipeline.hs

index 11427e2..49126fe 100644 (file)
@@ -2166,7 +2166,9 @@ joinObjectFiles dflags o_files output_fn = do
   if ldIsGnuLd
      then do
           script <- newTempName dflags "ldscript"
-          writeFile script $ "INPUT(" ++ unwords o_files ++ ")"
+          cwd <- getCurrentDirectory
+          let o_files_abs = map (cwd </>) o_files
+          writeFile script $ "INPUT(" ++ unwords o_files_abs ++ ")"
           ld_r [SysTools.FileOption "" script] ccInfo
      else if sLdSupportsFilelist mySettings
      then do