pkgsrc/lang/ocaml/patches/patch-ac
tron 65fe8e9b94 Fix various issues with this package:
- split patches files
- always enable threading which has various advantages
  - it fixes the build of the Tk library
  - it greatly simplifies the package list handling
  - it provides threading support under NetBSD 1.6/1.6.x
- correct default dependence in "buildlink2.mk" to "build"
Bump package revision because of all these changes.
2004-04-22 09:18:34 +00:00

118 lines
3.1 KiB
Text

$NetBSD: patch-ac,v 1.3 2004/04/22 09:18:36 tron Exp $
--- asmcomp/power/emit.mlp.orig Mon Jul 22 18:37:53 2002
+++ asmcomp/power/emit.mlp Thu Apr 22 10:34:38 2004
@@ -65,7 +65,7 @@
let emit_symbol =
match Config.system with
- "aix" | "elf" -> (fun s -> Emitaux.emit_symbol '.' s)
+ "aix" | "elf" | "bsd" -> (fun s -> Emitaux.emit_symbol '.' s)
| "rhapsody" -> (fun s -> emit_char '_'; Emitaux.emit_symbol '$' s)
| _ -> assert false
@@ -78,7 +78,7 @@
let label_prefix =
match Config.system with
"aix" -> "L.."
- | "elf" -> ".L"
+ | "elf" | "bsd" -> ".L"
| "rhapsody" -> "L"
| _ -> assert false
@@ -90,21 +90,21 @@
let data_space =
match Config.system with
"aix" -> " .csect .data[RW]\n"
- | "elf" -> " .section \".data\"\n"
+ | "elf" | "bsd" -> " .section \".data\"\n"
| "rhapsody" -> " .data\n"
| _ -> assert false
let code_space =
match Config.system with
"aix" -> " .csect .text[PR]\n"
- | "elf" -> " .section \".text\"\n"
+ | "elf" | "bsd" -> " .section \".text\"\n"
| "rhapsody" -> " .text\n"
| _ -> assert false
let rodata_space =
match Config.system with
"aix" -> " .csect .data[RW]\n" (* ?? *)
- | "elf" -> " .section \".rodata\"\n"
+ | "elf" | "bsd" -> " .section \".rodata\"\n"
| "rhapsody" -> " .const\n"
| _ -> assert false
@@ -157,7 +157,7 @@
let emit_upper emit_fun arg =
match Config.system with
- "elf" ->
+ "elf" | "bsd" ->
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
- "elf" ->
+ "elf" | "bsd" ->
emit_fun arg; emit_string "@l"
| "rhapsody" ->
emit_string "lo16("; emit_fun arg; emit_string ")"
@@ -935,6 +935,30 @@
emit_instr i None;
emit_all i.next
+(* Emission of the profiling prelude *)
+
+let emit_profile () =
+ match Config.system with
+ "bsd" ->
+ ` stwu 1, -32(1)\n`;
+ ` mflr 0\n`;
+ ` stw 0, 4(1)\n`;
+ ` stw 2, 8(1)\n`;
+ ` stw 3, 12(1)\n`;
+ ` stw 4, 16(1)\n`;
+ ` stw 5, 20(1)\n`;
+ ` stw 6, 24(1)\n`;
+ ` stw 7, 28(1)\n`;
+ ` bl {emit_symbol "_mcount"}\n`;
+ ` lwz 2, 8(1)\n`;
+ ` lwz 3, 12(1)\n`;
+ ` lwz 4, 16(1)\n`;
+ ` lwz 5, 20(1)\n`;
+ ` lwz 6, 24(1)\n`;
+ ` lwz 7, 28(1)\n`;
+ ` addic 1, 1, 32\n`;
+ | _ -> () (*unsupported yet*)
+
(* Emission of a function declaration *)
let fundecl fundecl =
@@ -951,10 +975,11 @@
` .csect {emit_symbol fundecl.fun_name}[DS]\n`;
`{emit_symbol fundecl.fun_name}:\n`;
` .long .{emit_symbol fundecl.fun_name}, TOC[tc0], 0\n`
- | "elf" ->
+ | "elf" | "bsd" ->
` .type {emit_symbol fundecl.fun_name}, @function\n`
| _ -> ()
end;
+ if !Clflags.gprofile then emit_profile();
emit_string code_space;
` .align 2\n`;
`{emit_codesymbol fundecl.fun_name}:\n`;
@@ -996,7 +1021,7 @@
let declare_global_data s =
` .globl {emit_symbol s}\n`;
- if Config.system = "elf" then
+ if Config.system = "elf" || Config.system = "bsd" then
` .type {emit_symbol s}, @object\n`
let emit_item = function