Refresh patches
authorStephane Glondu <steph@glondu.net>
Wed, 15 Jun 2011 16:24:24 +0000 (18:24 +0200)
committerStephane Glondu <steph@glondu.net>
Thu, 16 Jun 2011 06:33:28 +0000 (08:33 +0200)
17 files changed:
debian/patches/0001-Pass-no-relax-to-ld-on-alpha.patch
debian/patches/0002-Call-ld-with-proper-flags.patch
debian/patches/0003-Don-t-use-rpath.patch
debian/patches/0004-Put-manpages-in-section-3o-instead-of-3.patch
debian/patches/0005-Patch-config.sh-for-installation.patch
debian/patches/0007-Fix-ocamlopt-w.r.t.-binutils-2.21.patch [deleted file]
debian/patches/0007-Natdynlink-works-on-powerpc-and-hurd-i386.patch [new file with mode: 0644]
debian/patches/0008-Declare-primitive-name-table-as-const-char.patch [new file with mode: 0644]
debian/patches/0008-Natdynlink-works-on-powerpc-and-hurd-i386.patch [deleted file]
debian/patches/0009-Avoid-multiple-declarations-in-generated-.c-files-in.patch [new file with mode: 0644]
debian/patches/0009-Declare-primitive-name-table-as-const-char.patch [deleted file]
debian/patches/0010-Avoid-multiple-declarations-in-generated-.c-files-in.patch [deleted file]
debian/patches/0010-Properly-initialize-executable-name-in-caml_startup_.patch [new file with mode: 0644]
debian/patches/0011-Embed-bytecode-in-C-object-when-using-custom.patch
debian/patches/0012-Properly-initialize-executable-name-in-caml_startup_.patch [deleted file]
debian/patches/0013-Force-aligned-access-for-double-and-int64-on-mips.patch [deleted file]
debian/patches/series

index c9f4359b4e5bee89c8b6c0e649c800e56c9cfaff..02f44e3534308c0b4afabec6143cb2a9562c3c39 100644 (file)
@@ -9,7 +9,7 @@ code (bug#338437)
  1 files changed, 3 insertions(+), 1 deletions(-)
 
 diff --git a/configure b/configure
-index 66ccda9..2b40fc2 100755
+index 37d46c2..fa96ef8 100755
 --- a/configure
 +++ b/configure
 @@ -284,7 +284,8 @@ case "$bytecc,$host" in
@@ -22,7 +22,7 @@ index 66ccda9..2b40fc2 100755
    cc,mips-*-irix6*)
      # Add -n32 flag to ensure compatibility with native-code compiler
      bytecccompopts="-n32"
-@@ -731,6 +732,7 @@ case "$arch,$nativecc,$system,$host_type" in
+@@ -738,6 +739,7 @@ case "$arch,$nativecc,$system,$host_type" in
                         nativecccompopts="$gcc_warnings -DSHRINKED_GNUC";;
    *,*,rhapsody,*)      nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs"
                         if $arch64; then partialld="ld -r -arch ppc64"; fi;;
index 42f477a1461dae81bd0733c2d6e18eb94732c672..b32b90903f498761c5ec59b60f627c2a0dcf18fb 100644 (file)
@@ -10,10 +10,10 @@ gcc.
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/configure b/configure
-index 2b40fc2..7a34621 100755
+index fa96ef8..40a78cb 100755
 --- a/configure
 +++ b/configure
-@@ -1632,7 +1632,7 @@ echo "DEBUGGER=$debugger" >> Makefile
+@@ -1639,7 +1639,7 @@ echo "DEBUGGER=$debugger" >> Makefile
  echo "CC_PROFILE=$cc_profile" >> Makefile
  echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile
  echo "PARTIALLD=$partialld" >> Makefile
index 1442816c6fef46e312a5ae164ceb7279d52c3c4e..83a5f556868438bf8e6df41b464ac51590afaaaa 100644 (file)
@@ -7,7 +7,7 @@ Subject: Don't use rpath
  1 files changed, 5 insertions(+), 0 deletions(-)
 
 diff --git a/tools/ocamlmklib.mlp b/tools/ocamlmklib.mlp
-index 6b78a68..95f5674 100644
+index 8374439..b8d9e33 100644
 --- a/tools/ocamlmklib.mlp
 +++ b/tools/ocamlmklib.mlp
 @@ -37,6 +37,11 @@ and output_c = ref ""       (* Output name for C part of library *)
index 14f758b68dbe5fbd552263b61baed52747dc2cbc..7231e227d086e0f86110e580a01fdf0e907ea6ee 100644 (file)
@@ -7,10 +7,10 @@ Subject: Put manpages in section 3o instead of 3
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile
-index 2d8b0ea..30684ee 100644
+index 8f6e87c..ace934c 100644
 --- a/ocamldoc/Makefile
 +++ b/ocamldoc/Makefile
-@@ -319,7 +319,7 @@ test_texi: dummy
+@@ -318,7 +318,7 @@ test_texi: dummy
  stdlib_man/Pervasives.3o: $(STDLIB_MLIS)
        $(MKDIR) stdlib_man
        $(OCAMLDOC_RUN) -man -d stdlib_man $(INCLUDES) \
index 3308a867b27ec43f65890af75eb0372f60f1f7cf..809ffcba279d54c6538411712aa30faee42421f6 100644 (file)
@@ -9,7 +9,7 @@ Use for installatation a patched config.sh (created by debian/rules).
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/build/install.sh b/build/install.sh
-index a7ab103..b42373d 100755
+index 2785932..e8a6c15 100755
 --- a/build/install.sh
 +++ b/build/install.sh
 @@ -18,7 +18,7 @@ set -e
diff --git a/debian/patches/0007-Fix-ocamlopt-w.r.t.-binutils-2.21.patch b/debian/patches/0007-Fix-ocamlopt-w.r.t.-binutils-2.21.patch
deleted file mode 100644 (file)
index 76d382b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Tue, 8 Mar 2011 21:17:40 +0100
-Subject: Fix ocamlopt w.r.t. binutils 2.21
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Bug: http://caml.inria.fr/mantis/view.php?id=5237
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=617404
-Authors: Eric Cooper, spiralvoice
-Reviewed-by: Stéphane Glondu <steph@glondu.net>
----
- asmcomp/amd64/emit.mlp |   13 +++++++------
- asmcomp/i386/emit.mlp  |    6 +++---
- 2 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp
-index 55da47b..45afbb7 100644
---- a/asmcomp/amd64/emit.mlp
-+++ b/asmcomp/amd64/emit.mlp
-@@ -688,17 +688,18 @@ let fundecl fundecl =
-   emit_all true fundecl.fun_body;
-   List.iter emit_call_gc !call_gc_sites;
-   emit_call_bound_errors ();
-+  begin match Config.system with
-+    "linux" | "gnu" ->
-+      `       .type   {emit_symbol fundecl.fun_name},@function\n`;
-+      `       .size   {emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
-+    | _ -> ()
-+  end;
-   if !float_constants <> [] then begin
-     if macosx
-     then `    .literal8\n`
-     else `    .section        .rodata.cst8,\"a\",@progbits\n`;
-     List.iter emit_float_constant !float_constants
--  end;
--  match Config.system with
--    "linux" | "gnu" ->
--      `       .type   {emit_symbol fundecl.fun_name},@function\n`;
--      `       .size   {emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
--  | _ -> ()
-+  end
- (* Emission of data *)
-diff --git a/asmcomp/i386/emit.mlp b/asmcomp/i386/emit.mlp
-index 3baba2e..b29f365 100644
---- a/asmcomp/i386/emit.mlp
-+++ b/asmcomp/i386/emit.mlp
-@@ -905,12 +905,12 @@ let fundecl fundecl =
-   emit_all true fundecl.fun_body;
-   List.iter emit_call_gc !call_gc_sites;
-   emit_call_bound_errors ();
--  List.iter emit_float_constant !float_constants;
--  match Config.system with
-+  begin match Config.system with
-     "linux_elf" | "bsd_elf" | "gnu" ->
-       `       .type   {emit_symbol fundecl.fun_name},@function\n`;
-       `       .size   {emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
--  | _ -> ()
-+  | _ -> () end;
-+  List.iter emit_float_constant !float_constants
- (* Emission of data *)
--- 
diff --git a/debian/patches/0007-Natdynlink-works-on-powerpc-and-hurd-i386.patch b/debian/patches/0007-Natdynlink-works-on-powerpc-and-hurd-i386.patch
new file mode 100644 (file)
index 0000000..ec90bbd
--- /dev/null
@@ -0,0 +1,36 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Sat, 16 Apr 2011 23:41:23 +0200
+Subject: Natdynlink works on powerpc and hurd-i386
+
+Rationale: ssreflect used to work with natdynlink on powerpc and hurd
+with ocaml 3.11.2 / coq 8.2...
+
+Note: there is no native compiler for powerpc64! This must be a
+typo...
+
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ configure |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/configure b/configure
+index 40a78cb..dbad12d 100755
+--- a/configure
++++ b/configure
+@@ -620,13 +620,14 @@ if test $withsharedlibs = "yes"; then
+   case "$host" in
+     *-*-cygwin*)                  natdynlink=true;;
+     i[3456]86-*-linux*)           natdynlink=true;;
++    i[3456]86-*-gnu*)             natdynlink=true;;
+     x86_64-*-linux*)              natdynlink=true;;
+     i[3456]86-*-darwin10.*)
+       if test $arch64 == true; then
+         natdynlink=true
+       fi;;
+     i[3456]86-*-darwin[89]*)      natdynlink=true;;
+-    powerpc64-*-linux*)           natdynlink=true;;
++    powerpc-*-linux*)             natdynlink=true;;
+     sparc-*-linux*)               natdynlink=true;;
+     i686-*-kfreebsd*)             natdynlink=true;;
+     x86_64-*-kfreebsd*)           natdynlink=true;;
+-- 
diff --git a/debian/patches/0008-Declare-primitive-name-table-as-const-char.patch b/debian/patches/0008-Declare-primitive-name-table-as-const-char.patch
new file mode 100644 (file)
index 0000000..aaf1aa3
--- /dev/null
@@ -0,0 +1,25 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Thu, 21 Apr 2011 18:39:57 +0200
+Subject: Declare primitive name table as const char *
+
+This avoids lots of warnings when compiling with g++...
+
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ bytecomp/symtable.ml |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bytecomp/symtable.ml b/bytecomp/symtable.ml
+index d6ecc94..37def29 100644
+--- a/bytecomp/symtable.ml
++++ b/bytecomp/symtable.ml
+@@ -123,7 +123,7 @@ let output_primitive_table outchan =
+     fprintf outchan "  %s,\n" prim.(i)
+   done;
+   fprintf outchan "  (primitive) 0 };\n";
+-  fprintf outchan "char * caml_names_of_builtin_cprim[] = {\n";
++  fprintf outchan "const char * caml_names_of_builtin_cprim[] = {\n";
+   for i = 0 to Array.length prim - 1 do
+     fprintf outchan "  \"%s\",\n" prim.(i)
+   done;
+-- 
diff --git a/debian/patches/0008-Natdynlink-works-on-powerpc-and-hurd-i386.patch b/debian/patches/0008-Natdynlink-works-on-powerpc-and-hurd-i386.patch
deleted file mode 100644 (file)
index 6b28f40..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Sat, 16 Apr 2011 23:41:23 +0200
-Subject: Natdynlink works on powerpc and hurd-i386
-
-Rationale: ssreflect used to work with natdynlink on powerpc and hurd
-with ocaml 3.11.2 / coq 8.2...
-
-Note: there is no native compiler for powerpc64! This must be a
-typo...
-
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- configure |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
-
-diff --git a/configure b/configure
-index 7a34621..32e8d2e 100755
---- a/configure
-+++ b/configure
-@@ -619,13 +619,14 @@ if test $withsharedlibs = "yes"; then
-   case "$host" in
-     *-*-cygwin*)                  natdynlink=true;;
-     i[3456]86-*-linux*)           natdynlink=true;;
-+    i[3456]86-*-gnu*)             natdynlink=true;;
-     x86_64-*-linux*)              natdynlink=true;;
-     i[3456]86-*-darwin10.*)
-       if test $arch64 == true; then
-         natdynlink=true
-       fi;;
-     i[3456]86-*-darwin[89]*)      natdynlink=true;;
--    powerpc64-*-linux*)           natdynlink=true;;
-+    powerpc-*-linux*)             natdynlink=true;;
-     sparc-*-linux*)               natdynlink=true;;
-     i686-*-kfreebsd*)             natdynlink=true;;
-     x86_64-*-kfreebsd*)           natdynlink=true;;
--- 
diff --git a/debian/patches/0009-Avoid-multiple-declarations-in-generated-.c-files-in.patch b/debian/patches/0009-Avoid-multiple-declarations-in-generated-.c-files-in.patch
new file mode 100644 (file)
index 0000000..8e2f73b
--- /dev/null
@@ -0,0 +1,100 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Thu, 21 Apr 2011 18:39:31 +0200
+Subject: Avoid multiple declarations in generated .c files in -output-obj
+
+In -output-obj mode, <caml/mlvalues.h> (which contains some
+primitives) is included in the generated .c file, leading to errors
+when compiling with g++ (multiple declarations).
+
+There are probably better implementations (in particular, in this one,
+care must be taken when changing the list of primitives available in
+mlvalues.h), but this is a small and (not too) intrusive patch.
+
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ bytecomp/bytelink.ml  |   17 +++++++++++++++--
+ bytecomp/symtable.ml  |    8 +++++---
+ bytecomp/symtable.mli |    2 +-
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
+index bd8f3b2..9d62fc6 100644
+--- a/bytecomp/bytelink.ml
++++ b/bytecomp/bytelink.ml
+@@ -400,6 +400,19 @@ let output_cds_file outfile =
+     remove_file outfile;
+     raise x
++(* List of primitives declared in caml/mlvalues.h, to avoid duplicate
++   declarations in generated .c files *)
++
++let mlvalues_primitives = [
++  "caml_get_public_method";
++  "caml_hash_variant";
++  "caml_string_length";
++  "caml_Double_val";
++  "caml_Store_double_val";
++  "caml_Int64_val";
++  "caml_atom_table";
++]
++
+ (* Output a bytecode executable as a C file *)
+ let link_bytecode_as_c tolink outfile =
+@@ -442,7 +455,7 @@ let link_bytecode_as_c tolink outfile =
+       (Marshal.to_string sections []);
+     output_string outchan "\n};\n\n";
+     (* The table of primitives *)
+-    Symtable.output_primitive_table outchan;
++    Symtable.output_primitive_table outchan mlvalues_primitives;
+     (* The entry point *)
+     output_string outchan "\
+ \nvoid caml_startup(char ** argv)\
+@@ -516,7 +529,7 @@ let link objfiles output_name =
+         #else\n\
+         typedef long value;\n\
+         #endif\n";
+-      Symtable.output_primitive_table poc;
++      Symtable.output_primitive_table poc [];
+       output_string poc "\
+         #ifdef __cplusplus\n\
+         }\n\
+diff --git a/bytecomp/symtable.ml b/bytecomp/symtable.ml
+index 37def29..70958ee 100644
+--- a/bytecomp/symtable.ml
++++ b/bytecomp/symtable.ml
+@@ -112,15 +112,17 @@ let output_primitive_names outchan =
+ open Printf
+-let output_primitive_table outchan =
++let output_primitive_table outchan blacklist =
+   let prim = all_primitives() in
+   for i = 0 to Array.length prim - 1 do
+-    fprintf outchan "extern value %s();\n" prim.(i)
++    let p = prim.(i) in
++    if not (List.mem p blacklist) then
++      fprintf outchan "extern value %s();\n" p
+   done;
+   fprintf outchan "typedef value (*primitive)();\n";
+   fprintf outchan "primitive caml_builtin_cprim[] = {\n";
+   for i = 0 to Array.length prim - 1 do
+-    fprintf outchan "  %s,\n" prim.(i)
++    fprintf outchan "  (primitive)%s,\n" prim.(i)
+   done;
+   fprintf outchan "  (primitive) 0 };\n";
+   fprintf outchan "const char * caml_names_of_builtin_cprim[] = {\n";
+diff --git a/bytecomp/symtable.mli b/bytecomp/symtable.mli
+index 2b1583f..316381e 100644
+--- a/bytecomp/symtable.mli
++++ b/bytecomp/symtable.mli
+@@ -24,7 +24,7 @@ val require_primitive: string -> unit
+ val initial_global_table: unit -> Obj.t array
+ val output_global_map: out_channel -> unit
+ val output_primitive_names: out_channel -> unit
+-val output_primitive_table: out_channel -> unit
++val output_primitive_table: out_channel -> string list -> unit
+ val data_global_map: unit -> Obj.t
+ val data_primitive_names: unit -> string
+-- 
diff --git a/debian/patches/0009-Declare-primitive-name-table-as-const-char.patch b/debian/patches/0009-Declare-primitive-name-table-as-const-char.patch
deleted file mode 100644 (file)
index aaf1aa3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Thu, 21 Apr 2011 18:39:57 +0200
-Subject: Declare primitive name table as const char *
-
-This avoids lots of warnings when compiling with g++...
-
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- bytecomp/symtable.ml |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/bytecomp/symtable.ml b/bytecomp/symtable.ml
-index d6ecc94..37def29 100644
---- a/bytecomp/symtable.ml
-+++ b/bytecomp/symtable.ml
-@@ -123,7 +123,7 @@ let output_primitive_table outchan =
-     fprintf outchan "  %s,\n" prim.(i)
-   done;
-   fprintf outchan "  (primitive) 0 };\n";
--  fprintf outchan "char * caml_names_of_builtin_cprim[] = {\n";
-+  fprintf outchan "const char * caml_names_of_builtin_cprim[] = {\n";
-   for i = 0 to Array.length prim - 1 do
-     fprintf outchan "  \"%s\",\n" prim.(i)
-   done;
--- 
diff --git a/debian/patches/0010-Avoid-multiple-declarations-in-generated-.c-files-in.patch b/debian/patches/0010-Avoid-multiple-declarations-in-generated-.c-files-in.patch
deleted file mode 100644 (file)
index 5543fcb..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Thu, 21 Apr 2011 18:39:31 +0200
-Subject: Avoid multiple declarations in generated .c files in -output-obj
-
-In -output-obj mode, <caml/mlvalues.h> (which contains some
-primitives) is included in the generated .c file, leading to errors
-when compiling with g++ (multiple declarations).
-
-There are probably better implementations (in particular, in this one,
-care must be taken when changing the list of primitives available in
-mlvalues.h), but this is a small and (not too) intrusive patch.
-
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- bytecomp/bytelink.ml  |   17 +++++++++++++++--
- bytecomp/symtable.ml  |    8 +++++---
- bytecomp/symtable.mli |    2 +-
- 3 files changed, 21 insertions(+), 6 deletions(-)
-
-diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
-index 4a6426d..47903c4 100644
---- a/bytecomp/bytelink.ml
-+++ b/bytecomp/bytelink.ml
-@@ -400,6 +400,19 @@ let output_cds_file outfile =
-     remove_file outfile;
-     raise x
-+(* List of primitives declared in caml/mlvalues.h, to avoid duplicate
-+   declarations in generated .c files *)
-+
-+let mlvalues_primitives = [
-+  "caml_get_public_method";
-+  "caml_hash_variant";
-+  "caml_string_length";
-+  "caml_Double_val";
-+  "caml_Store_double_val";
-+  "caml_Int64_val";
-+  "caml_atom_table";
-+]
-+
- (* Output a bytecode executable as a C file *)
- let link_bytecode_as_c tolink outfile =
-@@ -442,7 +455,7 @@ CAMLextern void caml_startup_code(\n\
-       (Marshal.to_string sections []);
-     output_string outchan "\n};\n\n";
-     (* The table of primitives *)
--    Symtable.output_primitive_table outchan;
-+    Symtable.output_primitive_table outchan mlvalues_primitives;
-     (* The entry point *)
-     output_string outchan "\n\
- void caml_startup(char ** argv)\n\
-@@ -516,7 +529,7 @@ let link objfiles output_name =
-         #else\n\
-         typedef long value;\n\
-         #endif\n";
--      Symtable.output_primitive_table poc;
-+      Symtable.output_primitive_table poc [];
-       output_string poc "\
-         #ifdef __cplusplus\n\
-         }\n\
-diff --git a/bytecomp/symtable.ml b/bytecomp/symtable.ml
-index 37def29..70958ee 100644
---- a/bytecomp/symtable.ml
-+++ b/bytecomp/symtable.ml
-@@ -112,15 +112,17 @@ let output_primitive_names outchan =
- open Printf
--let output_primitive_table outchan =
-+let output_primitive_table outchan blacklist =
-   let prim = all_primitives() in
-   for i = 0 to Array.length prim - 1 do
--    fprintf outchan "extern value %s();\n" prim.(i)
-+    let p = prim.(i) in
-+    if not (List.mem p blacklist) then
-+      fprintf outchan "extern value %s();\n" p
-   done;
-   fprintf outchan "typedef value (*primitive)();\n";
-   fprintf outchan "primitive caml_builtin_cprim[] = {\n";
-   for i = 0 to Array.length prim - 1 do
--    fprintf outchan "  %s,\n" prim.(i)
-+    fprintf outchan "  (primitive)%s,\n" prim.(i)
-   done;
-   fprintf outchan "  (primitive) 0 };\n";
-   fprintf outchan "const char * caml_names_of_builtin_cprim[] = {\n";
-diff --git a/bytecomp/symtable.mli b/bytecomp/symtable.mli
-index 2b1583f..316381e 100644
---- a/bytecomp/symtable.mli
-+++ b/bytecomp/symtable.mli
-@@ -24,7 +24,7 @@ val require_primitive: string -> unit
- val initial_global_table: unit -> Obj.t array
- val output_global_map: out_channel -> unit
- val output_primitive_names: out_channel -> unit
--val output_primitive_table: out_channel -> unit
-+val output_primitive_table: out_channel -> string list -> unit
- val data_global_map: unit -> Obj.t
- val data_primitive_names: unit -> string
--- 
diff --git a/debian/patches/0010-Properly-initialize-executable-name-in-caml_startup_.patch b/debian/patches/0010-Properly-initialize-executable-name-in-caml_startup_.patch
new file mode 100644 (file)
index 0000000..f44e1e2
--- /dev/null
@@ -0,0 +1,47 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Tue, 24 May 2011 12:16:20 +0200
+Subject: Properly initialize executable name in caml_startup_code
+
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627756
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ byterun/startup.c |   11 ++++++++++-
+ 1 files changed, 10 insertions(+), 1 deletions(-)
+
+diff --git a/byterun/startup.c b/byterun/startup.c
+index db273b2..780cb1e 100644
+--- a/byterun/startup.c
++++ b/byterun/startup.c
+@@ -443,6 +443,10 @@ CAMLexport void caml_startup_code(
+ {
+   value res;
+   char* cds_file;
++  char * exe_name;
++#ifdef __linux__
++  static char proc_self_exe[256];
++#endif
+   caml_init_ieee_floats();
+   caml_init_custom_operations();
+@@ -455,6 +459,11 @@ CAMLexport void caml_startup_code(
+     strcpy(caml_cds_file, cds_file);
+   }
+   parse_camlrunparam();
++  exe_name = argv[0];
++#ifdef __linux__
++  if (caml_executable_name(proc_self_exe, sizeof(proc_self_exe)) == 0)
++    exe_name = proc_self_exe;
++#endif
+   caml_external_raise = NULL;
+   /* Initialize the abstract machine */
+   caml_init_gc (minor_heap_init, heap_size_init, heap_chunk_init,
+@@ -489,7 +498,7 @@ CAMLexport void caml_startup_code(
+   caml_section_table_size = section_table_size;
+   /* Initialize system libraries */
+   caml_init_exceptions();
+-  caml_sys_init("", argv);
++  caml_sys_init(exe_name, argv);
+   /* Execute the program */
+   caml_debugger(PROGRAM_START);
+   res = caml_interprete(caml_start_code, caml_code_size);
+-- 
index 8552379c5934f8cc597f64f5b34d0e1751b1f1da..3f17f1d5dd331172d874be167609e020bf32aece 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Stephane Glondu <steph@glondu.net>
  1 files changed, 32 insertions(+), 4 deletions(-)
 
 diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
-index 47903c4..e63dd3b 100644
+index 9d62fc6..a3aee28 100644
 --- a/bytecomp/bytelink.ml
 +++ b/bytecomp/bytelink.ml
 @@ -415,7 +415,7 @@ let mlvalues_primitives = [
@@ -27,36 +27,36 @@ index 47903c4..e63dd3b 100644
    let outchan = open_out outfile in
    begin try
      (* The bytecode *)
-@@ -457,14 +457,27 @@ CAMLextern void caml_startup_code(\n\
+@@ -457,14 +457,27 @@ let link_bytecode_as_c tolink outfile =
      (* The table of primitives *)
      Symtable.output_primitive_table outchan mlvalues_primitives;
      (* The entry point *)
--    output_string outchan "\n\
+-    output_string outchan "\
 +    if with_main then begin
-+      output_string outchan "\n\
-+int main(int argc, char **argv)\n\
-+{\n\
-+  caml_startup_code(caml_code, sizeof(caml_code),\n\
-+                    caml_data, sizeof(caml_data),\n\
-+                    caml_sections, sizeof(caml_sections),\n\
-+                    argv);\n\
-+  return 0; /* not reached */\n\
-+}\n"
++      output_string outchan "\
++\nint main(int argc, char **argv)\
++\n{\
++\n  caml_startup_code(caml_code, sizeof(caml_code),\
++\n                    caml_data, sizeof(caml_data),\
++\n                    caml_sections, sizeof(caml_sections),\
++\n                    argv);\
++\n  return 0; /* not reached */\
++\n}\n"
 +    end else begin
-+      output_string outchan "\n\
void caml_startup(char ** argv)\n\
{\n\
  caml_startup_code(caml_code, sizeof(caml_code),\n\
                    caml_data, sizeof(caml_data),\n\
                    caml_sections, sizeof(caml_sections),\n\
                    argv);\n\
--}\n\
-+}\n"
++      output_string outchan "\
\nvoid caml_startup(char ** argv)\
\n{\
\n  caml_startup_code(caml_code, sizeof(caml_code),\
\n                    caml_data, sizeof(caml_data),\
\n                    caml_sections, sizeof(caml_sections),\
\n                    argv);\
+-\n}\
++\n}\n"
 +    end;
 +    output_string outchan "\
#ifdef __cplusplus\n\
}\n\
- #endif\n";
\n#ifdef __cplusplus\
\n}\
\n#endif\n";
 @@ -501,6 +514,11 @@ let fix_exec_name name =
        if String.contains name '.' then name else name ^ ".exe"
    | _ -> name
diff --git a/debian/patches/0012-Properly-initialize-executable-name-in-caml_startup_.patch b/debian/patches/0012-Properly-initialize-executable-name-in-caml_startup_.patch
deleted file mode 100644 (file)
index 2106754..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Tue, 24 May 2011 12:16:20 +0200
-Subject: Properly initialize executable name in caml_startup_code
-
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627756
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- byterun/startup.c |   11 ++++++++++-
- 1 files changed, 10 insertions(+), 1 deletions(-)
-
-diff --git a/byterun/startup.c b/byterun/startup.c
-index 57cbb73..9fe288c 100644
---- a/byterun/startup.c
-+++ b/byterun/startup.c
-@@ -443,6 +443,10 @@ CAMLexport void caml_startup_code(
- {
-   value res;
-   char* cds_file;
-+  char * exe_name;
-+#ifdef __linux__
-+  static char proc_self_exe[256];
-+#endif
-   caml_init_ieee_floats();
-   caml_init_custom_operations();
-@@ -455,6 +459,11 @@ CAMLexport void caml_startup_code(
-     strcpy(caml_cds_file, cds_file);
-   }
-   parse_camlrunparam();
-+  exe_name = argv[0];
-+#ifdef __linux__
-+  if (caml_executable_name(proc_self_exe, sizeof(proc_self_exe)) == 0)
-+    exe_name = proc_self_exe;
-+#endif
-   caml_external_raise = NULL;
-   /* Initialize the abstract machine */
-   caml_init_gc (minor_heap_init, heap_size_init, heap_chunk_init,
-@@ -489,7 +498,7 @@ CAMLexport void caml_startup_code(
-   caml_section_table_size = section_table_size;
-   /* Initialize system libraries */
-   caml_init_exceptions();
--  caml_sys_init("", argv);
-+  caml_sys_init(exe_name, argv);
-   /* Execute the program */
-   caml_debugger(PROGRAM_START);
-   res = caml_interprete(caml_start_code, caml_code_size);
--- 
diff --git a/debian/patches/0013-Force-aligned-access-for-double-and-int64-on-mips.patch b/debian/patches/0013-Force-aligned-access-for-double-and-int64-on-mips.patch
deleted file mode 100644 (file)
index 35e8097..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Sat, 28 May 2011 23:55:08 +0200
-Subject: Force aligned access for double and int64 on mips*
-
-Some mips machines accept unaligned accesses, others don't. Therefore,
-do not rely on auto-detection.
-
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- configure |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure b/configure
-index 32e8d2e..e03a4b8 100755
---- a/configure
-+++ b/configure
-@@ -434,7 +434,7 @@ esac
- # Determine alignment constraints
- case "$host" in
--  sparc*-*-*|hppa*-*-*|arm*-*-*)
-+  sparc*-*-*|hppa*-*-*|arm*-*-*|mips*-*-*)
-     # On Sparc V9 with certain versions of gcc, determination of double
-     # alignment is not reliable (PR#1521), hence force it.
-     # Same goes for hppa.
-@@ -467,7 +467,7 @@ esac
- if $int64_native; then
-   case "$host" in
-     # PR#5088: autodetection is unreliable on ARM
--    sparc*-*-*|hppa*-*-*|arm*-*-*)
-+    sparc*-*-*|hppa*-*-*|arm*-*-*|mips*-*-*)
-       if test $2 = 8; then
-         echo "64-bit integers can be word-aligned."
-         echo "#undef ARCH_ALIGN_INT64" >> m.h
--- 
index fa726e690f2b84e0fde4db3303540ef497d5b6b9..43d48de2c0c44050745a81407658be91b8d9c3c4 100644 (file)
@@ -4,10 +4,8 @@
 0004-Put-manpages-in-section-3o-instead-of-3.patch
 0005-Patch-config.sh-for-installation.patch
 0006-Install-ocamlbuild-as-a-link-on-either-.native-or-.b.patch
-0007-Fix-ocamlopt-w.r.t.-binutils-2.21.patch
-0008-Natdynlink-works-on-powerpc-and-hurd-i386.patch
-0009-Declare-primitive-name-table-as-const-char.patch
-0010-Avoid-multiple-declarations-in-generated-.c-files-in.patch
+0007-Natdynlink-works-on-powerpc-and-hurd-i386.patch
+0008-Declare-primitive-name-table-as-const-char.patch
+0009-Avoid-multiple-declarations-in-generated-.c-files-in.patch
+0010-Properly-initialize-executable-name-in-caml_startup_.patch
 0011-Embed-bytecode-in-C-object-when-using-custom.patch
-0012-Properly-initialize-executable-name-in-caml_startup_.patch
-0013-Force-aligned-access-for-double-and-int64-on-mips.patch