summaryrefslogtreecommitdiff
path: root/lang/ocaml
diff options
context:
space:
mode:
authorjtb <jtb@pkgsrc.org>2003-07-10 07:44:01 +0000
committerjtb <jtb@pkgsrc.org>2003-07-10 07:44:01 +0000
commitce3fe082f3be8a2d2712affc8e83956f3456fa46 (patch)
treefe4cbda589b9f899d44aa5d4f8305646cf6003ca /lang/ocaml
parent66df543718af20e8d4130fbd4a0173a063453457 (diff)
downloadpkgsrc-ce3fe082f3be8a2d2712affc8e83956f3456fa46.tar.gz
* Add support for the profiler on powerpc
* Fix i386 profiling. NetBSD calls __mcount while FreeBSD calls .mcount
Diffstat (limited to 'lang/ocaml')
-rw-r--r--lang/ocaml/distinfo9
-rw-r--r--lang/ocaml/patches/patch-ad6
-rw-r--r--lang/ocaml/patches/patch-ah42
-rw-r--r--lang/ocaml/patches/patch-aj102
-rw-r--r--lang/ocaml/patches/patch-ak13
-rw-r--r--lang/ocaml/patches/patch-al13
6 files changed, 175 insertions, 10 deletions
diff --git a/lang/ocaml/distinfo b/lang/ocaml/distinfo
index de889e86786..78780dccb74 100644
--- a/lang/ocaml/distinfo
+++ b/lang/ocaml/distinfo
@@ -1,13 +1,16 @@
-$NetBSD: distinfo,v 1.9 2003/06/29 23:04:18 jtb Exp $
+$NetBSD: distinfo,v 1.10 2003/07/10 07:44:01 jtb Exp $
SHA1 (ocaml-3.06.tar.gz) = cf1b053bf751ad566e445ca13c620ffef3a1b863
Size (ocaml-3.06.tar.gz) = 2436887 bytes
SHA1 (patch-aa) = 9e3eedb855d3a3830f58979caee0af48b5b8e670
SHA1 (patch-ab) = 8ebe2173abe3202205e16d31f29c8ded3df485cd
SHA1 (patch-ac) = 536768b353d9016140bdc66cc0293537cc4444e0
-SHA1 (patch-ad) = 2b15416e51298ff45bd29b51cc718cad6839b292
+SHA1 (patch-ad) = e9d32fe1ee760610c92348b560a79bce1c7e099a
SHA1 (patch-ae) = 4e2905ecb57e1e1a4c8b3799b5a3e5dd37ead7ec
SHA1 (patch-af) = eeb03f9ceac69ab36542f2725392789b7cecd48c
SHA1 (patch-ag) = 8f67b8c13a0b008e3b77eb6f15fce1cac4f43d32
-SHA1 (patch-ah) = 6787283c29a7243686e11be67478f62b2d3d28dc
+SHA1 (patch-ah) = 792709f05174590853dad8267afd3c8f1a4e4981
SHA1 (patch-ai) = 5b3a27cbe5c7dcebc6899859b24ebe2bd0248862
+SHA1 (patch-aj) = b4ae592a113f10102737df1d114120ec78aa5742
+SHA1 (patch-ak) = cd5a93e7530f6864ee6f591f9f7ba5722428408c
+SHA1 (patch-al) = 97cad6e699ef1e973973c1ebc27b441a52fd1b78
diff --git a/lang/ocaml/patches/patch-ad b/lang/ocaml/patches/patch-ad
index ebb6e813248..212d49dea92 100644
--- a/lang/ocaml/patches/patch-ad
+++ b/lang/ocaml/patches/patch-ad
@@ -1,4 +1,4 @@
-$NetBSD: patch-ad,v 1.2 2003/06/29 23:04:19 jtb Exp $
+$NetBSD: patch-ad,v 1.3 2003/07/10 07:44:02 jtb Exp $
--- configure.orig
+++ configure
@@ -18,13 +18,11 @@ $NetBSD: patch-ad,v 1.2 2003/06/29 23:04:19 jtb Exp $
power,*,rhapsody) ;;
arm,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
ia64,*,linux) asflags=-xexplicit
-@@ -601,6 +603,9 @@
+@@ -601,6 +603,7 @@
alpha,*,digital) profiling='prof';;
i386,*,linux_elf) profiling='prof';;
i386,*,bsd_elf) profiling='prof';;
+ power,*,bsd) profiling='prof';;
-+ power,*,elf) profiling='prof';;
-+ sparc,*,bsd) profiling='prof';;
*) profiling='noprof';;
esac
diff --git a/lang/ocaml/patches/patch-ah b/lang/ocaml/patches/patch-ah
index bd94f03d8cf..d921617afe0 100644
--- a/lang/ocaml/patches/patch-ah
+++ b/lang/ocaml/patches/patch-ah
@@ -1,4 +1,4 @@
-$NetBSD: patch-ah,v 1.1 2003/06/29 23:04:19 jtb Exp $
+$NetBSD: patch-ah,v 1.2 2003/07/10 07:44:02 jtb Exp $
--- asmcomp/power/emit.mlp.orig
+++ asmcomp/power/emit.mlp
@@ -63,7 +63,39 @@ $NetBSD: patch-ah,v 1.1 2003/06/29 23:04:19 jtb Exp $
emit_fun arg; emit_string "@l"
| "rhapsody" ->
emit_string "lo16("; emit_fun arg; emit_string ")"
-@@ -951,7 +951,7 @@
+@@ -935,6 +935,31 @@
+ 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`;
++ ` stw 1, 0(3)\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 +976,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`
@@ -72,7 +104,11 @@ $NetBSD: patch-ah,v 1.1 2003/06/29 23:04:19 jtb Exp $
` .type {emit_symbol fundecl.fun_name}, @function\n`
| _ -> ()
end;
-@@ -996,7 +996,7 @@
++ if !Clflags.gprofile then emit_profile();
+ emit_string code_space;
+ ` .align 2\n`;
+ `{emit_codesymbol fundecl.fun_name}:\n`;
+@@ -996,7 +1022,7 @@
let declare_global_data s =
` .globl {emit_symbol s}\n`;
diff --git a/lang/ocaml/patches/patch-aj b/lang/ocaml/patches/patch-aj
new file mode 100644
index 00000000000..48276b27f0d
--- /dev/null
+++ b/lang/ocaml/patches/patch-aj
@@ -0,0 +1,102 @@
+$NetBSD: patch-aj,v 1.1 2003/07/10 07:44:02 jtb Exp $
+
+--- asmrun/power-bsd.S.orig
++++ asmrun/power-bsd.S
+@@ -13,6 +13,36 @@
+
+ /* $Id: patch-aj,v 1.1 2003/07/10 07:44:02 jtb Exp $ */
+
++#if defined(PROFILING)
++#define PROFILE_CAML \
++ stwu 1, -32(1) \
++ stw 1, 0(3) \
++ mflr 0 \
++ stw 0, 4(1) \
++ stw 2, 8(1) \
++ stw 3, 12(1) \
++ stw 4, 16(1) \
++ stw 5, 20(1) \
++ stw 6, 24(1) \
++ stw 7, 28(1) \
++ bl _mcount \
++ lwz 2, 8(1) \
++ lwz 3, 12(1) \
++ lwz 4, 16(1) \
++ lwz 5, 20(1) \
++ lwz 6, 24(1) \
++ lwz 7, 28(1) \
++ addic 1, 1, 32
++
++#define PROFILE_C \
++ mflr 0 \
++ stw 0, 4(1) \
++ bl _mcount
++#else
++#define PROFILE_CAML
++#define PROFILE_C
++#endif
++
+ #define Addrglobal(reg,glob) \
+ addis reg, 0, glob@ha; \
+ addi reg, reg, glob@l
+@@ -30,6 +60,7 @@
+ .globl caml_call_gc
+ .type caml_call_gc, @function
+ caml_call_gc:
++ PROFILE_CAML
+ /* Set up stack frame */
+ stwu 1, -0x1A0(1)
+ /* 0x1A0 = 4*32 (int regs) + 8*32 (float regs) + 32 (space for C call) */
+@@ -182,6 +213,7 @@
+ .globl caml_c_call
+ .type caml_c_call, @function
+ caml_c_call:
++ PROFILE_CAML
+ /* Save return address */
+ mflr 25
+ /* Get ready to call C function (address in 11) */
+@@ -210,6 +242,7 @@
+ .globl raise_caml_exception
+ .type raise_caml_exception, @function
+ raise_caml_exception:
++ PROFILE_C
+ /* Reload Caml global registers */
+ Loadglobal(1, caml_exception_pointer, 11)
+ Loadglobal(31, young_ptr, 11)
+@@ -230,6 +263,7 @@
+ .globl caml_start_program
+ .type caml_start_program, @function
+ caml_start_program:
++ PROFILE_C
+ Addrglobal(12, caml_program)
+
+ /* Code shared between caml_start_program and callback */
+@@ -380,6 +414,7 @@
+ .globl callback_exn
+ .type callback_exn, @function
+ callback_exn:
++ PROFILE_C
+ /* Initial shuffling of arguments */
+ mr 0, 3 /* Closure */
+ mr 3, 4 /* Argument */
+@@ -390,6 +425,7 @@
+ .globl callback2_exn
+ .type callback2_exn, @function
+ callback2_exn:
++ PROFILE_C
+ mr 0, 3 /* Closure */
+ mr 3, 4 /* First argument */
+ mr 4, 5 /* Second argument */
+@@ -400,6 +436,7 @@
+ .globl callback3_exn
+ .type callback3_exn, @function
+ callback3_exn:
++ PROFILE_C
+ mr 0, 3 /* Closure */
+ mr 3, 4 /* First argument */
+ mr 4, 5 /* Second argument */
+@@ -418,4 +455,3 @@
+ .long .L105 + 4 /* return address into callback */
+ .short -1 /* negative size count => use callback link */
+ .short 0 /* no roots here */
+-
diff --git a/lang/ocaml/patches/patch-ak b/lang/ocaml/patches/patch-ak
new file mode 100644
index 00000000000..a3395b5159e
--- /dev/null
+++ b/lang/ocaml/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1 2003/07/10 07:44:02 jtb Exp $
+
+--- asmcomp/i386/emit.mlp.orig
++++ asmcomp/i386/emit.mlp
+@@ -734,7 +734,7 @@
+ ` movl %esp, %ebp\n`;
+ ` pushl %ecx\n`;
+ ` pushl %edx\n`;
+- ` call .mcount\n`;
++ ` call __mcount\n`;
+ ` popl %edx\n`;
+ ` popl %ecx\n`;
+ ` popl %eax\n`
diff --git a/lang/ocaml/patches/patch-al b/lang/ocaml/patches/patch-al
new file mode 100644
index 00000000000..d47223f5639
--- /dev/null
+++ b/lang/ocaml/patches/patch-al
@@ -0,0 +1,13 @@
+$NetBSD: patch-al,v 1.1 2003/07/10 07:44:02 jtb Exp $
+
+--- asmrun/i386.S.orig
++++ asmrun/i386.S
+@@ -53,7 +53,7 @@
+ #elif defined(SYS_bsd_elf)
+ #define PROFILE_CAML \
+ pushl %ebp; movl %esp, %ebp; pushl %eax; pushl %ecx; pushl %edx; \
+- call .mcount; \
++ call __mcount; \
+ popl %edx; popl %ecx; popl %eax; popl %ebp
+ #define PROFILE_C \
+ pushl %ebp; movl %esp, %ebp; call .mcount; popl %ebp