You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Machine- and OS-dependent handling of stack overflow */
#ifdef HAS_STACK_OVERFLOW_DETECTION
diff -Nurab ocaml-3.06.orig/asmrun/sparc.S ocaml-3.06/asmrun/sparc.S
--- ocaml-3.06.orig/asmrun/sparc.S 2002-02-08 16:55:33.000000000 +0000
+++ ocaml-3.06/asmrun/sparc.S 2003-07-09 06:27:55.000000000 +0100
@@ -16,9 +16,9 @@
/* Asm part of the runtime system for the Sparc processor. /
/ Must be preprocessed by cpp */
-/* SunOS 4 and BSD prefix identifiers with _, Solaris and Linux do not /
+/ SunOS 4 prefixes identifiers with _ */
Original bug ID: 1746
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
I made the attached changes to ocaml-3.0.6 to support the
native code compilers on NetBSD PowerPC and SPARC (ELF).
The changes have been fully tested.
Regards,
Jason
diff -Nurab ocaml-3.06.orig/asmcomp/power/arch.ml ocaml-3.06/asmcomp/power/arch.ml
--- ocaml-3.06.orig/asmcomp/power/arch.ml 2002-07-22 17:37:53.000000000 +0100
+++ ocaml-3.06/asmcomp/power/arch.ml 2003-07-09 06:27:55.000000000 +0100
@@ -91,6 +91,5 @@
let toc =
match Config.system with
| "aix" -> true
| _ -> Misc.fatal_error "wrong $(SYSTEM)"
diff -Nurab ocaml-3.06.orig/asmcomp/power/emit.mlp ocaml-3.06/asmcomp/power/emit.mlp
--- ocaml-3.06.orig/asmcomp/power/emit.mlp 2002-07-22 17:37:53.000000000 +0100
+++ ocaml-3.06/asmcomp/power/emit.mlp 2003-07-09 06:27:55.000000000 +0100
@@ -65,7 +65,7 @@
let emit_symbol =
match Config.system with
| "rhapsody" -> (fun s -> emit_char '_'; Emitaux.emit_symbol '$' s)
| _ -> assert false
@@ -78,7 +78,7 @@
let label_prefix =
match Config.system with
"aix" -> "L.."
| "rhapsody" -> "L"
| _ -> assert false
@@ -90,21 +90,21 @@
let data_space =
match Config.system with
"aix" -> " .csect .data[RW]\n"
| "rhapsody" -> " .data\n"
| _ -> assert false
let code_space =
match Config.system with
"aix" -> " .csect .text[PR]\n"
| "rhapsody" -> " .text\n"
| _ -> assert false
let rodata_space =
match Config.system with
"aix" -> " .csect .data[RW]\n" (* ?? *)
| "rhapsody" -> " .const\n"
| _ -> assert false
@@ -157,7 +157,7 @@
let emit_upper emit_fun arg =
match Config.system with
emit_fun arg; emit_string "@ha"
| "rhapsody" ->
emit_string "ha16("; emit_fun arg; emit_string ")"
@@ -165,7 +165,7 @@
let emit_lower emit_fun arg =
match Config.system with
emit_fun arg; emit_string "@l"
| "rhapsody" ->
emit_string "lo16("; emit_fun arg; emit_string ")"
@@ -951,7 +951,7 @@
.csect {emit_symbol fundecl.fun_name}[DS]\n
;{emit_symbol fundecl.fun_name}:\n
;.long .{emit_symbol fundecl.fun_name}, TOC[tc0], 0\n
.type {emit_symbol fundecl.fun_name}, @function\n
| _ -> ()
end;
@@ -996,7 +996,7 @@
let declare_global_data s =
.globl {emit_symbol s}\n
;.type {emit_symbol s}, @object\n
let emit_item = function
diff -Nurab ocaml-3.06.orig/asmcomp/power/proc.ml ocaml-3.06/asmcomp/power/proc.ml
--- ocaml-3.06.orig/asmcomp/power/proc.ml 2002-07-22 17:37:54.000000000 +0100
+++ ocaml-3.06/asmcomp/power/proc.ml 2003-07-09 06:27:55.000000000 +0100
@@ -190,7 +190,7 @@
let loc_external_arguments =
match Config.system with
"aix" | "rhapsody" -> poweropen_external_conventions 0 7 100 112
| _ -> assert false
let extcall_use_push = false
@@ -244,7 +244,7 @@
Ccomp.command ("as -u -m " ^ proc ^ " -o " ^ outfile ^ " " ^ infile)
| "elf" ->
Ccomp.command ("as -u -m ppc -o " ^ outfile ^ " " ^ infile)
Ccomp.command ("as -o " ^ outfile ^ " " ^ infile)
| _ -> assert false
diff -Nurab ocaml-3.06.orig/asmcomp/sparc/emit.mlp ocaml-3.06/asmcomp/sparc/emit.mlp
--- ocaml-3.06.orig/asmcomp/sparc/emit.mlp 2002-07-22 17:37:55.000000000 +0100
+++ ocaml-3.06/asmcomp/sparc/emit.mlp 2003-07-09 06:27:55.000000000 +0100
@@ -57,11 +57,10 @@
| {loc = Reg r; typ = Float} -> phys_reg (r + 16)
| _ -> fatal_error "Emit.next_in_pair"
-(* Symbols are prefixed with _ under SunOS and BSD but not under Solaris
+( Symbols are prefixed with _ under SunOS *)
let symbol_prefix =
let emit_symbol s =
if String.length s >= 1 & s.[0] = '.'
@@ -79,7 +78,7 @@
(* Output a label *)
let label_prefix =
let emit_label lbl =
emit_string label_prefix; emit_int lbl
diff -Nurab ocaml-3.06.orig/asmrun/signals.c ocaml-3.06/asmrun/signals.c
--- ocaml-3.06.orig/asmrun/signals.c 2002-05-06 13:02:26.000000000 +0100
+++ ocaml-3.06/asmrun/signals.c 2003-07-09 06:27:55.000000000 +0100
@@ -162,6 +162,8 @@
void handle_signal(int sig, struct sigcontext * context)
#elif defined(TARGET_power) && defined(SYS_rhapsody)
void handle_signal(int sig, int code, struct sigcontext * context)
+#elif defined(TARGET_power) && defined(SYS_bsd)
+void handle_signal(int sig, int code, struct sigcontext * context)
#else
void handle_signal(int sig)
#endif
@@ -205,6 +207,10 @@
/* Cached in register 30 */
CONTEXT_GPR(context, 30) = (unsigned long) young_limit;
#endif
+#if defined(TARGET_power) && defined(SYS_bsd)
+#endif
}
}
}
@@ -443,6 +449,17 @@
}
#endif
+#if defined(TARGET_power) && defined(SYS_bsd)
+static void trap_handler(int sig, int code, struct sigcontext * context)
+{
+}
+#endif
/* Machine- and OS-dependent handling of stack overflow */
#ifdef HAS_STACK_OVERFLOW_DETECTION
diff -Nurab ocaml-3.06.orig/asmrun/sparc.S ocaml-3.06/asmrun/sparc.S
--- ocaml-3.06.orig/asmrun/sparc.S 2002-02-08 16:55:33.000000000 +0000
+++ ocaml-3.06/asmrun/sparc.S 2003-07-09 06:27:55.000000000 +0100
@@ -16,9 +16,9 @@
/* Asm part of the runtime system for the Sparc processor. /
/ Must be preprocessed by cpp */
-/* SunOS 4 and BSD prefix identifiers with _, Solaris and Linux do not /
+/ SunOS 4 prefixes identifiers with _ */
-#if defined(SYS_sunos) || defined(SYS_bsd)
+#if defined(SYS_sunos)
diff -Nurab ocaml-3.06.orig/configure ocaml-3.06/configure
--- ocaml-3.06.orig/configure 2002-08-07 13:45:00.000000000 +0100
+++ ocaml-3.06/configure 2003-07-09 06:27:55.000000000 +0100
@@ -528,6 +528,7 @@
rs6000--aix) arch=power; model=rs6000; system=aix;;
powerpc--aix) arch=power; model=ppc; system=aix;;
powerpc--linux) arch=power; model=ppc; system=elf;;
powerpc--rhapsody) arch=power; model=ppc; system=rhapsody;;
powerpc--darwin) arch=power; model=ppc; system=rhapsody;;
arm*--linux) arch=arm; system=linux;;
@@ -591,6 +592,7 @@
power,rs6000,aix) asflags='-u -m pwr -w'; asppflags="$asflags";;
power,ppc,aix) asflags='-u -m ppc -w'; asppflags="$asflags";;
power,*,elf) aspp='gcc'; asppflags='-c';;
power,,rhapsody) ;;
arm,,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
ia64,,linux) asflags=-xexplicit
@@ -601,6 +603,9 @@
alpha,,digital) profiling='prof';;
i386,,linux_elf) profiling='prof';;
i386,*,bsd_elf) profiling='prof';;
*) profiling='noprof';;
esac
The text was updated successfully, but these errors were encountered: