diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2004-05-09 15:19:16 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2004-05-09 15:19:16 +0000 |
commit | c9840b7dd728b2fbaab8fb7b86f55b0638edd307 (patch) | |
tree | 87f4cf41900ee3b28e8e0163d7cf6c5328b9e535 | |
parent | 7de4fe5835a09922655dc401d5a474a9c175166c (diff) |
MAJ portage HPPA/HPUX
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6289 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | asmcomp/hppa/emit.mlp | 20 | ||||
-rw-r--r-- | asmcomp/hppa/proc.ml | 2 | ||||
-rw-r--r-- | asmrun/Makefile | 7 |
3 files changed, 11 insertions, 18 deletions
diff --git a/asmcomp/hppa/emit.mlp b/asmcomp/hppa/emit.mlp index a990990e9..4e488c748 100644 --- a/asmcomp/hppa/emit.mlp +++ b/asmcomp/hppa/emit.mlp @@ -130,18 +130,19 @@ let call_symbol s = end (* An external symbol is code if either it is branched to, or - it does not start with an uppercase letter (for calls to - runtime functions). We need to special-case a few data symbols - that start with a lower case. *) + it is one of the caml_apply* caml_curry* caml_tuplify* special functions. *) -let data_imports = - ["caml_globals_inited"; "nativeint_ops"; "int32_ops"; "int64_ops"] +let code_imports = ["caml_apply"; "caml_curry"; "caml_tuplify"] + +let match_prefix s pref = + String.length s >= String.length pref + && String.sub s 0 (String.length pref) = pref let emit_import s = if not(StringSet.mem s !defined_symbols) then begin ` .import {emit_symbol s}`; - if (StringSet.mem s !called_symbols || s.[0] < 'A' || s.[0] > 'Z') - && not (List.mem s data_imports) + if StringSet.mem s !called_symbols + || List.exists (match_prefix s) code_imports then `, code\n` else `, data\n` end @@ -508,8 +509,8 @@ let rec emit_instr i dslot = else ` ldo {emit_int(-n)}(%r30), %r30\n` end | Lop(Iextcall(s, alloc)) -> + call_symbol s; if alloc then begin - call_symbol s; if hpux then begin ` ldil LR'{emit_symbol s}, %r22\n`; describe_call i.arg; @@ -1037,8 +1038,7 @@ let emit_item = function | Cdouble f -> ` .double {emit_string f}\n` | Csymbol_address s -> - if hpux && String.length s >= 5 && String.sub s 0 5 = "caml_" then - ` .import {emit_symbol s}, code\n`; + use_symbol s; ` .long {emit_symbol s}\n` | Clabel_address lbl -> ` .long {emit_label(lbl + 100000)}\n` diff --git a/asmcomp/hppa/proc.ml b/asmcomp/hppa/proc.ml index a0485fdd5..e525ae907 100644 --- a/asmcomp/hppa/proc.ml +++ b/asmcomp/hppa/proc.ml @@ -217,7 +217,7 @@ let contains_calls = ref false (* Calling the assembler *) let assemble_file infile outfile = - Ccomp.command ("gas -o " ^ Filename.quote outfile ^ " " ^ Filename.quote infile) + Ccomp.command ("as -o " ^ Filename.quote outfile ^ " " ^ Filename.quote infile) open Clflags;; open Config;; diff --git a/asmrun/Makefile b/asmrun/Makefile index 720e3cfbf..b8034bab4 100644 --- a/asmrun/Makefile +++ b/asmrun/Makefile @@ -150,13 +150,6 @@ LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \ clean:: rm -f $(LINKEDFILES) -# For HPUX, we can't use gcc as ASPP because it may have been configured with -# the vendor's assembler -hppa.o: hppa.S - gcc -traditional -E -DSYS_$(SYSTEM) -o hppa.s hppa.S - gas -o hppa.o hppa.s || { rm -f hppa.s; exit 2; } - rm -f hppa.s - .SUFFIXES: .S .d.o .p.o .S.o: |