From: Stephane Glondu Date: Wed, 3 Jun 2009 11:13:03 +0000 (+0200) Subject: Imported Upstream version 3.11.1~rc1 X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~63^2~26 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b9389f46240297ef827cd2bd5585103679a1d100;p=ocaml.git Imported Upstream version 3.11.1~rc1 --- diff --git a/Changes b/Changes index 34eb1d98..d345f33f 100644 --- a/Changes +++ b/Changes @@ -28,11 +28,15 @@ Bug fixes: - PR#4766: incorrect simplification of some type abbreviations. - PR#4768: printf: %F does not respect width and precision specifications - PR#4769: Format.bprintf fails to flush -- PR#4775: compiler crash on crazy types (temporary fix) +- PR#4775: fatal error Ctype.Unify during module type-checking (temporary fix) - PR#4776: bad interaction between exceptions and classes - PR#4780: labltk build problem under Windows. - PR#4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix error. - PR#4792: bug in Big_int.big_int_of_int64 on 32-bit platforms. +- PR#4796: ocamlyacc: missing NUL termination of string +- PR#4804: bug in Big_int.int64_of_big_int on 32-bit platforms. +- PR#4805: improving compatibility with the clang C compiler +- PR#4809: issue with Unix.create_process under Win32 - Module Parsing: improved computation of locations when an ocamlyacc rule starts with an empty nonterminal - Type-checker: fixed wrong variance computation for private types @@ -2435,4 +2439,4 @@ Caml Special Light 1.06: * First public release. -$Id: Changes,v 1.183.2.13 2009/05/19 14:46:13 doligez Exp $ +$Id: Changes,v 1.183.2.17 2009/06/02 21:41:53 doligez Exp $ diff --git a/VERSION b/VERSION index 7486269b..f71d01de 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ -3.11.1+rc0 +3.11.1+rc1 # The version string is the first line of this file. # It must be in the format described in stdlib/sys.mli -# $Id: VERSION,v 1.26.2.13 2009/05/19 14:46:13 doligez Exp $ +# $Id: VERSION,v 1.26.2.17 2009/06/02 21:41:53 doligez Exp $ diff --git a/boot/.cvsignore b/boot/.cvsignore index b9c6f858..a0a2356c 100644 --- a/boot/.cvsignore +++ b/boot/.cvsignore @@ -3,3 +3,4 @@ ocamlrun ocamlyacc camlheader myocamlbuild +myocamlbuild.native diff --git a/boot/ocamlc b/boot/ocamlc index 8c55166e..7bddd836 100755 Binary files a/boot/ocamlc and b/boot/ocamlc differ diff --git a/boot/ocamldep b/boot/ocamldep index 5bf8338f..763ebfeb 100755 Binary files a/boot/ocamldep and b/boot/ocamldep differ diff --git a/boot/ocamllex b/boot/ocamllex index 087d530d..f2b80521 100755 Binary files a/boot/ocamllex and b/boot/ocamllex differ diff --git a/build/fastworld.sh b/build/fastworld.sh index 905f37fd..c539141b 100755 --- a/build/fastworld.sh +++ b/build/fastworld.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: fastworld.sh,v 1.3.4.1 2008/10/23 15:29:11 ertai Exp $ +# $Id: fastworld.sh,v 1.3.4.2 2009/06/02 09:37:47 doligez Exp $ cd `dirname $0` set -e if [ -e ocamlbuild_mixed_mode ]; then @@ -10,7 +10,7 @@ fi ./mkconfig.sh ./mkmyocamlbuild_config.sh . ../config/config.sh -if [ "x$EXE" = "x.exe" ]; then +if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then ./boot-c-parts-windows.sh else ./boot-c-parts.sh diff --git a/build/otherlibs-targets.sh b/build/otherlibs-targets.sh index 6bf04dcf..1327998a 100644 --- a/build/otherlibs-targets.sh +++ b/build/otherlibs-targets.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: otherlibs-targets.sh,v 1.4 2007/11/29 10:32:38 ertai Exp $ +# $Id: otherlibs-targets.sh,v 1.4.4.1 2009/05/26 12:49:16 ertai Exp $ OTHERLIBS_BYTE="" OTHERLIBS_NATIVE="" OTHERLIBS_UNIX_NATIVE="" @@ -39,6 +39,7 @@ add_c_lib() { add_ocaml_lib() { add_native "$1.cmxa" + add_native "$1.$A" add_byte "$1.cma" } @@ -94,7 +95,7 @@ for lib in $OTHERLIBRARIES; do add_c_lib mldbm;; dynlink) add_ocaml_lib dynlink - add_native dynlink.cmx + add_native dynlink.cmx dynlink.$O add_file $lib.cmi extract_crc;; win32unix) UNIXDIR="otherlibs/win32unix" diff --git a/build/world.sh b/build/world.sh index 0a9ab27f..3df67cf8 100755 --- a/build/world.sh +++ b/build/world.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: world.sh,v 1.3.4.1 2008/10/23 15:29:11 ertai Exp $ +# $Id: world.sh,v 1.3.4.2 2009/06/02 09:37:47 doligez Exp $ cd `dirname $0` set -e if [ -e ocamlbuild_mixed_mode ]; then @@ -10,7 +10,7 @@ fi ./mkconfig.sh ./mkmyocamlbuild_config.sh . ../config/config.sh -if [ "x$EXE" = "x.exe" ]; then +if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then ./boot-c-parts-windows.sh else ./boot-c-parts.sh diff --git a/byterun/Makefile b/byterun/Makefile index ac1c2524..221466a1 100644 --- a/byterun/Makefile +++ b/byterun/Makefile @@ -11,7 +11,7 @@ # # ######################################################################### -# $Id: Makefile,v 1.64.2.3 2009/05/13 05:00:48 garrigue Exp $ +# $Id: Makefile,v 1.64.2.5 2009/05/25 12:25:25 doligez Exp $ include Makefile.common @@ -22,14 +22,10 @@ OBJS=$(COMMONOBJS) unix.o main.o DOBJS=$(OBJS:.o=.d.o) instrtrace.d.o PICOBJS=$(OBJS:.o=.pic.o) -TMP_SHARED_LIBRARIES=$(SUPPORTS_SHARED_LIBRARIES:false=) -SHARED_LIBRARIES_DEPS=$(TMP_SHARED_LIBRARIES:true=libcamlrun_shared.so) +SHARED_LIBS_TMP=$(SUPPORTS_SHARED_LIBRARIES:%false=) +SHARED_LIBS_DEPS=$(SHARED_LIBS_TMP:%true=libcamlrun_shared.so) -all:: $(SHARED_LIBRARIES_DEPS) - -install:: - if test -f libcamlrun_shared.so; then \ - cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so; fi +all:: $(SHARED_LIBS_DEPS) ocamlrun$(EXE): libcamlrun.a prims.o $(MKEXE) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \ @@ -50,6 +46,14 @@ libcamlrund.a: $(DOBJS) libcamlrun_shared.so: $(PICOBJS) $(MKDLL) -o libcamlrun_shared.so $(PICOBJS) $(BYTECCLIBS) +install:: + if test -f libcamlrun_shared.so; then \ + cp libcamlrun_shared.so $(LIBDIR)/libcamlrun_shared.so; fi + +clean:: + rm -f libcamlrun_shared.so + + .SUFFIXES: .d.o .pic.o .c.d.o: diff --git a/byterun/Makefile.common b/byterun/Makefile.common index 75f80564..9580b86b 100755 --- a/byterun/Makefile.common +++ b/byterun/Makefile.common @@ -11,7 +11,7 @@ # # ######################################################################### -# $Id: Makefile.common,v 1.6 2008/09/10 05:51:11 weis Exp $ +# $Id: Makefile.common,v 1.6.2.1 2009/05/25 12:25:25 doligez Exp $ include ../config/Makefile @@ -86,7 +86,7 @@ jumptbl.h : instruct.h version.h : ../VERSION echo "#define OCAML_VERSION \"`head -1 ../VERSION`\"" > version.h -clean: +clean :: rm -f ocamlrun$(EXE) ocamlrund$(EXE) *.$(O) *.$(A) *.$(SO) rm -f primitives prims.c opnames.h jumptbl.h ld.conf rm -f version.h diff --git a/byterun/interp.c b/byterun/interp.c index c8626504..7e997871 100644 --- a/byterun/interp.c +++ b/byterun/interp.c @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id: interp.c,v 1.97 2008/08/01 11:52:31 xleroy Exp $ */ +/* $Id: interp.c,v 1.97.2.1 2009/05/25 08:02:16 xleroy Exp $ */ /* The bytecode interpreter */ #include @@ -113,7 +113,7 @@ sp is a local copy of the global variable caml_extern_sp. */ For GCC, I have hand-assigned hardware registers for several architectures. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(DEBUG) +#if defined(__GNUC__) && !defined(DEBUG) && !defined(__INTEL_COMPILER) && !defined(__llvm__) #ifdef __mips__ #define PC_REG asm("$16") #define SP_REG asm("$17") diff --git a/configure b/configure index e736a923..166ceafb 100755 --- a/configure +++ b/configure @@ -13,7 +13,7 @@ # # ######################################################################### -# $Id: configure,v 1.266.2.4 2009/05/19 13:23:47 doligez Exp $ +# $Id: configure,v 1.266.2.5 2009/05/20 15:33:09 weis Exp $ configure_options="$*" prefix=/usr/local @@ -1198,6 +1198,12 @@ x11_link="not found" for dir in \ $x11_include_dir \ \ + /usr/X11R7/include \ + /usr/include/X11R7 \ + /usr/local/X11R7/include \ + /usr/local/include/X11R7 \ + /opt/X11R7/include \ + \ /usr/X11R6/include \ /usr/include/X11R6 \ /usr/local/X11R6/include \ diff --git a/debugger/parser.mly b/debugger/parser.mly index 750f2963..40531b92 100644 --- a/debugger/parser.mly +++ b/debugger/parser.mly @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id: parser.mly,v 1.7.28.3 2009/04/15 11:09:56 xclerc Exp $ */ +/* $Id: parser.mly,v 1.7.28.4 2009/05/23 14:42:57 xclerc Exp $ */ %{ @@ -182,6 +182,7 @@ longident_eol : opt_longident : UIDENT { Some (Lident $1) } + | LIDENT { Some (Lident $1) } | module_path DOT UIDENT { Some (Ldot($1, $3)) } | { None }; diff --git a/man/ocamldoc.m b/man/ocamldoc.m index 5d1ed6ad..df807c7d 100644 --- a/man/ocamldoc.m +++ b/man/ocamldoc.m @@ -1,4 +1,4 @@ -\" $Id: ocamldoc.m,v 1.5 2008/09/15 14:12:56 doligez Exp $ +\" $Id: ocamldoc.m,v 1.5.2.1 2009/05/27 14:35:27 doligez Exp $ .TH OCAMLDOC 1 @@ -110,10 +110,7 @@ to display it. .TP .BI \-g \ file Dynamically load the given file (which extension usually is .cmo or .cma), -which defines a custom documentation generator. This option is supported by the -.BR ocamldoc (1) -command, but not by its native-code version -.BR ocamldoc.opt . +which defines a custom documentation generator. If the given file is a simple one and does not exist in the current directory, then ocamldoc looks for it in the custom generators default directory, and in the directories specified with the diff --git a/myocamlbuild.ml b/myocamlbuild.ml index 6e9d40d6..c811a80e 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -10,7 +10,7 @@ (* *) (***********************************************************************) -(* $Id: myocamlbuild.ml,v 1.23.2.5 2009/05/05 13:40:18 ertai Exp $ *) +(* $Id: myocamlbuild.ml,v 1.23.2.6 2009/05/26 12:49:16 ertai Exp $ *) open Ocamlbuild_plugin open Command @@ -400,6 +400,7 @@ rule "native stdlib in mixed mode" copy_rule' ~insert:`top "otherlibs/dynlink/natdynlink.ml" "otherlibs/dynlink/nat/dynlink.ml";; copy_rule' ~insert:`top "otherlibs/dynlink/dynlink.mli" "otherlibs/dynlink/nat/dynlink.mli";; copy_rule' ~insert:`top "otherlibs/dynlink/nat/dynlink.cmx" "otherlibs/dynlink/dynlink.cmx";; +copy_rule' ~insert:`top ("otherlibs/dynlink/nat/dynlink"-.-C.o) ("otherlibs/dynlink/dynlink"-.-C.o);; copy_rule' ~insert:`top "otherlibs/dynlink/nat/dynlink.cmxa" "otherlibs/dynlink/dynlink.cmxa";; copy_rule' ~insert:`top ("otherlibs/dynlink/nat/dynlink"-.-C.a) ("otherlibs/dynlink/dynlink"-.-C.a);; dep ["ocaml"; "compile"; "native"; "file:otherlibs/dynlink/nat/dynlink.cmx"] ["otherlibs/dynlink/nat/dynlink.cmi"];; @@ -1090,7 +1091,7 @@ rule "labltk.cma" let labltk_cmxa_contents = labltk_contents "cmx" in rule "labltk.cmxa" - ~prod:"otherlibs/labltk/lib/labltk.cmxa" + ~prods:["otherlibs/labltk/lib/labltk.cmxa"; "otherlibs/labltk/lib/labltk"-.-C.a] ~deps:labltk_cmxa_contents (Ocamlbuild_pack.Ocaml_compiler.native_library_link_modules labltk_lib_contents "otherlibs/labltk/lib/labltk.cmxa");; diff --git a/ocamlbuild/ocamlbuild_where.ml b/ocamlbuild/ocamlbuild_where.ml index 1703a533..14fcde5d 100644 --- a/ocamlbuild/ocamlbuild_where.ml +++ b/ocamlbuild/ocamlbuild_where.ml @@ -1,5 +1,7 @@ let bindir = ref Ocamlbuild_Myocamlbuild_config.bindir;; let libdir = ref begin - try Filename.concat (Sys.getenv "OCAMLLIB") "ocamlbuild" - with Not_found -> Ocamlbuild_Myocamlbuild_config.libdir + Filename.concat + (try Sys.getenv "OCAMLLIB" + with Not_found -> Ocamlbuild_Myocamlbuild_config.libdir) + "ocamlbuild" end;; diff --git a/ocamldoc/Makefile.nt b/ocamldoc/Makefile.nt index 009bfbd1..ec7504dd 100644 --- a/ocamldoc/Makefile.nt +++ b/ocamldoc/Makefile.nt @@ -9,7 +9,7 @@ #(* *) #(***********************************************************************) -# $Id: Makefile.nt,v 1.27.4.1 2009/04/09 13:56:38 guesdon Exp $ +# $Id: Makefile.nt,v 1.27.4.2 2009/05/20 12:07:05 doligez Exp $ include ../config/Makefile @@ -24,7 +24,7 @@ OCAMLBIN = $(BINDIR) OCAMLPP=-pp "grep -v DEBUG" -# For installation +# For installation ############## MKDIR=mkdir CP=cp @@ -179,18 +179,18 @@ OCAMLCMXFILES=$(OCAMLCMOFILES:.cmo=.cmx) all: exe lib exe: $(OCAMLDOC) -lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) +lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) opt.opt: exeopt libopt exeopt: $(OCAMLDOC_OPT) -libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI) -debug: +libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI) +debug: make OCAMLPP="" -$(OCAMLDOC): $(EXECMOFILES) +$(OCAMLDOC): $(EXECMOFILES) $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES) $(OCAMLDOC_OPT): $(EXECMXFILES) - $(OCAMLOPT) -o $@ unix.cmxa str.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) + $(OCAMLOPT) -o $@ unix.cmxa str.cmxa dynlink.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) $(OCAMLDOC_LIBCMA): $(LIBCMOFILES) $(OCAMLC) -a -o $@ $(LINKFLAGS) $(OCAMLCMOFILES) $(LIBCMOFILES) diff --git a/otherlibs/labltk/examples_camltk/Makefile.nt b/otherlibs/labltk/examples_camltk/Makefile.nt index 13f27a01..d07471bc 100644 --- a/otherlibs/labltk/examples_camltk/Makefile.nt +++ b/otherlibs/labltk/examples_camltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../camltk -I ../support diff --git a/otherlibs/labltk/examples_labltk/Makefile.nt b/otherlibs/labltk/examples_labltk/Makefile.nt index 825d9e42..261bf754 100644 --- a/otherlibs/labltk/examples_labltk/Makefile.nt +++ b/otherlibs/labltk/examples_labltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../labltk -I ../support diff --git a/otherlibs/num/big_int.ml b/otherlibs/num/big_int.ml index 8c47f7bc..669df773 100644 --- a/otherlibs/num/big_int.ml +++ b/otherlibs/num/big_int.ml @@ -11,7 +11,7 @@ (* *) (***********************************************************************) -(* $Id: big_int.ml,v 1.24.2.1 2009/05/18 13:08:03 xleroy Exp $ *) +(* $Id: big_int.ml,v 1.24.2.2 2009/05/24 19:46:44 xleroy Exp $ *) open Int_misc open Nat @@ -378,7 +378,9 @@ let int64_of_big_int bi = else begin let i = match num_digits_big_int bi with - | 1 -> Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0) + | 1 -> Int64.logand + (Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0)) + 0xFFFFFFFFL | 2 -> Int64.logor (Int64.logand (Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0)) diff --git a/otherlibs/num/test/test_big_ints.ml b/otherlibs/num/test/test_big_ints.ml index c9026a3f..ec95dede 100644 --- a/otherlibs/num/test/test_big_ints.ml +++ b/otherlibs/num/test/test_big_ints.ml @@ -771,12 +771,14 @@ test 3 eq_int64 (int64_of_big_int (big_int_of_string "-9223372036854775808"), -9223372036854775808L);; test 4 eq_int64 (int64_of_big_int (big_int_of_string "-9223372036854775"), -9223372036854775L);; +test 5 eq_int64 (* PR#4804 *) + (int64_of_big_int (big_int_of_string "2147483648"), 2147483648L);; let should_fail s = try ignore (int64_of_big_int (big_int_of_string s)); 0 with Failure _ -> 1;; -test 4 eq_int +test 6 eq_int (should_fail "9223372036854775808", 1);; -test 5 eq_int +test 7 eq_int (should_fail "-9223372036854775809", 1);; -test 6 eq_int +test 8 eq_int (should_fail "18446744073709551616", 1);; diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c index 422c68ab..6b439f78 100644 --- a/otherlibs/win32unix/createprocess.c +++ b/otherlibs/win32unix/createprocess.c @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id: createprocess.c,v 1.14 2008/01/11 16:13:16 doligez Exp $ */ +/* $Id: createprocess.c,v 1.14.4.1 2009/06/02 13:12:53 xleroy Exp $ */ #include #include @@ -35,15 +35,14 @@ value win_create_process_native(value cmd, value cmdline, value env, envp = NULL; } /* Prepare stdin/stdout/stderr redirection */ - GetStartupInfo(&si); - si.dwFlags |= STARTF_USESTDHANDLES; + ZeroMemory(&si, sizeof(STARTUPINFO)); + si.cb = sizeof(STARTUPINFO); + si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = Handle_val(fd1); si.hStdOutput = Handle_val(fd2); si.hStdError = Handle_val(fd3); /* If we do not have a console window, then we must create one before running the process (keep it hidden for apparence). - Also one must suppress spurious flags in si.dwFlags. - Otherwise the redirections are ignored. If we are starting a GUI application, the newly created console should not matter. */ if (win_has_console()) diff --git a/yacc/reader.c b/yacc/reader.c index 923aee23..a8f751d3 100644 --- a/yacc/reader.c +++ b/yacc/reader.c @@ -12,7 +12,7 @@ /* Based on public-domain code from Berkeley Yacc */ -/* $Id: reader.c,v 1.32 2005/10/06 06:34:51 garrigue Exp $ */ +/* $Id: reader.c,v 1.32.18.1 2009/05/20 11:58:43 doligez Exp $ */ #include #include "defs.h" @@ -163,6 +163,7 @@ char *substring (char *str, int start, int len) for (i = 0; i < len; i++){ buf[i] = str[start+i]; } + buf[i] = '\0'; /* PR#4796 */ return buf; } @@ -710,7 +711,7 @@ get_literal(void) n = cinc; s = MALLOC(n); if (s == 0) no_space(); - + for (i = 0; i < n; ++i) s[i] = cache[i]; @@ -1306,7 +1307,7 @@ loop: { ++cptr; i = get_number(); - + if (i <= 0 || i > n) unknown_rhs(i); item = pitem[nitems + i - n - 1]; @@ -1393,7 +1394,7 @@ loop: fwrite(cptr, 1, 2, f); cptr += 2; } else - if (cptr[0] == '\\' + if (cptr[0] == '\\' && isdigit((unsigned char) cptr[1]) && isdigit((unsigned char) cptr[2]) && isdigit((unsigned char) cptr[3])