1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
-index 07b1c35..0b0554f 100755
+index 3edb9fd..406b19b 100755
--- a/configure
+++ b/configure
-@@ -304,7 +304,8 @@ case "$bytecc,$host" in
- gcc,alpha*-*-linux*)
+@@ -355,7 +355,8 @@ case "$bytecc,$target" in
+ *gcc*,alpha*-*-linux*)
if cc="$bytecc" sh ./hasgot -mieee; then
bytecccompopts="-mieee $bytecccompopts";
- fi;;
cc,mips-*-irix6*)
# Add -n32 flag to ensure compatibility with native-code compiler
bytecccompopts="-n32"
-@@ -746,6 +747,7 @@ case "$arch,$nativecc,$system,$host_type" in
+@@ -872,6 +873,7 @@ case "$arch,$nativecc,$system,$target" in
nativecccompopts="$gcc_warnings -DSHRINKED_GNUC";;
*,*,rhapsody,*) nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs"
if $arch64; then partialld="ld -r -arch ppc64"; fi;;
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
-index 0b0554f..1294fad 100755
+index 406b19b..726e144 100755
--- a/configure
+++ b/configure
-@@ -1655,7 +1655,7 @@ echo "DEBUGGER=$debugger" >> Makefile
+@@ -1696,7 +1696,7 @@ echo "OTHERLIBRARIES=$otherlibraries" >> Makefile
echo "CC_PROFILE=$cc_profile" >> Makefile
echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile
echo "PARTIALLD=$partialld" >> Makefile
Subject: Don't use rpath
---
- tools/ocamlmklib.mlp | 5 +++++
+ tools/ocamlmklib.ml | 5 +++++
1 file changed, 5 insertions(+)
-diff --git a/tools/ocamlmklib.mlp b/tools/ocamlmklib.mlp
-index 9a47d1b..729145f 100644
---- a/tools/ocamlmklib.mlp
-+++ b/tools/ocamlmklib.mlp
+diff --git a/tools/ocamlmklib.ml b/tools/ocamlmklib.ml
+index 77ae57b..4fdb391 100644
+--- a/tools/ocamlmklib.ml
++++ b/tools/ocamlmklib.ml
@@ -37,6 +37,11 @@ and output_c = ref "" (* Output name for C part of library *)
and rpath = ref [] (* rpath options *)
and verbose = ref false
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile
-index 144b95d..4d4f3f2 100644
+index 7a487c6..a6b11c4 100644
--- a/ocamldoc/Makefile
+++ b/ocamldoc/Makefile
-@@ -345,7 +345,7 @@ test_texi: dummy
+@@ -312,7 +312,7 @@ test_texi: dummy
stdlib_man/Pervasives.3o: $(STDLIB_MLIS)
$(MKDIR) stdlib_man
$(OCAMLDOC_RUN) -man -d stdlib_man $(INCLUDES) \
+ -t "OCaml library" -man-mini -man-section 3o \
$(STDLIB_MLIS)
- autotest_stdlib: dummy
+ stdlib_html/Pervasives.html: $(STDLIB_MLIS)
--
--- /dev/null
+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.
+
+Bug: http://caml.inria.fr/mantis/view.php?id=5254
+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 c0f8f6a..778df01 100644
+--- a/bytecomp/bytelink.ml
++++ b/bytecomp/bytelink.ml
+@@ -431,6 +431,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 ppf tolink outfile =
+@@ -473,7 +486,7 @@ let link_bytecode_as_c ppf 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)\
+@@ -554,7 +567,7 @@ let link ppf 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 1cc3a53..397fc25 100644
+--- a/bytecomp/symtable.ml
++++ b/bytecomp/symtable.ml
+@@ -113,15 +113,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 ffc878b..887f25a 100644
+--- a/bytecomp/symtable.mli
++++ b/bytecomp/symtable.mli
+@@ -23,7 +23,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
+
+--
+++ /dev/null
-From: Ralf Treinen <treinen@debian.org>
-Date: Tue, 19 May 2009 17:28:09 +0200
-Subject: Patch config.sh for installation
-
-Use for installatation a patched config.sh (created by debian/rules).
----
- build/install.sh | 2 +-
- build/partial-install.sh | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/build/install.sh b/build/install.sh
-index d092d66..d80a158 100755
---- a/build/install.sh
-+++ b/build/install.sh
-@@ -16,7 +16,7 @@ set -e
-
- cd `dirname $0`/..
-
--. config/config.sh
-+. config/config.debian.install.sh
-
- not_installed=$PWD/_build/not_installed
-
-diff --git a/build/partial-install.sh b/build/partial-install.sh
-index c06154a..42c3558 100755
---- a/build/partial-install.sh
-+++ b/build/partial-install.sh
-@@ -20,7 +20,7 @@ set -e
-
- cd `dirname $0`/..
-
--. config/config.sh
-+. config/config.debian.install.sh
-
- not_installed=$PWD/_build/not_installed
-
---
--- /dev/null
+From: Stephane Glondu <steph@glondu.net>
+Date: Sat, 21 Jul 2012 15:40:52 +0200
+Subject: Embed bytecode in C object when using -custom
+
+This patch fixes non-strippability of bytecode executables linked with
+custom runtime. The new behaviour is enabled when OCAML_CUSTOM_EMBED
+is set to "y", or when DEB_HOST_ARCH is non-empty.
+
+Forwarded: not-needed
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627761
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678577
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ bytecomp/bytelink.ml | 42 ++++++++++++++++++++++++---
+ testsuite/tests/basic-manyargs/Makefile | 3 ++
+ testsuite/tests/callback/Makefile | 3 ++
+ testsuite/tests/embedded/Makefile | 4 +++
+ testsuite/tests/gc-roots/Makefile | 3 ++
+ testsuite/tests/lib-dynlink-bytecode/Makefile | 3 ++
+ testsuite/tests/lib-marshal/Makefile | 3 ++
+ 7 files changed, 57 insertions(+), 4 deletions(-)
+
+diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
+index 778df01..5fcbcfe 100644
+--- a/bytecomp/bytelink.ml
++++ b/bytecomp/bytelink.ml
+@@ -446,7 +446,7 @@ let mlvalues_primitives = [
+
+ (* Output a bytecode executable as a C file *)
+
+-let link_bytecode_as_c ppf tolink outfile =
++let link_bytecode_as_c ppf tolink outfile with_main =
+ let outchan = open_out outfile in
+ begin try
+ (* The bytecode *)
+@@ -488,14 +488,27 @@ let link_bytecode_as_c ppf tolink outfile =
+ (* The table of primitives *)
+ Symtable.output_primitive_table outchan mlvalues_primitives;
+ (* The entry point *)
+- output_string outchan "\
++ if with_main then begin
++ 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 "\
+ \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 "\
+ \n#ifdef __cplusplus\
+ \n}\
+ \n#endif\n";
+@@ -534,6 +547,17 @@ let fix_exec_name name =
+ if String.contains name '.' then name else name ^ ".exe"
+ | _ -> name
+
++(* Debian-specific -custom behaviour:
++ - if DEB_HOST_ARCH is non-empty, it is activated by default
++ - can be enabled/disabled by setting OCAML_CUSTOM_EMBED to y/n
++*)
++
++let custom_embed =
++ try Sys.getenv "OCAML_CUSTOM_EMBED" = "y"
++ with Not_found ->
++ try Sys.getenv "DEB_HOST_ARCH" <> ""
++ with Not_found -> false
++
+ (* Main entry point (build a custom runtime if needed) *)
+
+ let link ppf objfiles output_name =
+@@ -548,6 +572,16 @@ let link ppf objfiles output_name =
+ Clflags.dllibs := !lib_dllibs @ !Clflags.dllibs; (* put user's DLLs first *)
+ if not !Clflags.custom_runtime then
+ link_bytecode ppf tolink output_name true
++ else if custom_embed && not !Clflags.output_c_object && not !Clflags.make_runtime then
++ let c_file = Filename.temp_file "camlobj" ".c" in
++ try
++ link_bytecode_as_c ppf tolink c_file true;
++ let exec_name = fix_exec_name output_name in
++ if not (build_custom_runtime c_file exec_name)
++ then raise(Error Custom_runtime);
++ with x ->
++ remove_file c_file;
++ raise x
+ else if not !Clflags.output_c_object then begin
+ let bytecode_name = Filename.temp_file "camlcode" "" in
+ let prim_name = Filename.temp_file "camlprim" ".c" in
+@@ -590,7 +624,7 @@ let link ppf objfiles output_name =
+ if Sys.file_exists c_file then raise(Error(File_exists c_file));
+ let temps = ref [] in
+ try
+- link_bytecode_as_c ppf tolink c_file;
++ link_bytecode_as_c ppf tolink c_file false;
+ if not (Filename.check_suffix output_name ".c") then begin
+ temps := c_file :: !temps;
+ if Ccomp.compile_file c_file <> 0 then raise(Error Custom_runtime);
+diff --git a/testsuite/tests/basic-manyargs/Makefile b/testsuite/tests/basic-manyargs/Makefile
+index 3cf4a15..d1ad48c 100644
+--- a/testsuite/tests/basic-manyargs/Makefile
++++ b/testsuite/tests/basic-manyargs/Makefile
+@@ -15,5 +15,8 @@ BASEDIR=../..
+ MAIN_MODULE=manyargs
+ C_FILES=manyargsprim
+
++# This test relies on the upstream behaviour of -custom
++export OCAML_CUSTOM_EMBED=n
++
+ include $(BASEDIR)/makefiles/Makefile.one
+ include $(BASEDIR)/makefiles/Makefile.common
+diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile
+index 58b5ed8..48d8796 100644
+--- a/testsuite/tests/callback/Makefile
++++ b/testsuite/tests/callback/Makefile
+@@ -16,6 +16,9 @@ CC=$(NATIVECC) -I $(CTOPDIR)/byterun
+ COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix
+ LD_PATH=$(TOPDIR)/otherlibs/unix
+
++# This test relies on the upstream behaviour of -custom
++export OCAML_CUSTOM_EMBED=n
++
+ .PHONY: default
+ default:
+ @case " $(OTHERLIBRARIES) " in \
+diff --git a/testsuite/tests/embedded/Makefile b/testsuite/tests/embedded/Makefile
+index a8de4dc..b72581f 100644
+--- a/testsuite/tests/embedded/Makefile
++++ b/testsuite/tests/embedded/Makefile
+@@ -13,6 +13,10 @@
+ BASEDIR=../..
+
+ .PHONY: default
++
++# This test relies on the upstream behaviour of -custom
++export OCAML_CUSTOM_EMBED=n
++
+ default:
+ $(MAKE) compile
+ $(MAKE) run
+diff --git a/testsuite/tests/gc-roots/Makefile b/testsuite/tests/gc-roots/Makefile
+index a108953..9c1ff43 100644
+--- a/testsuite/tests/gc-roots/Makefile
++++ b/testsuite/tests/gc-roots/Makefile
+@@ -16,5 +16,8 @@ MAIN_MODULE=globroots
+ C_FILES=globrootsprim
+ ADD_COMPFLAGS=-w a
+
++# This test relies on the upstream behaviour of -custom
++export OCAML_CUSTOM_EMBED=n
++
+ include $(BASEDIR)/makefiles/Makefile.one
+ include $(BASEDIR)/makefiles/Makefile.common
+diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile
+index 832e367..4653631 100644
+--- a/testsuite/tests/lib-dynlink-bytecode/Makefile
++++ b/testsuite/tests/lib-dynlink-bytecode/Makefile
+@@ -15,6 +15,9 @@ BASEDIR=../..
+ COMPFLAGS=-I $(OTOPDIR)/otherlibs/dynlink
+ LD_PATH=.:$(TOPDIR)/otherlibs/dynlink
+
++# This test relies on the upstream behaviour of -custom
++export OCAML_CUSTOM_EMBED=n
++
+ .PHONY: default
+ default:
+ @if ! $(SUPPORTS_SHARED_LIBRARIES); then \
+diff --git a/testsuite/tests/lib-marshal/Makefile b/testsuite/tests/lib-marshal/Makefile
+index 34b67dc..e8928e6 100644
+--- a/testsuite/tests/lib-marshal/Makefile
++++ b/testsuite/tests/lib-marshal/Makefile
+@@ -15,5 +15,8 @@ BASEDIR=../..
+ MAIN_MODULE=intext
+ C_FILES=intextaux
+
++# This test relies on the upstream behaviour of -custom
++export OCAML_CUSTOM_EMBED=n
++
+ include $(BASEDIR)/makefiles/Makefile.one
+ include $(BASEDIR)/makefiles/Makefile.common
+--
+++ /dev/null
-From: Stefano Zacchiroli <zack@debian.org>
-Date: Tue, 19 May 2009 17:28:56 +0200
-Subject: Install ocamlbuild as a link on either .native or .byte
-
----
- build/partial-install.sh | 17 ++++++++++++++++-
- 1 file changed, 16 insertions(+), 1 deletion(-)
-
-diff --git a/build/partial-install.sh b/build/partial-install.sh
-index 42c3558..96d21de 100755
---- a/build/partial-install.sh
-+++ b/build/partial-install.sh
-@@ -58,6 +58,21 @@ installbestbin() {
- [ -x "$3" ] || chmod +x "$3"
- }
-
-+installbestlink() {
-+ if [ -f "$1" ]; then
-+ echo " linking binary $3 to `basename $1`"
-+ ln -fs "$1" "$3"
-+ else
-+ if [ -f "$2" ]; then
-+ echo " linking binary $3 to `basename $2`"
-+ ln -fs "$2" "$3"
-+ else
-+ echo "None of $1, $2 exists"
-+ exit 3
-+ fi
-+ fi
-+}
-+
- installlib() {
- if [ -f "$1" ]; then
- dest="$2/`basename $1`"
-@@ -156,7 +171,7 @@ echo "Installing ocamlbuild..."
- cd ocamlbuild
- installbin ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE
- installbin ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
--installbestbin ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
-+installbestlink ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
-
- installlibdir \
- ocamlbuildlib.$A \
---
+++ /dev/null
-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.
-
-Bug: http://caml.inria.fr/mantis/view.php?id=5254
-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 2098366..87a58ab 100644
---- a/bytecomp/bytelink.ml
-+++ b/bytecomp/bytelink.ml
-@@ -421,6 +421,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 ppf tolink outfile =
-@@ -463,7 +476,7 @@ let link_bytecode_as_c ppf 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)\
-@@ -544,7 +557,7 @@ let link ppf 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 63374f8..cf72528 100644
---- a/bytecomp/symtable.ml
-+++ b/bytecomp/symtable.ml
-@@ -113,15 +113,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 e3c33d2..597d012 100644
---- a/bytecomp/symtable.mli
-+++ b/bytecomp/symtable.mli
-@@ -23,7 +23,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
-
---
--- /dev/null
+From: Stephane Glondu <steph@glondu.net>
+Date: Fri, 8 Nov 2013 22:27:23 +0100
+Subject: Tune resource usage of some tests
+
+The original tests trigger some limits and fail on kfreebsd-i386 with
+uncaught exception Sys_error("Thread.create: Resource temporarily
+unavailable").
+---
+ testsuite/tests/lib-threads/sieve.ml | 2 +-
+ testsuite/tests/lib-threads/sieve.reference | 80 -------------------------
+ testsuite/tests/lib-threads/testsieve.ml | 2 +-
+ testsuite/tests/lib-threads/testsieve.reference | 70 ----------------------
+ testsuite/tests/lib-threads/token1.ml | 2 +-
+ testsuite/tests/lib-threads/token2.ml | 2 +-
+ 6 files changed, 4 insertions(+), 154 deletions(-)
+
+diff --git a/testsuite/tests/lib-threads/sieve.ml b/testsuite/tests/lib-threads/sieve.ml
+index ac3a9d2..86f0e5e 100644
+--- a/testsuite/tests/lib-threads/sieve.ml
++++ b/testsuite/tests/lib-threads/sieve.ml
+@@ -40,6 +40,6 @@ let go max =
+ in Thread.create (integers 2) ch;
+ print_primes ch max;;
+
+-let _ = go 500
++let _ = go 50
+
+ ;;
+diff --git a/testsuite/tests/lib-threads/sieve.reference b/testsuite/tests/lib-threads/sieve.reference
+index 3e7998d..6beaeaa 100644
+--- a/testsuite/tests/lib-threads/sieve.reference
++++ b/testsuite/tests/lib-threads/sieve.reference
+@@ -13,83 +13,3 @@
+ 41
+ 43
+ 47
+-53
+-59
+-61
+-67
+-71
+-73
+-79
+-83
+-89
+-97
+-101
+-103
+-107
+-109
+-113
+-127
+-131
+-137
+-139
+-149
+-151
+-157
+-163
+-167
+-173
+-179
+-181
+-191
+-193
+-197
+-199
+-211
+-223
+-227
+-229
+-233
+-239
+-241
+-251
+-257
+-263
+-269
+-271
+-277
+-281
+-283
+-293
+-307
+-311
+-313
+-317
+-331
+-337
+-347
+-349
+-353
+-359
+-367
+-373
+-379
+-383
+-389
+-397
+-401
+-409
+-419
+-421
+-431
+-433
+-439
+-443
+-449
+-457
+-461
+-463
+-467
+-479
+-487
+-491
+-499
+diff --git a/testsuite/tests/lib-threads/testsieve.ml b/testsuite/tests/lib-threads/testsieve.ml
+index 6979f80..2f11272 100644
+--- a/testsuite/tests/lib-threads/testsieve.ml
++++ b/testsuite/tests/lib-threads/testsieve.ml
+@@ -41,7 +41,7 @@ let premiers = Event.new_channel ()
+ let main _ =
+ Thread.create sieve premiers;
+ while true do
+- for i = 1 to 100 do
++ for i = 1 to 30 do
+ let n = Event.sync (Event.receive premiers) in
+ print_int n; print_newline()
+ done;
+diff --git a/testsuite/tests/lib-threads/testsieve.reference b/testsuite/tests/lib-threads/testsieve.reference
+index b6b8c06..6e97d2c 100644
+--- a/testsuite/tests/lib-threads/testsieve.reference
++++ b/testsuite/tests/lib-threads/testsieve.reference
+@@ -28,73 +28,3 @@
+ 101
+ 103
+ 107
+-109
+-113
+-127
+-131
+-137
+-139
+-149
+-151
+-157
+-163
+-167
+-173
+-179
+-181
+-191
+-193
+-197
+-199
+-211
+-223
+-227
+-229
+-233
+-239
+-241
+-251
+-257
+-263
+-269
+-271
+-277
+-281
+-283
+-293
+-307
+-311
+-313
+-317
+-331
+-337
+-347
+-349
+-353
+-359
+-367
+-373
+-379
+-383
+-389
+-397
+-401
+-409
+-419
+-421
+-431
+-433
+-439
+-443
+-449
+-457
+-461
+-463
+-467
+-479
+-487
+-491
+-499
+-503
+-509
+-521
+diff --git a/testsuite/tests/lib-threads/token1.ml b/testsuite/tests/lib-threads/token1.ml
+index d0a7528..692efba 100644
+--- a/testsuite/tests/lib-threads/token1.ml
++++ b/testsuite/tests/lib-threads/token1.ml
+@@ -37,7 +37,7 @@ let process (n, conds, nprocs) =
+ done
+
+ let main() =
+- let nprocs = try int_of_string Sys.argv.(1) with _ -> 100 in
++ let nprocs = try int_of_string Sys.argv.(1) with _ -> 30 in
+ let iter = try int_of_string Sys.argv.(2) with _ -> 1000 in
+ let conds = Array.make nprocs (Condition.create()) in
+ for i = 1 to nprocs - 1 do conds.(i) <- Condition.create() done;
+diff --git a/testsuite/tests/lib-threads/token2.ml b/testsuite/tests/lib-threads/token2.ml
+index c3548fb..177b32a 100644
+--- a/testsuite/tests/lib-threads/token2.ml
++++ b/testsuite/tests/lib-threads/token2.ml
+@@ -33,7 +33,7 @@ let process (n, ins, outs, nprocs) =
+ done
+
+ let main() =
+- let nprocs = try int_of_string Sys.argv.(1) with _ -> 100 in
++ let nprocs = try int_of_string Sys.argv.(1) with _ -> 30 in
+ let iter = try int_of_string Sys.argv.(2) with _ -> 1000 in
+ let ins = Array.make nprocs Unix.stdin in
+ let outs = Array.make nprocs Unix.stdout in
+--
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Sat, 21 Jul 2012 15:40:52 +0200
-Subject: Embed bytecode in C object when using -custom
-
-This patch fixes non-strippability of bytecode executables linked with
-custom runtime. The new behaviour is enabled when OCAML_CUSTOM_EMBED
-is set to "y", or when DEB_HOST_ARCH is non-empty.
-
-Forwarded: not-needed
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627761
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678577
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- bytecomp/bytelink.ml | 42 ++++++++++++++++++++++++---
- testsuite/tests/basic-manyargs/Makefile | 3 ++
- testsuite/tests/callback/Makefile | 3 ++
- testsuite/tests/embedded/Makefile | 4 +++
- testsuite/tests/gc-roots/Makefile | 3 ++
- testsuite/tests/lib-dynlink-bytecode/Makefile | 3 ++
- testsuite/tests/lib-marshal/Makefile | 3 ++
- 7 files changed, 57 insertions(+), 4 deletions(-)
-
-diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
-index 87a58ab..72678fa 100644
---- a/bytecomp/bytelink.ml
-+++ b/bytecomp/bytelink.ml
-@@ -436,7 +436,7 @@ let mlvalues_primitives = [
-
- (* Output a bytecode executable as a C file *)
-
--let link_bytecode_as_c ppf tolink outfile =
-+let link_bytecode_as_c ppf tolink outfile with_main =
- let outchan = open_out outfile in
- begin try
- (* The bytecode *)
-@@ -478,14 +478,27 @@ let link_bytecode_as_c ppf tolink outfile =
- (* The table of primitives *)
- Symtable.output_primitive_table outchan mlvalues_primitives;
- (* The entry point *)
-- output_string outchan "\
-+ if with_main then begin
-+ 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 "\
- \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 "\
- \n#ifdef __cplusplus\
- \n}\
- \n#endif\n";
-@@ -524,6 +537,17 @@ let fix_exec_name name =
- if String.contains name '.' then name else name ^ ".exe"
- | _ -> name
-
-+(* Debian-specific -custom behaviour:
-+ - if DEB_HOST_ARCH is non-empty, it is activated by default
-+ - can be enabled/disabled by setting OCAML_CUSTOM_EMBED to y/n
-+*)
-+
-+let custom_embed =
-+ try Sys.getenv "OCAML_CUSTOM_EMBED" = "y"
-+ with Not_found ->
-+ try Sys.getenv "DEB_HOST_ARCH" <> ""
-+ with Not_found -> false
-+
- (* Main entry point (build a custom runtime if needed) *)
-
- let link ppf objfiles output_name =
-@@ -538,6 +562,16 @@ let link ppf objfiles output_name =
- Clflags.dllibs := !lib_dllibs @ !Clflags.dllibs; (* put user's DLLs first *)
- if not !Clflags.custom_runtime then
- link_bytecode ppf tolink output_name true
-+ else if custom_embed && not !Clflags.output_c_object && not !Clflags.make_runtime then
-+ let c_file = Filename.temp_file "camlobj" ".c" in
-+ try
-+ link_bytecode_as_c ppf tolink c_file true;
-+ let exec_name = fix_exec_name output_name in
-+ if not (build_custom_runtime c_file exec_name)
-+ then raise(Error Custom_runtime);
-+ with x ->
-+ remove_file c_file;
-+ raise x
- else if not !Clflags.output_c_object then begin
- let bytecode_name = Filename.temp_file "camlcode" "" in
- let prim_name = Filename.temp_file "camlprim" ".c" in
-@@ -580,7 +614,7 @@ let link ppf objfiles output_name =
- if Sys.file_exists c_file then raise(Error(File_exists c_file));
- let temps = ref [] in
- try
-- link_bytecode_as_c ppf tolink c_file;
-+ link_bytecode_as_c ppf tolink c_file false;
- if not (Filename.check_suffix output_name ".c") then begin
- temps := c_file :: !temps;
- if Ccomp.compile_file c_file <> 0 then raise(Error Custom_runtime);
-diff --git a/testsuite/tests/basic-manyargs/Makefile b/testsuite/tests/basic-manyargs/Makefile
-index 3cf4a15..d1ad48c 100644
---- a/testsuite/tests/basic-manyargs/Makefile
-+++ b/testsuite/tests/basic-manyargs/Makefile
-@@ -15,5 +15,8 @@ BASEDIR=../..
- MAIN_MODULE=manyargs
- C_FILES=manyargsprim
-
-+# This test relies on the upstream behaviour of -custom
-+export OCAML_CUSTOM_EMBED=n
-+
- include $(BASEDIR)/makefiles/Makefile.one
- include $(BASEDIR)/makefiles/Makefile.common
-diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile
-index 26d02ea..2069815 100644
---- a/testsuite/tests/callback/Makefile
-+++ b/testsuite/tests/callback/Makefile
-@@ -16,6 +16,9 @@ CC=$(NATIVECC) -I $(CTOPDIR)/byterun
- COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix
- LD_PATH=$(TOPDIR)/otherlibs/unix
-
-+# This test relies on the upstream behaviour of -custom
-+export OCAML_CUSTOM_EMBED=n
-+
- .PHONY: default
- default:
- @case " $(OTHERLIBRARIES) " in \
-diff --git a/testsuite/tests/embedded/Makefile b/testsuite/tests/embedded/Makefile
-index 2a01c20..dfd999c 100644
---- a/testsuite/tests/embedded/Makefile
-+++ b/testsuite/tests/embedded/Makefile
-@@ -13,6 +13,10 @@
- BASEDIR=../..
-
- .PHONY: default
-+
-+# This test relies on the upstream behaviour of -custom
-+export OCAML_CUSTOM_EMBED=n
-+
- default: compile run
-
- .PHONY: compile
-diff --git a/testsuite/tests/gc-roots/Makefile b/testsuite/tests/gc-roots/Makefile
-index a108953..9c1ff43 100644
---- a/testsuite/tests/gc-roots/Makefile
-+++ b/testsuite/tests/gc-roots/Makefile
-@@ -16,5 +16,8 @@ MAIN_MODULE=globroots
- C_FILES=globrootsprim
- ADD_COMPFLAGS=-w a
-
-+# This test relies on the upstream behaviour of -custom
-+export OCAML_CUSTOM_EMBED=n
-+
- include $(BASEDIR)/makefiles/Makefile.one
- include $(BASEDIR)/makefiles/Makefile.common
-diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile
-index 74f27b9..14cb816 100644
---- a/testsuite/tests/lib-dynlink-bytecode/Makefile
-+++ b/testsuite/tests/lib-dynlink-bytecode/Makefile
-@@ -15,6 +15,9 @@ BASEDIR=../..
- COMPFLAGS=-I $(OTOPDIR)/otherlibs/dynlink
- LD_PATH=.:$(TOPDIR)/otherlibs/dynlink
-
-+# This test relies on the upstream behaviour of -custom
-+export OCAML_CUSTOM_EMBED=n
-+
- .PHONY: default
- default:
- @$(SET_LD_PATH) $(MAKE) compile run
-diff --git a/testsuite/tests/lib-marshal/Makefile b/testsuite/tests/lib-marshal/Makefile
-index 34b67dc..e8928e6 100644
---- a/testsuite/tests/lib-marshal/Makefile
-+++ b/testsuite/tests/lib-marshal/Makefile
-@@ -15,5 +15,8 @@ BASEDIR=../..
- MAIN_MODULE=intext
- C_FILES=intextaux
-
-+# This test relies on the upstream behaviour of -custom
-+export OCAML_CUSTOM_EMBED=n
-+
- include $(BASEDIR)/makefiles/Makefile.one
- include $(BASEDIR)/makefiles/Makefile.common
---
--- /dev/null
+From: Stephane Glondu <steph@glondu.net>
+Date: Wed, 13 Nov 2013 14:28:16 +0100
+Subject: Native backtraces don't work on powerpc and sparc
+
+---
+ testsuite/tests/backtrace/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/testsuite/tests/backtrace/Makefile b/testsuite/tests/backtrace/Makefile
+index 33ca1ed..5725f8d 100644
+--- a/testsuite/tests/backtrace/Makefile
++++ b/testsuite/tests/backtrace/Makefile
+@@ -20,7 +20,10 @@ OTHERFILESNOINLINING=backtraces_and_finalizers.ml
+
+ default:
+ $(MAKE) byte
+- @if $(BYTECODE_ONLY); then : ; else $(MAKE) native; fi
++ @case `dpkg-architecture -qDEB_BUILD_ARCH` in \
++ sparc|powerpc*) : ;; \
++ *) if $(BYTECODE_ONLY) ; then : ; else $(MAKE) native; fi ;; \
++ esac
+
+ .PHONY: byte
+ byte:
+--
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Mon, 21 Oct 2013 16:34:12 +0200
-Subject: Fix typos and other wording issues
-
-Bug: http://caml.inria.fr/mantis/view.php?id=6231
----
- man/ocaml.m | 2 +-
- man/ocamlc.m | 2 +-
- man/ocamldoc.m | 2 +-
- man/ocamlopt.m | 2 +-
- stdlib/printexc.mli | 6 +++---
- 5 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/man/ocaml.m b/man/ocaml.m
-index 39baf7b..cd3fb0d 100644
---- a/man/ocaml.m
-+++ b/man/ocaml.m
-@@ -136,7 +136,7 @@ directories searched for source and compiled files.
- .BI \-ppx \ command
- After parsing, pipe the abstract syntax tree through the preprocessor
- .IR command .
--The format of the input and ouput of the preprocessor
-+The format of the input and output of the preprocessor
- are not yet documented.
- .TP
- .B \-principal
-diff --git a/man/ocamlc.m b/man/ocamlc.m
-index fb3902a..1cdd9bd 100644
---- a/man/ocamlc.m
-+++ b/man/ocamlc.m
-@@ -478,7 +478,7 @@ implementation (.ml) file.
- .BI \-ppx \ command
- After parsing, pipe the abstract syntax tree through the preprocessor
- .IR command .
--The format of the input and ouput of the preprocessor
-+The format of the input and output of the preprocessor
- are not yet documented.
- .TP
- .B \-principal
-diff --git a/man/ocamldoc.m b/man/ocamldoc.m
-index 73ca3a6..b25833a 100644
---- a/man/ocamldoc.m
-+++ b/man/ocamldoc.m
-@@ -170,7 +170,7 @@ the comments in implementation files.
- Always keep the source code for values, methods and instance variables, when
- available. The source code is always kept when a .ml
- file is given, but is by default discarded when a .mli
--is given. This option allows to always keep the source code.
-+is given. This option allows the source code to be always kept.
- .TP
- .BI \-load \ file
- Load information from
-diff --git a/man/ocamlopt.m b/man/ocamlopt.m
-index 998651b..dea2249 100644
---- a/man/ocamlopt.m
-+++ b/man/ocamlopt.m
-@@ -431,7 +431,7 @@ errors, the intermediate file is deleted afterwards.
- .BI \-ppx \ command
- After parsing, pipe the abstract syntax tree through the preprocessor
- .IR command .
--The format of the input and ouput of the preprocessor
-+The format of the input and output of the preprocessor
- are not yet documented.
- .TP
- .B \-principal
-diff --git a/stdlib/printexc.mli b/stdlib/printexc.mli
-index 773fed8..fca086d 100644
---- a/stdlib/printexc.mli
-+++ b/stdlib/printexc.mli
-@@ -91,9 +91,9 @@ type raw_backtrace
- a low-level format, instead of directly exposing them as string as
- the [get_backtrace()] function does.
-
-- This allows to pay the performance overhead of representation
-- conversion and formatting only at printing time, which is useful
-- if you want to record more backtrace than you actually print.
-+ This allows delaying the formatting of backtraces to when they are
-+ actually printed, which might be useful if you record more
-+ backtraces than you print.
- *)
-
- val get_raw_backtrace: unit -> raw_backtrace
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Thu, 7 Nov 2013 15:45:50 +0100
-Subject: Add const qualifiers in Tcl/Tk bindings
-
-Bug: http://caml.inria.fr/mantis/view.php?id=6230
----
- otherlibs/labltk/support/camltk.h | 4 ++--
- otherlibs/labltk/support/cltkCaml.c | 2 +-
- otherlibs/labltk/support/cltkUtf.c | 8 ++++----
- 3 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/otherlibs/labltk/support/camltk.h b/otherlibs/labltk/support/camltk.h
-index 9efbbea..6ee6558 100644
---- a/otherlibs/labltk/support/camltk.h
-+++ b/otherlibs/labltk/support/camltk.h
-@@ -40,7 +40,7 @@
- extern char *string_to_c(value s);
-
- /* cltkUtf.c */
--extern value tcl_string_to_caml( char * );
-+extern value tcl_string_to_caml( CONST84 char * );
- extern char * caml_string_to_tcl( value );
-
- /* cltkEval.c */
-@@ -53,7 +53,7 @@ extern value *tkerror_exn;
- extern value *handler_code;
- extern int CamlCBCmd(ClientData clientdata, Tcl_Interp *interp,
- int argc, CONST84 char *argv[]);
--CAMLTKextern void tk_error(char * errmsg) Noreturn;
-+CAMLTKextern void tk_error(CONST84 char * errmsg) Noreturn;
-
- /* cltkMain.c */
- extern int signal_events;
-diff --git a/otherlibs/labltk/support/cltkCaml.c b/otherlibs/labltk/support/cltkCaml.c
-index 9a3d38a..5c6aae0 100644
---- a/otherlibs/labltk/support/cltkCaml.c
-+++ b/otherlibs/labltk/support/cltkCaml.c
-@@ -63,7 +63,7 @@ CAMLprim value camltk_return (value v)
- }
-
- /* Note: raise_with_string WILL copy the error message */
--CAMLprim void tk_error(char *errmsg)
-+CAMLprim void tk_error(CONST84 char *errmsg)
- {
- raise_with_string(*tkerror_exn, errmsg);
- }
-diff --git a/otherlibs/labltk/support/cltkUtf.c b/otherlibs/labltk/support/cltkUtf.c
-index 61dbfb2..faaf303 100644
---- a/otherlibs/labltk/support/cltkUtf.c
-+++ b/otherlibs/labltk/support/cltkUtf.c
-@@ -36,7 +36,7 @@
-
- #ifdef UTFCONVERSION
-
--char *external_to_utf( char *str ){
-+char *external_to_utf( CONST84 char *str ){
- char *res;
- Tcl_DString dstr;
- int length;
-@@ -50,7 +50,7 @@ char *external_to_utf( char *str ){
- return res;
- }
-
--char *utf_to_external( char *str ){
-+char *utf_to_external( CONST84 char *str ){
- char *res;
- Tcl_DString dstr;
- int length;
-@@ -69,7 +69,7 @@ char *caml_string_to_tcl( value s )
- return external_to_utf( String_val(s) );
- }
-
--value tcl_string_to_caml( char *s )
-+value tcl_string_to_caml( CONST84 char *s )
- {
- CAMLparam0();
- CAMLlocal1(res);
-@@ -84,6 +84,6 @@ value tcl_string_to_caml( char *s )
- #else
-
- char *caml_string_to_tcl(value s){ return string_to_c(s); }
--value tcl_string_to_caml(char *s){ return copy_string(s); }
-+value tcl_string_to_caml(CONST84 char *s){ return copy_string(s); }
-
- #endif
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Thu, 7 Nov 2013 16:06:57 +0100
-Subject: Enable mkstemp in yacc
-
-Use the feature test macro found in the mkstemp(3) manpage.
-
-Bug: http://caml.inria.fr/mantis/view.php?id=6232
----
- yacc/main.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/yacc/main.c b/yacc/main.c
-index f6cac60..66b63ec 100644
---- a/yacc/main.c
-+++ b/yacc/main.c
-@@ -57,6 +57,11 @@ char *verbose_file_name;
- #define HAVE_MKSTEMP
- #endif
-
-+#if _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 \
-+ || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200112L
-+#define HAVE_MKSTEMP
-+#endif
-+
- #ifdef HAVE_MKSTEMP
- int action_fd = -1, entry_fd = -1, text_fd = -1, union_fd = -1;
- #endif
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Fri, 8 Nov 2013 16:42:19 +0100
-Subject: Fix ocamlopt on sparc
-
-Bug: http://caml.inria.fr/mantis/view.php?id=6227
----
- asmcomp/interf.ml | 6 +++++-
- asmcomp/sparc/emit.mlp | 12 ++++++------
- 2 files changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/asmcomp/interf.ml b/asmcomp/interf.ml
-index 77acb78..eab8a96 100644
---- a/asmcomp/interf.ml
-+++ b/asmcomp/interf.ml
-@@ -115,13 +115,17 @@ let build_graph fundecl =
-
- (* Add a preference from one reg to another.
- Do not add anything if the two registers conflict,
-- or if the source register already has a location. *)
-+ or if the source register already has a location,
-+ or if the two registers belong to different classes.
-+ (The last case can occur e.g. on Sparc when passing
-+ float arguments in integer registers, PR#6227.) *)
-
- let add_pref weight r1 r2 =
- if weight > 0 then begin
- let i = r1.stamp and j = r2.stamp in
- if i <> j
- && r1.loc = Unknown
-+ && Proc.register_class r1 = Proc.register_class r2
- && (let p = if i < j then (i, j) else (j, i) in
- not (IntPairSet.mem p !mat))
- then r1.prefer <- (r2, weight) :: r1.prefer
-diff --git a/asmcomp/sparc/emit.mlp b/asmcomp/sparc/emit.mlp
-index b8387cd..258b2ca 100644
---- a/asmcomp/sparc/emit.mlp
-+++ b/asmcomp/sparc/emit.mlp
-@@ -64,7 +64,7 @@ let symbol_prefix =
- if Config.system = "sunos" then "_" else ""
-
- let emit_symbol s =
-- if String.length s >= 1 & s.[0] = '.'
-+ if String.length s >= 1 && s.[0] = '.'
- then emit_string s
- else begin emit_string symbol_prefix; Emitaux.emit_symbol '$' s end
-
-@@ -629,8 +629,8 @@ let is_one_instr i =
- i.arg.(0).typ <> Float && i.res.(0).typ <> Float
- | Iconst_int n -> is_native_immediate n
- | Istackoffset _ -> true
-- | Iload(_, Iindexed n) -> i.res.(0).typ <> Float & is_immediate n
-- | Istore(_, Iindexed n) -> i.arg.(0).typ <> Float & is_immediate n
-+ | Iload(_, Iindexed n) -> i.res.(0).typ <> Float && is_immediate n
-+ | Istore(_, Iindexed n) -> i.arg.(0).typ <> Float && is_immediate n
- | Iintop(op) -> is_one_instr_op op
- | Iintop_imm(op, _) -> is_one_instr_op op
- | Iaddf | Isubf | Imulf | Idivf -> true
-@@ -660,15 +660,15 @@ let rec emit_all i =
- emit_instr i.next (Some i);
- emit_all i.next.next
- | {next = {desc = Lop(Itailcall_imm s)}}
-- when s = !function_name & is_one_instr i ->
-+ when s = !function_name && is_one_instr i ->
- emit_instr i.next (Some i);
- emit_all i.next.next
- | {next = {desc = Lop(Icall_ind)}}
-- when is_one_instr i & no_interference i.res i.next.arg ->
-+ when is_one_instr i && no_interference i.res i.next.arg ->
- emit_instr i.next (Some i);
- emit_all i.next.next
- | {next = {desc = Lcondbranch(_, _)}}
-- when is_one_instr i & no_interference i.res i.next.arg ->
-+ when is_one_instr i && no_interference i.res i.next.arg ->
- emit_instr i.next (Some i);
- emit_all i.next.next
- | _ ->
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Fri, 8 Nov 2013 22:27:23 +0100
-Subject: Tune resource usage of some tests
-
-The original tests trigger some limits and fail on kfreebsd-i386 with
-uncaught exception Sys_error("Thread.create: Resource temporarily
-unavailable").
----
- testsuite/tests/lib-threads/sieve.ml | 2 +-
- testsuite/tests/lib-threads/sieve.reference | 80 -------------------------
- testsuite/tests/lib-threads/testsieve.ml | 2 +-
- testsuite/tests/lib-threads/testsieve.reference | 70 ----------------------
- testsuite/tests/lib-threads/token1.ml | 2 +-
- testsuite/tests/lib-threads/token2.ml | 2 +-
- 6 files changed, 4 insertions(+), 154 deletions(-)
-
-diff --git a/testsuite/tests/lib-threads/sieve.ml b/testsuite/tests/lib-threads/sieve.ml
-index ac3a9d2..86f0e5e 100644
---- a/testsuite/tests/lib-threads/sieve.ml
-+++ b/testsuite/tests/lib-threads/sieve.ml
-@@ -40,6 +40,6 @@ let go max =
- in Thread.create (integers 2) ch;
- print_primes ch max;;
-
--let _ = go 500
-+let _ = go 50
-
- ;;
-diff --git a/testsuite/tests/lib-threads/sieve.reference b/testsuite/tests/lib-threads/sieve.reference
-index 3e7998d..6beaeaa 100644
---- a/testsuite/tests/lib-threads/sieve.reference
-+++ b/testsuite/tests/lib-threads/sieve.reference
-@@ -13,83 +13,3 @@
- 41
- 43
- 47
--53
--59
--61
--67
--71
--73
--79
--83
--89
--97
--101
--103
--107
--109
--113
--127
--131
--137
--139
--149
--151
--157
--163
--167
--173
--179
--181
--191
--193
--197
--199
--211
--223
--227
--229
--233
--239
--241
--251
--257
--263
--269
--271
--277
--281
--283
--293
--307
--311
--313
--317
--331
--337
--347
--349
--353
--359
--367
--373
--379
--383
--389
--397
--401
--409
--419
--421
--431
--433
--439
--443
--449
--457
--461
--463
--467
--479
--487
--491
--499
-diff --git a/testsuite/tests/lib-threads/testsieve.ml b/testsuite/tests/lib-threads/testsieve.ml
-index 6979f80..2f11272 100644
---- a/testsuite/tests/lib-threads/testsieve.ml
-+++ b/testsuite/tests/lib-threads/testsieve.ml
-@@ -41,7 +41,7 @@ let premiers = Event.new_channel ()
- let main _ =
- Thread.create sieve premiers;
- while true do
-- for i = 1 to 100 do
-+ for i = 1 to 30 do
- let n = Event.sync (Event.receive premiers) in
- print_int n; print_newline()
- done;
-diff --git a/testsuite/tests/lib-threads/testsieve.reference b/testsuite/tests/lib-threads/testsieve.reference
-index b6b8c06..6e97d2c 100644
---- a/testsuite/tests/lib-threads/testsieve.reference
-+++ b/testsuite/tests/lib-threads/testsieve.reference
-@@ -28,73 +28,3 @@
- 101
- 103
- 107
--109
--113
--127
--131
--137
--139
--149
--151
--157
--163
--167
--173
--179
--181
--191
--193
--197
--199
--211
--223
--227
--229
--233
--239
--241
--251
--257
--263
--269
--271
--277
--281
--283
--293
--307
--311
--313
--317
--331
--337
--347
--349
--353
--359
--367
--373
--379
--383
--389
--397
--401
--409
--419
--421
--431
--433
--439
--443
--449
--457
--461
--463
--467
--479
--487
--491
--499
--503
--509
--521
-diff --git a/testsuite/tests/lib-threads/token1.ml b/testsuite/tests/lib-threads/token1.ml
-index d6e7a1b..3208150 100644
---- a/testsuite/tests/lib-threads/token1.ml
-+++ b/testsuite/tests/lib-threads/token1.ml
-@@ -37,7 +37,7 @@ let process (n, conds, nprocs) =
- done
-
- let main() =
-- let nprocs = try int_of_string Sys.argv.(1) with _ -> 100 in
-+ let nprocs = try int_of_string Sys.argv.(1) with _ -> 30 in
- let iter = try int_of_string Sys.argv.(2) with _ -> 1000 in
- let conds = Array.create nprocs (Condition.create()) in
- for i = 1 to nprocs - 1 do conds.(i) <- Condition.create() done;
-diff --git a/testsuite/tests/lib-threads/token2.ml b/testsuite/tests/lib-threads/token2.ml
-index 9ef0580..25a9004 100644
---- a/testsuite/tests/lib-threads/token2.ml
-+++ b/testsuite/tests/lib-threads/token2.ml
-@@ -33,7 +33,7 @@ let process (n, ins, outs, nprocs) =
- done
-
- let main() =
-- let nprocs = try int_of_string Sys.argv.(1) with _ -> 100 in
-+ let nprocs = try int_of_string Sys.argv.(1) with _ -> 30 in
- let iter = try int_of_string Sys.argv.(2) with _ -> 1000 in
- let ins = Array.create nprocs Unix.stdin in
- let outs = Array.create nprocs Unix.stdout in
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Wed, 13 Nov 2013 14:28:16 +0100
-Subject: Native backtraces don't work on powerpc and sparc
-
----
- testsuite/tests/backtrace/Makefile | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/testsuite/tests/backtrace/Makefile b/testsuite/tests/backtrace/Makefile
-index 83f9472..3695ff6 100644
---- a/testsuite/tests/backtrace/Makefile
-+++ b/testsuite/tests/backtrace/Makefile
-@@ -18,7 +18,10 @@ OTHERFILES=backtrace2.ml raw_backtrace.ml
-
- default:
- $(MAKE) byte
-- @if $(BYTECODE_ONLY); then : ; else $(MAKE) native; fi
-+ @case `dpkg-architecture -qDEB_BUILD_ARCH` in \
-+ sparc|powerpc*) : ;; \
-+ *) if $(BYTECODE_ONLY) ; then : ; else $(MAKE) native; fi ;; \
-+ esac
-
- .PHONY: byte
- byte:
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Wed, 13 Nov 2013 14:28:20 +0100
-Subject: Fix native backtraces on arm*
-
-Author: Jacques-Henri Jourdan
-Bug: http://caml.inria.fr/mantis/view.php?id=6233
-Signed-off-by: Stephane Glondu <steph@glondu.net>
----
- asmcomp/linearize.ml | 6 ++++++
- asmcomp/linearize.mli | 3 +++
- asmcomp/schedgen.ml | 3 ++-
- 3 files changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/asmcomp/linearize.ml b/asmcomp/linearize.ml
-index 963ffe9..5095c3a 100644
---- a/asmcomp/linearize.ml
-+++ b/asmcomp/linearize.ml
-@@ -86,6 +86,12 @@ let instr_cons d a r n =
- { desc = d; next = n; arg = a; res = r;
- dbg = Debuginfo.none; live = Reg.Set.empty }
-
-+(* Cons an instruction (live empty) *)
-+
-+let instr_cons_debug d a r dbg n =
-+ { desc = d; next = n; arg = a; res = r;
-+ dbg = dbg; live = Reg.Set.empty }
-+
- (* Cons a simple instruction (arg, res, live empty) *)
-
- let cons_instr d n =
-diff --git a/asmcomp/linearize.mli b/asmcomp/linearize.mli
-index ad5dc3a..ca203a7 100644
---- a/asmcomp/linearize.mli
-+++ b/asmcomp/linearize.mli
-@@ -42,6 +42,9 @@ val has_fallthrough : instruction_desc -> bool
- val end_instr: instruction
- val instr_cons:
- instruction_desc -> Reg.t array -> Reg.t array -> instruction -> instruction
-+val instr_cons_debug:
-+ instruction_desc -> Reg.t array -> Reg.t array -> Debuginfo.t ->
-+ instruction -> instruction
- val invert_test: Mach.test -> Mach.test
-
- type fundecl =
-diff --git a/asmcomp/schedgen.ml b/asmcomp/schedgen.ml
-index 885c945..a04ab27 100644
---- a/asmcomp/schedgen.ml
-+++ b/asmcomp/schedgen.ml
-@@ -336,7 +336,8 @@ method private reschedule ready_queue date cont =
- if son.emitted_ancestors = son.ancestors then
- new_queue := son :: !new_queue)
- node.sons;
-- instr_cons node.instr.desc node.instr.arg node.instr.res
-+ instr_cons_debug node.instr.desc node.instr.arg node.instr.res
-+ node.instr.dbg
- (self#reschedule !new_queue (date + issue_cycles) cont)
- end
-
---
+++ /dev/null
-From: Xavier Leroy <xavier.leroy@inria.fr>
-Date: Thu, 28 Nov 2013 14:31:42 +0000
-Subject: Make "ocamlopt -g" more resistant to ill-formed locations
-
-Origin: upstream SVN, r1432
-Bug: http://caml.inria.fr/mantis/view.php?id=6243
----
- asmcomp/emitaux.ml | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/asmcomp/emitaux.ml b/asmcomp/emitaux.ml
-index 3ad467c..ccfa977 100644
---- a/asmcomp/emitaux.ml
-+++ b/asmcomp/emitaux.ml
-@@ -221,9 +221,9 @@ let reset_debug_info () =
- let emit_debug_info dbg =
- if is_cfi_enabled () &&
- (!Clflags.debug || Config.with_frame_pointers)
-- && not (Debuginfo.is_none dbg) then begin
-+ && dbg.Debuginfo.dinfo_line > 0 (* PR#6243 *)
-+ then begin
- let line = dbg.Debuginfo.dinfo_line in
-- assert (line <> 0); (* clang errors out on zero line numbers *)
- let file_name = dbg.Debuginfo.dinfo_file in
- let file_num =
- try List.assoc file_name !file_pos_nums
---
+++ /dev/null
-From: Stephane Glondu <steph@glondu.net>
-Date: Thu, 26 Dec 2013 21:56:57 +0100
-Subject: Fix lost locations in out-of-bounds exceptions
-
-Origin: upstream SVN, r14325
-Bug: http://caml.inria.fr/mantis/view.php?id=6233
----
- asmcomp/schedgen.ml | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/asmcomp/schedgen.ml b/asmcomp/schedgen.ml
-index a04ab27..e04eacd 100644
---- a/asmcomp/schedgen.ml
-+++ b/asmcomp/schedgen.ml
-@@ -336,9 +336,8 @@ method private reschedule ready_queue date cont =
- if son.emitted_ancestors = son.ancestors then
- new_queue := son :: !new_queue)
- node.sons;
-- instr_cons_debug node.instr.desc node.instr.arg node.instr.res
-- node.instr.dbg
-- (self#reschedule !new_queue (date + issue_cycles) cont)
-+ { node.instr with next =
-+ self#reschedule !new_queue (date + issue_cycles) cont }
- end
-
- (* Entry point *)
---
0002-Call-ld-with-proper-flags.patch
0003-Don-t-use-rpath.patch
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-Avoid-multiple-declarations-in-generated-.c-files-in.patch
-0008-Embed-bytecode-in-C-object-when-using-custom.patch
-0009-Fix-typos-and-other-wording-issues.patch
-0010-Add-const-qualifiers-in-Tcl-Tk-bindings.patch
-0011-Enable-mkstemp-in-yacc.patch
-0012-Fix-ocamlopt-on-sparc.patch
-0013-Tune-resource-usage-of-some-tests.patch
-0014-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch
-0015-Fix-native-backtraces-on-arm.patch
-0016-Make-ocamlopt-g-more-resistant-to-ill-formed-locatio.patch
-0017-Fix-lost-locations-in-out-of-bounds-exceptions.patch
+0005-Avoid-multiple-declarations-in-generated-.c-files-in.patch
+0006-Embed-bytecode-in-C-object-when-using-custom.patch
+0007-Tune-resource-usage-of-some-tests.patch
+0008-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch