summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asmcomp/asmlibrarian.ml2
-rw-r--r--asmcomp/asmlink.ml58
-rw-r--r--asmcomp/proc.mli3
-rw-r--r--asmcomp/proc_alpha.ml5
-rw-r--r--asmcomp/proc_hppa.ml8
-rw-r--r--asmcomp/proc_i386.ml6
-rw-r--r--asmcomp/proc_i386nt.ml7
-rw-r--r--asmcomp/proc_m68k.ml6
-rw-r--r--asmcomp/proc_mips.ml5
-rw-r--r--asmcomp/proc_power.ml5
-rw-r--r--asmcomp/proc_sparc.ml7
11 files changed, 38 insertions, 74 deletions
diff --git a/asmcomp/asmlibrarian.ml b/asmcomp/asmlibrarian.ml
index e0ebfcd7a..a847d921e 100644
--- a/asmcomp/asmlibrarian.ml
+++ b/asmcomp/asmlibrarian.ml
@@ -46,7 +46,7 @@ let create_archive file_list lib_name =
let (objfile_list, descr_list) =
List.split (List.map read_info file_list) in
output_value outchan descr_list;
- if Proc.create_archive archive_name objfile_list <> 0
+ if Ccomp.create_archive archive_name objfile_list <> 0
then raise(Error(Archiver_error archive_name));
close_out outchan
with x ->
diff --git a/asmcomp/asmlink.ml b/asmcomp/asmlink.ml
index 5336407d6..e0fe489bc 100644
--- a/asmcomp/asmlink.ml
+++ b/asmcomp/asmlink.ml
@@ -176,31 +176,41 @@ let call_linker file_list startup_file =
let cmd =
match Config.system with
"win32" ->
- Printf.sprintf
- "%s /Fe%s -I%s %s %s %s %s %s %s"
- Config.native_c_compiler
- !Clflags.exec_name
- Config.standard_library
- (String.concat " " (List.rev !Clflags.ccopts))
- startup_file
- (String.concat " " (List.rev file_list))
- (String.concat " " (List.rev !Clflags.ccobjs))
- runtime_lib
- Config.c_libraries
+ if not !Clflags.output_c_object then
+ Printf.sprintf "%s /Fe%s -I%s %s %s %s %s %s %s"
+ Config.native_c_compiler
+ !Clflags.exec_name
+ Config.standard_library
+ (String.concat " " (List.rev !Clflags.ccopts))
+ startup_file
+ (String.concat " " (List.rev file_list))
+ (String.concat " " (List.rev !Clflags.ccobjs))
+ runtime_lib
+ Config.c_libraries
+ else
+ Printf.sprintf "lib /nologo /debugtype:cv /out:%s %s %s"
+ !Clflags.object_name
+ startup_file
+ (String.concat " " (List.rev file_list))
| _ ->
- Printf.sprintf
- "%s -o %s -I%s %s %s %s -L%s %s %s %s"
- Config.native_c_compiler
- !Clflags.exec_name
- Config.standard_library
- (String.concat " " (List.rev !Clflags.ccopts))
- startup_file
- (String.concat " " (List.rev file_list))
- Config.standard_library
- (String.concat " " (List.rev !Clflags.ccobjs))
- runtime_lib
- Config.c_libraries in
- if Sys.command cmd <> 0 then raise(Error Linking_error)
+ if not !Clflags.output_c_object then
+ Printf.sprintf "%s -o %s -I%s %s %s %s -L%s %s %s %s"
+ Config.native_c_compiler
+ !Clflags.exec_name
+ Config.standard_library
+ (String.concat " " (List.rev !Clflags.ccopts))
+ startup_file
+ (String.concat " " (List.rev file_list))
+ Config.standard_library
+ (String.concat " " (List.rev !Clflags.ccobjs))
+ runtime_lib
+ Config.c_libraries
+ else
+ Printf.sprintf "ld -r -o %s %s %s"
+ !Clflags.object_name
+ startup_file
+ (String.concat " " (List.rev file_list))
+ in if Sys.command cmd <> 0 then raise(Error Linking_error)
let object_file_name name =
let file_name =
diff --git a/asmcomp/proc.mli b/asmcomp/proc.mli
index e93cf9094..491409ab7 100644
--- a/asmcomp/proc.mli
+++ b/asmcomp/proc.mli
@@ -75,6 +75,5 @@ val oper_latency: Mach.operation -> int
val num_stack_slots: int array
val contains_calls: bool ref
-(* Calling the assembler and the archiver *)
+(* Calling the assembler *)
val assemble_file: string -> string -> int
-val create_archive: string -> string list -> int
diff --git a/asmcomp/proc_alpha.ml b/asmcomp/proc_alpha.ml
index c610ca7ab..d6624e6cc 100644
--- a/asmcomp/proc_alpha.ml
+++ b/asmcomp/proc_alpha.ml
@@ -266,8 +266,3 @@ let contains_calls = ref false
let assemble_file infile outfile =
Sys.command ("as -O2 -nocpp -o " ^ outfile ^ " " ^ infile)
-(* Calling the archiver *)
-
-let create_archive archive file_list =
- Misc.remove_file archive;
- Sys.command ("ar rcs " ^ archive ^ " " ^ String.concat " " file_list)
diff --git a/asmcomp/proc_hppa.ml b/asmcomp/proc_hppa.ml
index 3d5bb82e3..d61e43e13 100644
--- a/asmcomp/proc_hppa.ml
+++ b/asmcomp/proc_hppa.ml
@@ -312,7 +312,7 @@ let oper_latency = function
let num_stack_slots = [| 0; 0 |]
let contains_calls = ref false
-(* Calling the assembler and the archiver *)
+(* Calling the assembler *)
let assemble_file infile outfile =
if Config.system = "hpux"
@@ -320,9 +320,3 @@ let assemble_file infile outfile =
then Sys.command ("gcc -c -o " ^ outfile ^ " " ^ infile)
else Sys.command ("as -o " ^ outfile ^ " " ^ infile)
-let create_archive archive file_list =
- Misc.remove_file archive;
- let ar = "ar rc " ^ archive ^ " " ^ String.concat " " file_list in
- if Config.system = "hpux"
- then Sys.command ar
- else Sys.command (ar ^ " && ranlib " ^ archive)
diff --git a/asmcomp/proc_i386.ml b/asmcomp/proc_i386.ml
index e2c5cb843..c1b5d658c 100644
--- a/asmcomp/proc_i386.ml
+++ b/asmcomp/proc_i386.ml
@@ -432,9 +432,3 @@ let contains_calls = ref false
let assemble_file infile outfile =
Sys.command ("as -o " ^ outfile ^ " " ^ infile)
-(* Calling the archiver *)
-
-let create_archive archive file_list =
- Misc.remove_file archive;
- Sys.command ("ar rc " ^ archive ^ " " ^ String.concat " " file_list ^
- " && ranlib " ^ archive)
diff --git a/asmcomp/proc_i386nt.ml b/asmcomp/proc_i386nt.ml
index 34e44b727..ed9deb6f5 100644
--- a/asmcomp/proc_i386nt.ml
+++ b/asmcomp/proc_i386nt.ml
@@ -438,10 +438,3 @@ let assemble_file infile outfile =
/c assemble only
/Fo output file name *)
-
-(* Calling the archiver *)
-
-let create_archive archive file_list =
- Misc.remove_file archive;
- Sys.command ("lib /nologo /debugtype:cv /out:" ^ archive ^ " " ^
- String.concat " " file_list)
diff --git a/asmcomp/proc_m68k.ml b/asmcomp/proc_m68k.ml
index 3a2261ec6..23e6e62b2 100644
--- a/asmcomp/proc_m68k.ml
+++ b/asmcomp/proc_m68k.ml
@@ -345,9 +345,3 @@ let contains_calls = ref false
let assemble_file infile outfile =
Sys.command ("as -o " ^ outfile ^ " " ^ infile)
-(* Calling the archiver *)
-
-let create_archive archive file_list =
- Misc.remove_file archive;
- Sys.command ("ar rc " ^ archive ^ " " ^ String.concat " " file_list ^
- " && ranlib " ^ archive)
diff --git a/asmcomp/proc_mips.ml b/asmcomp/proc_mips.ml
index 1a8080072..33c4cb29b 100644
--- a/asmcomp/proc_mips.ml
+++ b/asmcomp/proc_mips.ml
@@ -237,8 +237,3 @@ let contains_calls = ref false
let assemble_file infile outfile =
Sys.command ("as -O2 -nocpp -o " ^ outfile ^ " " ^ infile)
-(* Calling the archiver *)
-
-let create_archive archive file_list =
- Misc.remove_file archive;
- Sys.command ("ar rcs " ^ archive ^ " " ^ String.concat " " file_list)
diff --git a/asmcomp/proc_power.ml b/asmcomp/proc_power.ml
index 9eae2e3e5..83e02272c 100644
--- a/asmcomp/proc_power.ml
+++ b/asmcomp/proc_power.ml
@@ -347,12 +347,9 @@ let oper_latency = function
let num_stack_slots = [| 0; 0 |]
let contains_calls = ref false
-(* Calling the assembler and the archiver *)
+(* Calling the assembler *)
let assemble_file infile outfile =
let proc = if powerpc then "ppc" else "pwr" in
Sys.command ("as -u -m " ^ proc ^ " -o " ^ outfile ^ " " ^ infile)
-let create_archive archive file_list =
- Misc.remove_file archive;
- Sys.command ("ar rc " ^ archive ^ " " ^ String.concat " " file_list)
diff --git a/asmcomp/proc_sparc.ml b/asmcomp/proc_sparc.ml
index ad0c3efa9..7231eea86 100644
--- a/asmcomp/proc_sparc.ml
+++ b/asmcomp/proc_sparc.ml
@@ -284,10 +284,3 @@ let contains_calls = ref false
let assemble_file infile outfile =
Sys.command ("as -o " ^ outfile ^ " " ^ infile)
-let create_archive archive file_list =
- Misc.remove_file archive;
- if Config.system = "solaris" then
- Sys.command ("ar rc " ^ archive ^ " " ^ String.concat " " file_list)
- else
- Sys.command ("ar rc " ^ archive ^ " " ^ String.concat " " file_list ^
- " && ranlib " ^ archive)