Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/c-util/run-cc.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/c-util/run-cc.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2073, Fri Nov 2 19:47:36 2012 UTC revision 2074, Fri Nov 2 22:13:59 2012 UTC
# Line 44  Line 44 
44    
45      fun linkLib (baseName, ldOpts) = let      fun linkLib (baseName, ldOpts) = let
46            val objFile = OS.Path.joinBaseExt{base=baseName, ext=SOME"o"}            val objFile = OS.Path.joinBaseExt{base=baseName, ext=SOME"o"}
47            val tmpFile = OS.Path.joinBaseExt{base=OS.FileSys.tmpName(), ext=SOME "o"}            val tmpFile = let
48                  (* on Linux systems, the rename fails if the src and dst are on
49                   * different devices, so we create the temp file in the same
50                   * directory as the final target.
51                   *)
52                    val {file, ...} = OS.Path.splitDirFile(OS.FileSys.tmpName())
53                    val {dir, ...} = OS.Path.splitDirFile baseName
54                    in
55                      OS.Path.joinDirFile{
56                          dir = dir,
57                          file = OS.Path.joinBaseExt{
58                              base = file,
59                              ext = SOME "o"
60                            }
61                        }
62                    end
63            val cmd = String.concatWith " " ([Paths.ld, "-r", "-o", tmpFile, objFile] @ ldOpts)            val cmd = String.concatWith " " ([Paths.ld, "-r", "-o", tmpFile, objFile] @ ldOpts)
64            fun link () = (            fun link () = (
65                  system cmd;                  system cmd;

Legend:
Removed from v.2073  
changed lines
  Added in v.2074

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0