Compare commits
52 Commits
Author | SHA1 | Date |
---|---|---|
Richard W.M. Jones | c5a44d336b | |
Fedora Release Engineering | c4c11c263c | |
Richard W.M. Jones | 6fbb4db452 | |
Fedora Release Engineering | 38e7f9a43c | |
Richard W.M. Jones | 73c8e3d782 | |
Richard W.M. Jones | 4bb2864cc2 | |
Jerry James | 3eca5f5ac7 | |
Richard W.M. Jones | 37422916a0 | |
Richard W.M. Jones | b249a82b37 | |
Fedora Release Engineering | 999a7e734e | |
Richard W.M. Jones | edfb35d875 | |
Fedora Release Engineering | 95d7ecd59b | |
Richard W.M. Jones | 129153b851 | |
Richard W.M. Jones | b8653f50ff | |
Fedora Release Engineering | 2dec79cc2e | |
Tom Stellard | 06d6e508a6 | |
Richard W.M. Jones | 709f14be77 | |
Richard W.M. Jones | 1018e3aa3a | |
Richard W.M. Jones | cf41d3d77d | |
Richard W.M. Jones | 493a29c315 | |
Fedora Release Engineering | 713b423230 | |
Tom Stellard | ae20e03421 | |
Jeff Law | 9efe171b21 | |
Richard W.M. Jones | 80474fcdea | |
Richard W.M. Jones | a2dcfff43b | |
Richard W.M. Jones | 7eb82f0e55 | |
Richard W.M. Jones | a5fe6c6a38 | |
Richard W.M. Jones | 9ed29bd6b2 | |
Richard W.M. Jones | db6ffb193e | |
Richard W.M. Jones | 7c612a100b | |
Richard W.M. Jones | 790c0c334b | |
Richard W.M. Jones | fc7aa1636a | |
Richard W.M. Jones | dc143d5bb6 | |
Fedora Release Engineering | 39e6786df8 | |
Richard W.M. Jones | f986cb165c | |
Richard W.M. Jones | 71ffd8d204 | |
Richard W.M. Jones | d999c1ca02 | |
Richard W.M. Jones | be199402b5 | |
Richard W.M. Jones | 785927384b | |
Richard W.M. Jones | b59110214e | |
Richard W.M. Jones | 45edde154b | |
Richard W.M. Jones | 5028b94a94 | |
Richard W.M. Jones | 3779563b6a | |
Richard W.M. Jones | c6050323b4 | |
Richard W.M. Jones | 47619598e9 | |
Richard W.M. Jones | d9e51264fc | |
Richard W.M. Jones | 54390d6011 | |
Richard W.M. Jones | ab47d2524d | |
Richard W.M. Jones | 6dcdd9e9c2 | |
Richard W.M. Jones | 2f37856e84 | |
Richard W.M. Jones | 14856c2d7f | |
Richard W.M. Jones | 643d094358 |
|
@ -4,3 +4,5 @@
|
|||
/ocaml-*.tar.gz
|
||||
/ocaml-*.tar.xz
|
||||
/ocaml-*-refman.pdf
|
||||
/4.11.0.tar.gz
|
||||
/4.13.1.tar.gz
|
||||
|
|
|
@ -0,0 +1,192 @@
|
|||
From 2912ed4fde14e34b58c482cb81fb88676ab3ffc2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= <n.oje.bar@gmail.com>
|
||||
Date: Wed, 27 Apr 2022 14:46:47 +0200
|
||||
Subject: [PATCH 01/24] Do not trigger warning when calling virtual methods
|
||||
introduced by constraining "self" (#11204)
|
||||
|
||||
(cherry picked from commit 1e7af3f6261502bb384dc9e23a74ad0990bfd854)
|
||||
---
|
||||
Changes | 11 ++++++-
|
||||
testsuite/tests/typing-objects/Tests.ml | 15 ++++++++++
|
||||
typing/typeclass.ml | 40 ++++++++++---------------
|
||||
3 files changed, 40 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index a8ce94bdc6..931a74b8d1 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -1,3 +1,13 @@
|
||||
+OCaml 4.14 maintenance branch
|
||||
+-----------------------------
|
||||
+
|
||||
+### Bug fixes:
|
||||
+
|
||||
+- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
|
||||
+ calling virtual methods introduced by constraining the self type from within
|
||||
+ the class definition.
|
||||
+ (Nicolás Ojeda Bär, review by Leo White)
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
@@ -62,7 +72,6 @@ OCaml 4.14.0 (28 March 2022)
|
||||
definition-aware operations.
|
||||
(Ulysse Gérard, Thomas Refis and Leo White, review by Florian Angeletti)
|
||||
|
||||
-
|
||||
### Language features:
|
||||
|
||||
- #10462: Add attribute to produce a compiler error for polls.
|
||||
diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml
|
||||
index f617bcf1b9..3dcd87c43c 100644
|
||||
--- a/testsuite/tests/typing-objects/Tests.ml
|
||||
+++ b/testsuite/tests/typing-objects/Tests.ml
|
||||
@@ -955,6 +955,21 @@ Warning 17 [undeclared-virtual-method]: the virtual method m is not declared.
|
||||
class c : object method m : int method n : int end
|
||||
|}];;
|
||||
|
||||
+class virtual c = object (self : 'c)
|
||||
+ constraint 'c = < f : int; .. >
|
||||
+end
|
||||
+[%%expect {|
|
||||
+class virtual c : object method virtual f : int end
|
||||
+|}];;
|
||||
+
|
||||
+class virtual c = object (self : 'c)
|
||||
+ constraint 'c = < f : int; .. >
|
||||
+ method g = self # f
|
||||
+end
|
||||
+[%%expect {|
|
||||
+class virtual c : object method virtual f : int method g : int end
|
||||
+|}];;
|
||||
+
|
||||
class [ 'a ] c = object (_ : 'a) end;;
|
||||
let o = object
|
||||
method m = 1
|
||||
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
|
||||
index 048ee998b0..fedbc0e025 100644
|
||||
--- a/typing/typeclass.ml
|
||||
+++ b/typing/typeclass.ml
|
||||
@@ -552,12 +552,11 @@ type first_pass_accummulater =
|
||||
concrete_vals : VarSet.t;
|
||||
local_meths : MethSet.t;
|
||||
local_vals : VarSet.t;
|
||||
- vars : Ident.t Vars.t;
|
||||
- meths : Ident.t Meths.t; }
|
||||
+ vars : Ident.t Vars.t; }
|
||||
|
||||
let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
|
||||
let { rev_fields; val_env; par_env; concrete_meths; concrete_vals;
|
||||
- local_meths; local_vals; vars; meths } = acc
|
||||
+ local_meths; local_vals; vars } = acc
|
||||
in
|
||||
let loc = cf.pcf_loc in
|
||||
let attributes = cf.pcf_attributes in
|
||||
@@ -612,13 +611,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
|
||||
(val_env, par_env, inherited_vars, vars))
|
||||
parent_sign.csig_vars (val_env, par_env, [], vars)
|
||||
in
|
||||
- let meths =
|
||||
- Meths.fold
|
||||
- (fun label _ meths ->
|
||||
- if Meths.mem label meths then meths
|
||||
- else Meths.add label (Ident.create_local label) meths)
|
||||
- parent_sign.csig_meths meths
|
||||
- in
|
||||
(* Methods available through super *)
|
||||
let super_meths =
|
||||
MethSet.fold
|
||||
@@ -641,7 +633,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
|
||||
in
|
||||
let rev_fields = field :: rev_fields in
|
||||
{ acc with rev_fields; val_env; par_env;
|
||||
- concrete_meths; concrete_vals; vars; meths })
|
||||
+ concrete_meths; concrete_vals; vars })
|
||||
| Pcf_val (label, mut, Cfk_virtual styp) ->
|
||||
with_attrs
|
||||
(fun () ->
|
||||
@@ -723,15 +715,11 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
|
||||
let cty = transl_simple_type val_env false sty in
|
||||
let ty = cty.ctyp_type in
|
||||
add_method loc val_env label.txt priv Virtual ty sign;
|
||||
- let meths =
|
||||
- if Meths.mem label.txt meths then meths
|
||||
- else Meths.add label.txt (Ident.create_local label.txt) meths
|
||||
- in
|
||||
let field =
|
||||
Virtual_method { label; priv; cty; loc; attributes }
|
||||
in
|
||||
let rev_fields = field :: rev_fields in
|
||||
- { acc with rev_fields; meths })
|
||||
+ { acc with rev_fields })
|
||||
|
||||
| Pcf_method (label, priv, Cfk_concrete (override, expr)) ->
|
||||
with_attrs
|
||||
@@ -785,10 +773,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
|
||||
raise(Error(loc, val_env,
|
||||
Field_type_mismatch ("method", label.txt, err)))
|
||||
end;
|
||||
- let meths =
|
||||
- if Meths.mem label.txt meths then meths
|
||||
- else Meths.add label.txt (Ident.create_local label.txt) meths
|
||||
- in
|
||||
let sdefinition = make_method self_loc cl_num expr in
|
||||
let warning_state = Warnings.backup () in
|
||||
let field =
|
||||
@@ -799,7 +783,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf =
|
||||
let rev_fields = field :: rev_fields in
|
||||
let concrete_meths = MethSet.add label.txt concrete_meths in
|
||||
let local_meths = MethSet.add label.txt local_meths in
|
||||
- { acc with rev_fields; concrete_meths; local_meths; meths })
|
||||
+ { acc with rev_fields; concrete_meths; local_meths })
|
||||
|
||||
| Pcf_constraint (sty1, sty2) ->
|
||||
with_attrs
|
||||
@@ -837,11 +821,10 @@ and class_fields_first_pass self_loc cl_num sign self_scope
|
||||
let local_meths = MethSet.empty in
|
||||
let local_vals = VarSet.empty in
|
||||
let vars = Vars.empty in
|
||||
- let meths = Meths.empty in
|
||||
let init_acc =
|
||||
{ rev_fields; val_env; par_env;
|
||||
concrete_meths; concrete_vals;
|
||||
- local_meths; local_vals; vars; meths }
|
||||
+ local_meths; local_vals; vars }
|
||||
in
|
||||
let acc =
|
||||
Builtin_attributes.warning_scope []
|
||||
@@ -850,7 +833,7 @@ and class_fields_first_pass self_loc cl_num sign self_scope
|
||||
(class_field_first_pass self_loc cl_num sign self_scope)
|
||||
init_acc cfs)
|
||||
in
|
||||
- List.rev acc.rev_fields, acc.vars, acc.meths
|
||||
+ List.rev acc.rev_fields, acc.vars
|
||||
|
||||
and class_field_second_pass cl_num sign met_env field =
|
||||
let mkcf desc loc attrs =
|
||||
@@ -1003,7 +986,7 @@ and class_structure cl_num virt self_scope final val_env met_env loc
|
||||
end;
|
||||
|
||||
(* Typing of class fields *)
|
||||
- let (fields, vars, meths) =
|
||||
+ let (fields, vars) =
|
||||
class_fields_first_pass self_loc cl_num sign self_scope
|
||||
val_env par_env str
|
||||
in
|
||||
@@ -1016,6 +999,13 @@ and class_structure cl_num virt self_scope final val_env met_env loc
|
||||
update_class_signature loc val_env
|
||||
~warn_implicit_public:false virt kind sign;
|
||||
|
||||
+ let meths =
|
||||
+ Meths.fold
|
||||
+ (fun label _ meths ->
|
||||
+ Meths.add label (Ident.create_local label) meths)
|
||||
+ sign.csig_meths Meths.empty
|
||||
+ in
|
||||
+
|
||||
(* Close the signature if it is final *)
|
||||
begin match final with
|
||||
| Not_final -> ()
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
From d3bc916ff1bc467c503e21015db9c1e2a47a64f2 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 24 Jun 2014 10:00:15 +0100
|
||||
Subject: [PATCH 1/5] Don't add rpaths to libraries.
|
||||
|
||||
---
|
||||
tools/Makefile | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tools/Makefile b/tools/Makefile
|
||||
index ee0e0be4c..7c96b6405 100644
|
||||
--- a/tools/Makefile
|
||||
+++ b/tools/Makefile
|
||||
@@ -153,8 +153,8 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo \
|
||||
ocamlmklibconfig.ml: $(ROOTDIR)/Makefile.config Makefile
|
||||
(echo 'let bindir = "$(BINDIR)"'; \
|
||||
echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\
|
||||
- echo 'let default_rpath = "$(RPATH)"'; \
|
||||
- echo 'let mksharedlibrpath = "$(MKSHAREDLIBRPATH)"'; \
|
||||
+ echo 'let default_rpath = ""'; \
|
||||
+ echo 'let mksharedlibrpath = ""'; \
|
||||
echo 'let toolpref = "$(TOOLPREF)"';) \
|
||||
> ocamlmklibconfig.ml
|
||||
|
||||
--
|
||||
2.22.0.rc3
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
From 623258a6517c8ec1d9e5f41cbdc05205a0e6ee1d Mon Sep 17 00:00:00 2001
|
||||
From: David Allsopp <david.allsopp@metastack.com>
|
||||
Date: Thu, 5 May 2022 20:01:44 +0100
|
||||
Subject: [PATCH 02/24] Merge pull request #11236 from Nymphium/missing-since2
|
||||
|
||||
Add missing @since annotation to Gc.eventlog_pause
|
||||
|
||||
(cherry picked from commit 77fee6035c25d8a31084dc556ee634e46bb39164)
|
||||
---
|
||||
stdlib/gc.mli | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/stdlib/gc.mli b/stdlib/gc.mli
|
||||
index b211197fd4..8031eeb8df 100644
|
||||
--- a/stdlib/gc.mli
|
||||
+++ b/stdlib/gc.mli
|
||||
@@ -442,7 +442,10 @@ external eventlog_pause : unit -> unit = "caml_eventlog_pause"
|
||||
Traces are collected if the program is linked to the instrumented runtime
|
||||
and started with the environment variable OCAML_EVENTLOG_ENABLED.
|
||||
Events are flushed to disk after pausing, and no new events will be
|
||||
- recorded until [eventlog_resume] is called. *)
|
||||
+ recorded until [eventlog_resume] is called.
|
||||
+
|
||||
+ @since 4.11
|
||||
+ *)
|
||||
|
||||
external eventlog_resume : unit -> unit = "caml_eventlog_resume"
|
||||
(** [eventlog_resume ()] will resume the collection of traces in the
|
||||
@@ -451,7 +454,10 @@ external eventlog_resume : unit -> unit = "caml_eventlog_resume"
|
||||
and started with the environment variable OCAML_EVENTLOG_ENABLED.
|
||||
This call can be used after calling [eventlog_pause], or if the program
|
||||
was started with OCAML_EVENTLOG_ENABLED=p. (which pauses the collection of
|
||||
- traces before the first event.) *)
|
||||
+ traces before the first event.)
|
||||
+
|
||||
+ @since 4.11
|
||||
+ *)
|
||||
|
||||
|
||||
(** [Memprof] is a sampling engine for allocated memory words. Every
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
From 0204a1137a8e8058afd1665aa6112656bc7bf0be Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 26 Apr 2019 16:16:29 +0100
|
||||
Subject: [PATCH 3/5] configure: Remove incorrect assumption about
|
||||
cross-compiling.
|
||||
|
||||
See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index ad5b701bd..2227769e8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -959,7 +959,7 @@ AS_CASE([$host],
|
||||
[*-*-mingw32|*-pc-windows], [asppprofflags=''],
|
||||
[asppprofflags='-DPROFILING'])
|
||||
|
||||
-AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""])
|
||||
+#AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""])
|
||||
|
||||
# We first compute default values for as and aspp
|
||||
# If values have been given by the user then they take precedence over
|
||||
--
|
||||
2.22.0.rc3
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
From d497565758b5c80d8a7bf4cad02e5a4558ae6b00 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= <n.oje.bar@gmail.com>
|
||||
Date: Tue, 17 May 2022 10:21:34 +0200
|
||||
Subject: [PATCH 03/24] misc.h: fix preprocessor conditional on _MSC_VER
|
||||
|
||||
(cherry picked from commit 253d605e10865371aed45967a94caed0642b7583)
|
||||
---
|
||||
runtime/caml/misc.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h
|
||||
index 5915c30a7b..494d45e8f8 100644
|
||||
--- a/runtime/caml/misc.h
|
||||
+++ b/runtime/caml/misc.h
|
||||
@@ -35,7 +35,7 @@
|
||||
/* Supported since at least GCC 3.1 */
|
||||
#define CAMLdeprecated_typedef(name, type) \
|
||||
typedef type name __attribute ((deprecated))
|
||||
-#elif _MSC_VER >= 1310
|
||||
+#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
/* NB deprecated("message") only supported from _MSC_VER >= 1400 */
|
||||
#define CAMLdeprecated_typedef(name, type) \
|
||||
typedef __declspec(deprecated) type name
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,28 @@
|
|||
From d2b9da6f7aff410e8a1499637ae88aaf0a135c2f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= <n.oje.bar@gmail.com>
|
||||
Date: Tue, 17 May 2022 14:45:26 +0200
|
||||
Subject: [PATCH 04/24] Changes
|
||||
|
||||
(cherry picked from commit 9a157026f115364635f8fe0ae5805e15ef071de0)
|
||||
---
|
||||
Changes | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 931a74b8d1..fdfffd78bb 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -8,6 +8,10 @@ OCaml 4.14 maintenance branch
|
||||
the class definition.
|
||||
(Nicolás Ojeda Bär, review by Leo White)
|
||||
|
||||
+- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This
|
||||
+ could break the build of the compiler on non-gcc non-clang Unix builds.
|
||||
+ (Nicolás Ojeda Bär, review by Sebastien Hinderer)
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
From 513164232d897c39c4e571a7a8f167dee5c146b3 Mon Sep 17 00:00:00 2001
|
||||
From: David Allsopp <david.allsopp@metastack.com>
|
||||
Date: Wed, 18 May 2022 12:48:33 +0100
|
||||
Subject: [PATCH 05/24] Guard more instances of undefined _MSC_VER
|
||||
|
||||
---
|
||||
Changes | 8 +++++---
|
||||
runtime/caml/memory.h | 2 +-
|
||||
runtime/caml/misc.h | 12 +++++++-----
|
||||
3 files changed, 13 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index fdfffd78bb..590268262d 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -8,9 +8,11 @@ OCaml 4.14 maintenance branch
|
||||
the class definition.
|
||||
(Nicolás Ojeda Bär, review by Leo White)
|
||||
|
||||
-- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This
|
||||
- could break the build of the compiler on non-gcc non-clang Unix builds.
|
||||
- (Nicolás Ojeda Bär, review by Sebastien Hinderer)
|
||||
+- #11263, #11267: caml/{memory,misc}.h: check whether `_MSC_VER` is defined
|
||||
+ before using it to ensure that the headers can always be used in code which
|
||||
+ turns on -Wundef (or equivalent).
|
||||
+ (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
|
||||
+ Sebastien Hinderer)
|
||||
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
diff --git a/runtime/caml/memory.h b/runtime/caml/memory.h
|
||||
index 1e9cdf6d9b..d9e58bc2d0 100644
|
||||
--- a/runtime/caml/memory.h
|
||||
+++ b/runtime/caml/memory.h
|
||||
@@ -329,7 +329,7 @@ struct caml__roots_block {
|
||||
#define CAMLunused_start __attribute__ ((unused))
|
||||
#define CAMLunused_end
|
||||
#define CAMLunused __attribute__ ((unused))
|
||||
-#elif _MSC_VER >= 1500
|
||||
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
#define CAMLunused_start __pragma( warning (push) ) \
|
||||
__pragma( warning (disable:4189 ) )
|
||||
#define CAMLunused_end __pragma( warning (pop))
|
||||
diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h
|
||||
index 494d45e8f8..c605f8711e 100644
|
||||
--- a/runtime/caml/misc.h
|
||||
+++ b/runtime/caml/misc.h
|
||||
@@ -43,7 +43,8 @@
|
||||
#define CAMLdeprecated_typedef(name, type) typedef type name
|
||||
#endif
|
||||
|
||||
-#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L || _MSC_VER >= 1925
|
||||
+#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L \
|
||||
+ || defined(_MSC_VER) && _MSC_VER >= 1925
|
||||
|
||||
#define CAML_STRINGIFY(x) #x
|
||||
#ifdef _MSC_VER
|
||||
@@ -90,7 +91,7 @@ CAMLdeprecated_typedef(addr, char *);
|
||||
#define CAMLnoreturn_start
|
||||
#define CAMLnoreturn_end __attribute__ ((noreturn))
|
||||
#define Noreturn __attribute__ ((noreturn))
|
||||
-#elif _MSC_VER >= 1500
|
||||
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
#define CAMLnoreturn_start __declspec(noreturn)
|
||||
#define CAMLnoreturn_end
|
||||
#define Noreturn
|
||||
@@ -138,11 +139,12 @@ CAMLdeprecated_typedef(addr, char *);
|
||||
/* we need to be able to compute the exact offset of each member. */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define CAMLalign(n) _Alignas(n)
|
||||
-#elif defined(__cplusplus) && (__cplusplus >= 201103L || _MSC_VER >= 1900)
|
||||
+#elif defined(__cplusplus) \
|
||||
+ && (__cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER >= 1900)
|
||||
#define CAMLalign(n) alignas(n)
|
||||
#elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
|
||||
#define CAMLalign(n) __attribute__((aligned(n)))
|
||||
-#elif _MSC_VER >= 1500
|
||||
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
#define CAMLalign(n) __declspec(align(n))
|
||||
#else
|
||||
#error "How do I align values on this platform?"
|
||||
@@ -170,7 +172,7 @@ CAMLdeprecated_typedef(addr, char *);
|
||||
#define CAMLunused_start __attribute__ ((unused))
|
||||
#define CAMLunused_end
|
||||
#define CAMLunused __attribute__ ((unused))
|
||||
-#elif _MSC_VER >= 1500
|
||||
+#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
#define CAMLunused_start __pragma( warning (push) ) \
|
||||
__pragma( warning (disable:4189 ) )
|
||||
#define CAMLunused_end __pragma( warning (pop))
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
From 2f23a53b4aa1b672b3919cc021b83548f713b90a Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Jun 2018 19:48:08 +0000
|
||||
Subject: [PATCH 5/5] riscv: Emit debug info.
|
||||
|
||||
---
|
||||
asmcomp/riscv/emit.mlp | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/asmcomp/riscv/emit.mlp b/asmcomp/riscv/emit.mlp
|
||||
index 88ea9f884..cc05aefe4 100644
|
||||
--- a/asmcomp/riscv/emit.mlp
|
||||
+++ b/asmcomp/riscv/emit.mlp
|
||||
@@ -261,6 +261,7 @@ let tailrec_entry_point = ref 0
|
||||
(* Output the assembly code for an instruction *)
|
||||
|
||||
let emit_instr i =
|
||||
+ emit_debug_info i.dbg;
|
||||
match i.desc with
|
||||
Lend -> ()
|
||||
| Lprologue ->
|
||||
@@ -556,6 +557,7 @@ let fundecl fundecl =
|
||||
` {emit_string code_space}\n`;
|
||||
` .align 2\n`;
|
||||
`{emit_symbol fundecl.fun_name}:\n`;
|
||||
+ emit_debug_info fundecl.fun_dbg;
|
||||
emit_all fundecl.fun_body;
|
||||
List.iter emit_call_gc !call_gc_sites;
|
||||
List.iter emit_call_bound_error !bound_error_sites;
|
||||
@@ -615,6 +617,7 @@ let data l =
|
||||
|
||||
let begin_assembly() =
|
||||
` .file \"\"\n`; (* PR#7073 *)
|
||||
+ reset_debug_info ();
|
||||
(* Emit the beginning of the segments *)
|
||||
let lbl_begin = Compilenv.make_symbol (Some "data_begin") in
|
||||
` {emit_string data_space}\n`;
|
||||
--
|
||||
2.22.0.rc3
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
From fa904a7d3c89c2ad18a426017aeda5bb0d7dd8bd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fran=C3=A7ois=20Pottier?=
|
||||
<fpottier@users.noreply.github.com>
|
||||
Date: Fri, 24 Jun 2022 16:37:13 +0200
|
||||
Subject: [PATCH 06/24] Better documentation for [string_of_float]. (#11353)
|
||||
|
||||
Better documentation for [string_of_float] (and [Float.to_string])
|
||||
with similar warnings for [print_float] and [prerr_float] in a similar way.
|
||||
|
||||
(cherry picked from commit 40113fbc73930b41a7a2df468de18c94feeefdf5)
|
||||
---
|
||||
stdlib/float.mli | 7 ++++++-
|
||||
stdlib/stdlib.mli | 15 ++++++++++++---
|
||||
stdlib/templates/float.template.mli | 7 ++++++-
|
||||
3 files changed, 24 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/stdlib/float.mli b/stdlib/float.mli
|
||||
index ba84d9b0e2..93d2f3016d 100644
|
||||
--- a/stdlib/float.mli
|
||||
+++ b/stdlib/float.mli
|
||||
@@ -178,7 +178,12 @@ val of_string_opt: string -> float option
|
||||
(** Same as [of_string], but returns [None] instead of raising. *)
|
||||
|
||||
val to_string : float -> string
|
||||
-(** Return the string representation of a floating-point number. *)
|
||||
+(** Return a string representation of a floating-point number.
|
||||
+
|
||||
+ This conversion can involve a loss of precision. For greater control over
|
||||
+ the manner in which the number is printed, see {!Printf}.
|
||||
+
|
||||
+ This function is an alias for {!Stdlib.string_of_float}. *)
|
||||
|
||||
type fpclass = Stdlib.fpclass =
|
||||
FP_normal (** Normal number, none of the below *)
|
||||
diff --git a/stdlib/stdlib.mli b/stdlib/stdlib.mli
|
||||
index 237adfbdd8..0eaee2716e 100644
|
||||
--- a/stdlib/stdlib.mli
|
||||
+++ b/stdlib/stdlib.mli
|
||||
@@ -776,7 +776,10 @@ external int_of_string : string -> int = "caml_int_of_string"
|
||||
[Failure "int_of_string"] instead of returning [None]. *)
|
||||
|
||||
val string_of_float : float -> string
|
||||
-(** Return the string representation of a floating-point number. *)
|
||||
+(** Return a string representation of a floating-point number.
|
||||
+
|
||||
+ This conversion can involve a loss of precision. For greater control over
|
||||
+ the manner in which the number is printed, see {!Printf}. *)
|
||||
|
||||
val float_of_string_opt: string -> float option
|
||||
(** Convert the given string to a float. The string is read in decimal
|
||||
@@ -861,7 +864,10 @@ val print_int : int -> unit
|
||||
(** Print an integer, in decimal, on standard output. *)
|
||||
|
||||
val print_float : float -> unit
|
||||
-(** Print a floating-point number, in decimal, on standard output. *)
|
||||
+(** Print a floating-point number, in decimal, on standard output.
|
||||
+
|
||||
+ The conversion of the number to a string uses {!string_of_float} and
|
||||
+ can involve a loss of precision. *)
|
||||
|
||||
val print_endline : string -> unit
|
||||
(** Print a string, followed by a newline character, on
|
||||
@@ -889,7 +895,10 @@ val prerr_int : int -> unit
|
||||
(** Print an integer, in decimal, on standard error. *)
|
||||
|
||||
val prerr_float : float -> unit
|
||||
-(** Print a floating-point number, in decimal, on standard error. *)
|
||||
+(** Print a floating-point number, in decimal, on standard error.
|
||||
+
|
||||
+ The conversion of the number to a string uses {!string_of_float} and
|
||||
+ can involve a loss of precision. *)
|
||||
|
||||
val prerr_endline : string -> unit
|
||||
(** Print a string, followed by a newline character on standard
|
||||
diff --git a/stdlib/templates/float.template.mli b/stdlib/templates/float.template.mli
|
||||
index e35c01809f..e2f7411a02 100644
|
||||
--- a/stdlib/templates/float.template.mli
|
||||
+++ b/stdlib/templates/float.template.mli
|
||||
@@ -178,7 +178,12 @@ val of_string_opt: string -> float option
|
||||
(** Same as [of_string], but returns [None] instead of raising. *)
|
||||
|
||||
val to_string : float -> string
|
||||
-(** Return the string representation of a floating-point number. *)
|
||||
+(** Return a string representation of a floating-point number.
|
||||
+
|
||||
+ This conversion can involve a loss of precision. For greater control over
|
||||
+ the manner in which the number is printed, see {!Printf}.
|
||||
+
|
||||
+ This function is an alias for {!Stdlib.string_of_float}. *)
|
||||
|
||||
type fpclass = Stdlib.fpclass =
|
||||
FP_normal (** Normal number, none of the below *)
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
From 05874f93adc60f16ccd5cbeef1e2ff010cef12c1 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Angeletti <florian.angeletti@inria.fr>
|
||||
Date: Fri, 1 Jul 2022 14:41:25 +0200
|
||||
Subject: [PATCH 07/24] Merge pull request #11380 from
|
||||
damiendoligez/fix-fortran-test-on-macos
|
||||
|
||||
fix gfortran test on Macos
|
||||
|
||||
(cherry picked from commit d7a2e0fa7f2df9bd178109ba9725bb074affbd5c)
|
||||
---
|
||||
testsuite/tests/lib-bigarray-2/has-gfortran.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
|
||||
index 82f7ae8aee..051122113a 100644
|
||||
--- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh
|
||||
+++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
|
||||
@@ -5,6 +5,9 @@ if ! which gfortran > /dev/null 2>&1; then
|
||||
elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then
|
||||
echo "OCaml was not compiled with gcc" > ${ocamltest_response}
|
||||
test_result=${TEST_SKIP}
|
||||
+elif gcc --version 2>&1 | grep 'Apple clang version'; then
|
||||
+ echo "OCaml was not compiled with gcc" > ${ocamltest_response}
|
||||
+ test_result=${TEST_SKIP}
|
||||
else
|
||||
test_result=${TEST_PASS}
|
||||
fi
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
From b9afeb8b8dc8c32f9f1c74c8402de9e6265e9d5f Mon Sep 17 00:00:00 2001
|
||||
From: Xavier Leroy <xavierleroy@users.noreply.github.com>
|
||||
Date: Fri, 1 Jul 2022 17:14:44 +0200
|
||||
Subject: [PATCH 08/24] Refactor the initialization of bytecode threading
|
||||
(#11378)
|
||||
|
||||
Refactor the initialization of bytecode threading
|
||||
|
||||
Use a function `caml_init_thread_code` instead of exposing global variables
|
||||
`caml_instr_table` and `caml_instr_base`.
|
||||
|
||||
This should silence the GCC 12 "dangling-pointer" warning.
|
||||
|
||||
Fixes: #11358
|
||||
---
|
||||
Changes | 5 +++++
|
||||
runtime/caml/fix_code.h | 3 +--
|
||||
runtime/fix_code.c | 10 ++++++++--
|
||||
runtime/interp.c | 7 +++----
|
||||
4 files changed, 17 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 590268262d..7ea4475b8d 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -14,6 +14,11 @@ OCaml 4.14 maintenance branch
|
||||
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
|
||||
Sebastien Hinderer)
|
||||
|
||||
+- #11358, #11378: Refactor the initialization of bytecode threading.
|
||||
+ This avoids a "dangling pointer" warning of GCC 12.1.
|
||||
+ (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
|
||||
+
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
diff --git a/runtime/caml/fix_code.h b/runtime/caml/fix_code.h
|
||||
index 83c393a17d..2eafaa814b 100644
|
||||
--- a/runtime/caml/fix_code.h
|
||||
+++ b/runtime/caml/fix_code.h
|
||||
@@ -34,8 +34,7 @@ void caml_set_instruction (code_t pos, opcode_t instr);
|
||||
int caml_is_instruction (opcode_t instr1, opcode_t instr2);
|
||||
|
||||
#ifdef THREADED_CODE
|
||||
-extern char ** caml_instr_table;
|
||||
-extern char * caml_instr_base;
|
||||
+void caml_init_thread_code(void ** instr_table, void * instr_base);
|
||||
void caml_thread_code (code_t code, asize_t len);
|
||||
#endif
|
||||
|
||||
diff --git a/runtime/fix_code.c b/runtime/fix_code.c
|
||||
index aa059be5df..5584019867 100644
|
||||
--- a/runtime/fix_code.c
|
||||
+++ b/runtime/fix_code.c
|
||||
@@ -82,8 +82,14 @@ void caml_fixup_endianness(code_t code, asize_t len)
|
||||
|
||||
#ifdef THREADED_CODE
|
||||
|
||||
-char ** caml_instr_table;
|
||||
-char * caml_instr_base;
|
||||
+static char ** caml_instr_table;
|
||||
+static char * caml_instr_base;
|
||||
+
|
||||
+void caml_init_thread_code(void ** instr_table, void * instr_base)
|
||||
+{
|
||||
+ caml_instr_table = (char **) instr_table;
|
||||
+ caml_instr_base = (char *) instr_base;
|
||||
+}
|
||||
|
||||
static int* opcode_nargs = NULL;
|
||||
int* caml_init_opcode_nargs(void)
|
||||
diff --git a/runtime/interp.c b/runtime/interp.c
|
||||
index a59811c87d..e6700994bc 100644
|
||||
--- a/runtime/interp.c
|
||||
+++ b/runtime/interp.c
|
||||
@@ -50,9 +50,9 @@ sp is a local copy of the global variable Caml_state->extern_sp. */
|
||||
#ifdef THREADED_CODE
|
||||
# define Instruct(name) lbl_##name
|
||||
# if defined(ARCH_SIXTYFOUR) && !defined(ARCH_CODE32)
|
||||
-# define Jumptbl_base ((char *) &&lbl_ACC0)
|
||||
+# define Jumptbl_base &&lbl_ACC0
|
||||
# else
|
||||
-# define Jumptbl_base ((char *) 0)
|
||||
+# define Jumptbl_base 0
|
||||
# define jumptbl_base ((char *) 0)
|
||||
# endif
|
||||
# ifdef DEBUG
|
||||
@@ -249,8 +249,7 @@ value caml_interprete(code_t prog, asize_t prog_size)
|
||||
|
||||
if (prog == NULL) { /* Interpreter is initializing */
|
||||
#ifdef THREADED_CODE
|
||||
- caml_instr_table = (char **) jumptable;
|
||||
- caml_instr_base = Jumptbl_base;
|
||||
+ caml_init_thread_code(jumptable, Jumptbl_base);
|
||||
#endif
|
||||
return Val_unit;
|
||||
}
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
From 7315c73e283eca4313403e959241d86d63f88d58 Mon Sep 17 00:00:00 2001
|
||||
From: Gabriel Scherer <gabriel.scherer@gmail.com>
|
||||
Date: Tue, 5 Jul 2022 09:27:54 +0200
|
||||
Subject: [PATCH 09/24] Merge pull request #11397 from
|
||||
Octachron/tast_mapper_fix_for_with_modtype
|
||||
|
||||
#11387: clean up envs inside Twith_modtype(subst)
|
||||
|
||||
(cherry picked from commit d9afa408c612e74a266b95f0fa25bb1efde72112)
|
||||
---
|
||||
Changes | 3 +++
|
||||
typing/tast_mapper.ml | 6 +++---
|
||||
2 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 7ea4475b8d..0fe7732a02 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -18,6 +18,9 @@ OCaml 4.14 maintenance branch
|
||||
This avoids a "dangling pointer" warning of GCC 12.1.
|
||||
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
|
||||
|
||||
+- #11387, module type with constraints no longer crash the compiler in presence
|
||||
+ of both shadowing warnings and the `-bin-annot` compiler flag.
|
||||
+ (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
|
||||
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
diff --git a/typing/tast_mapper.ml b/typing/tast_mapper.ml
|
||||
index 6d359a59a7..9eb7f64e88 100644
|
||||
--- a/typing/tast_mapper.ml
|
||||
+++ b/typing/tast_mapper.ml
|
||||
@@ -458,10 +458,10 @@ let module_type sub x =
|
||||
let with_constraint sub = function
|
||||
| Twith_type decl -> Twith_type (sub.type_declaration sub decl)
|
||||
| Twith_typesubst decl -> Twith_typesubst (sub.type_declaration sub decl)
|
||||
+ | Twith_modtype mty -> Twith_modtype (sub.module_type sub mty)
|
||||
+ | Twith_modtypesubst mty -> Twith_modtypesubst (sub.module_type sub mty)
|
||||
| Twith_module _
|
||||
- | Twith_modsubst _
|
||||
- | Twith_modtype _
|
||||
- | Twith_modtypesubst _ as d -> d
|
||||
+ | Twith_modsubst _ as d -> d
|
||||
|
||||
let open_description sub od =
|
||||
{od with open_env = sub.env sub od.open_env}
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
From 9f72a2a2fec0902aeae5e5082779bb197657c1f4 Mon Sep 17 00:00:00 2001
|
||||
From: Gabriel Scherer <gabriel.scherer@gmail.com>
|
||||
Date: Tue, 5 Jul 2022 10:38:50 +0200
|
||||
Subject: [PATCH 10/24] Merge pull request #11396 from gasche/fix11392
|
||||
|
||||
Fix 11392 (assertion failure on external with -rectypes)
|
||||
|
||||
(cherry picked from commit 724cefb8b0f1f96ef5181fffc24975ac9460ce3e)
|
||||
---
|
||||
Changes | 3 ++
|
||||
testsuite/tests/typing-external/pr11392.ml | 34 ++++++++++++++++++++++
|
||||
typing/typedecl.ml | 2 +-
|
||||
3 files changed, 38 insertions(+), 1 deletion(-)
|
||||
create mode 100644 testsuite/tests/typing-external/pr11392.ml
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 0fe7732a02..8182f5ced7 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -22,6 +22,9 @@ OCaml 4.14 maintenance branch
|
||||
of both shadowing warnings and the `-bin-annot` compiler flag.
|
||||
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
|
||||
|
||||
+- #11392, #11392: assertion failure with -rectypes and external definitions
|
||||
+ (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
diff --git a/testsuite/tests/typing-external/pr11392.ml b/testsuite/tests/typing-external/pr11392.ml
|
||||
new file mode 100644
|
||||
index 0000000000..91c8ea77eb
|
||||
--- /dev/null
|
||||
+++ b/testsuite/tests/typing-external/pr11392.ml
|
||||
@@ -0,0 +1,34 @@
|
||||
+(* TEST
|
||||
+ * expect
|
||||
+*)
|
||||
+
|
||||
+type 'self nat =
|
||||
+ | Z
|
||||
+ | S of 'self
|
||||
+;;
|
||||
+[%%expect{|
|
||||
+type 'self nat = Z | S of 'self
|
||||
+|}]
|
||||
+
|
||||
+
|
||||
+
|
||||
+(* without rectypes: rejected *)
|
||||
+external cast : int -> 'self nat as 'self = "%identity"
|
||||
+;;
|
||||
+[%%expect{|
|
||||
+Line 1, characters 16-41:
|
||||
+1 | external cast : int -> 'self nat as 'self = "%identity"
|
||||
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
+Error: This alias is bound to type int -> 'a nat
|
||||
+ but is used as an instance of type 'a
|
||||
+ The type variable 'a occurs inside int -> 'a nat
|
||||
+|}]
|
||||
+
|
||||
+#rectypes;;
|
||||
+
|
||||
+(* with rectypes: accepted (used to crash) *)
|
||||
+external cast : int -> 'self nat as 'self = "%identity"
|
||||
+;;
|
||||
+[%%expect{|
|
||||
+external cast : int -> 'a nat as 'a = "%identity"
|
||||
+|}]
|
||||
diff --git a/typing/typedecl.ml b/typing/typedecl.ml
|
||||
index 9d38ebe97e..d00c0fc450 100644
|
||||
--- a/typing/typedecl.ml
|
||||
+++ b/typing/typedecl.ml
|
||||
@@ -1334,7 +1334,7 @@ let rec parse_native_repr_attributes env core_type ty ~global_repr =
|
||||
parse_native_repr_attributes env ct2 t2 ~global_repr
|
||||
in
|
||||
(repr_arg :: repr_args, repr_res)
|
||||
- | Ptyp_poly (_, t), _, _ ->
|
||||
+ | (Ptyp_poly (_, t) | Ptyp_alias (t, _)), _, _ ->
|
||||
parse_native_repr_attributes env t ty ~global_repr
|
||||
| Ptyp_arrow _, _, _ | _, Tarrow _, _ -> assert false
|
||||
| _ -> ([], make_native_repr env core_type ty ~global_repr)
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
From 9d4faca7af8d9849093ff8d36509ad60608ac239 Mon Sep 17 00:00:00 2001
|
||||
From: Xavier Leroy <xavierleroy@users.noreply.github.com>
|
||||
Date: Thu, 7 Jul 2022 18:22:22 +0200
|
||||
Subject: [PATCH 11/24] Document limitation on `caml_callbackN` (#11409)
|
||||
|
||||
The `args` argument array must not be declared with `CAMLlocalN`, otherwise
|
||||
the array can be registered a second time by `caml_callbackN`, confusing
|
||||
the compactor.
|
||||
|
||||
Also: suggests using a C99 compound literal, it looks good and avoids the issue.
|
||||
|
||||
Fixes: #11045
|
||||
---
|
||||
Changes | 7 +++++++
|
||||
manual/src/cmds/intf-c.etex | 4 ++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 8182f5ced7..13eb7fef98 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -25,6 +25,13 @@ OCaml 4.14 maintenance branch
|
||||
- #11392, #11392: assertion failure with -rectypes and external definitions
|
||||
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
|
||||
|
||||
+### Manual and documentation:
|
||||
+
|
||||
+- #11045, #11409: document that the array argument to `caml_callbackN`
|
||||
+ must not have been declared by `CAMLlocalN`.
|
||||
+ (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.)
|
||||
+
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
diff --git a/manual/src/cmds/intf-c.etex b/manual/src/cmds/intf-c.etex
|
||||
index 7cd50a1372..bb420c2940 100644
|
||||
--- a/manual/src/cmds/intf-c.etex
|
||||
+++ b/manual/src/cmds/intf-c.etex
|
||||
@@ -1449,6 +1449,10 @@ the value \var{a} and returns the value returned by~\var{f}.
|
||||
(a curried OCaml function with three arguments) to \var{a}, \var{b} and \var{c}.
|
||||
\item "caml_callbackN("\var{f, n, args}")" applies the functional value \var{f}
|
||||
to the \var{n} arguments contained in the C array of values \var{args}.
|
||||
+The array \var{args} must \emph{not} be declared with "CAMLlocalN".
|
||||
+It should be declared as "value "\var{args}"["\var{n}"];".
|
||||
+Alternatively, a C99 compound literal can be used:
|
||||
+"caml_callbackN("\var{f, n, }"(value[]){"\nth{arg}{1}, \ldots, \nth{arg}{n}"})".
|
||||
\end{itemize}
|
||||
If the function \var{f} does not return, but raises an exception that
|
||||
escapes the scope of the application, then this exception is
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,327 @@
|
|||
From 50fbd6685ec88f1dc81451923d7c80fb0d18ca8b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= <Sebastien.Hinderer@inria.fr>
|
||||
Date: Thu, 14 Apr 2022 19:19:46 +0200
|
||||
Subject: [PATCH 12/24] Stop calling ranlib on created / installed libraries
|
||||
(#11184)
|
||||
|
||||
`ranlib` seems unnecessary if a POSIX-compliant `ar` is used and time stamps are preserved when a `.a` file is installed.
|
||||
|
||||
(cherry picked from commit c8e41bade529998c4e66975c88fabf3ac47d7078)
|
||||
---
|
||||
Changes | 5 +++++
|
||||
INSTALL.adoc | 4 ++--
|
||||
Makefile | 2 --
|
||||
Makefile.build_config.in | 2 +-
|
||||
Makefile.config.in | 4 ----
|
||||
configure | Bin 581827 -> 581549 bytes
|
||||
configure.ac | 16 +++-------------
|
||||
otherlibs/Makefile.otherlibs.common | 2 --
|
||||
otherlibs/dynlink/Makefile | 11 +++++------
|
||||
otherlibs/systhreads/Makefile | 3 ---
|
||||
stdlib/Makefile | 1 -
|
||||
tools/ocamlmklib.ml | 6 ++----
|
||||
utils/Makefile | 1 -
|
||||
utils/ccomp.ml | 8 ++------
|
||||
utils/config.mli | 3 ---
|
||||
utils/config.mlp | 2 --
|
||||
16 files changed, 20 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 13eb7fef98..6f92ee9965 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -25,6 +25,11 @@ OCaml 4.14 maintenance branch
|
||||
- #11392, #11392: assertion failure with -rectypes and external definitions
|
||||
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
|
||||
|
||||
+### Compiler user-interface and warnings:
|
||||
+
|
||||
+- #11184: Stop calling ranlib on created / installed libraries
|
||||
+ (Sébastien Hinderer, review by Xavier Leroy)
|
||||
+
|
||||
### Manual and documentation:
|
||||
|
||||
- #11045, #11409: document that the array argument to `caml_callbackN`
|
||||
diff --git a/INSTALL.adoc b/INSTALL.adoc
|
||||
index f4199ca49a..08d67ebbbe 100644
|
||||
--- a/INSTALL.adoc
|
||||
+++ b/INSTALL.adoc
|
||||
@@ -43,8 +43,8 @@
|
||||
* Under Cygwin, the `gcc-core` package is required. `flexdll` is also necessary
|
||||
for shared library support.
|
||||
|
||||
-* Binutils including `ar`, `ranlib`, and `strip` are required if your
|
||||
- distribution does not already provide them with the C compiler.
|
||||
+* Binutils including `ar` and `strip` are required if your distribution
|
||||
+ does not already provide them with the C compiler.
|
||||
|
||||
== Configuration
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 3c74bc79df..0e92785da2 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -585,8 +585,6 @@ endif
|
||||
ifeq "$(INSTALL_OCAMLNAT)" "true"
|
||||
$(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)"
|
||||
endif
|
||||
- cd "$(INSTALL_COMPLIBDIR)" && \
|
||||
- $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A)
|
||||
|
||||
# Installation of the *.ml sources of compiler-libs
|
||||
.PHONY: install-compiler-sources
|
||||
diff --git a/Makefile.build_config.in b/Makefile.build_config.in
|
||||
index eeac09dd76..4d6705d252 100644
|
||||
--- a/Makefile.build_config.in
|
||||
+++ b/Makefile.build_config.in
|
||||
@@ -20,7 +20,7 @@
|
||||
# $(ROOTDIR) has been defined.
|
||||
|
||||
include $(ROOTDIR)/Makefile.config
|
||||
-INSTALL ?= @INSTALL@
|
||||
+INSTALL ?= @INSTALL@ -p
|
||||
INSTALL_DATA ?= @INSTALL_DATA@
|
||||
INSTALL_PROG ?= @INSTALL_PROGRAM@
|
||||
|
||||
diff --git a/Makefile.config.in b/Makefile.config.in
|
||||
index eb3d85eb1d..4badb74c3f 100644
|
||||
--- a/Makefile.config.in
|
||||
+++ b/Makefile.config.in
|
||||
@@ -88,10 +88,6 @@ LDFLAGS?=@LDFLAGS@
|
||||
### How to invoke the C preprocessor through the C compiler
|
||||
CPP=@CPP@
|
||||
|
||||
-### How to invoke ranlib
|
||||
-RANLIB=@RANLIB@
|
||||
-RANLIBCMD=@RANLIBCMD@
|
||||
-
|
||||
### How to invoke ar
|
||||
ARCMD=@AR@
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 8a2c007fd221bc897a255b4aa80c7f23710fcb10..73ce66bfa0a3de5e886a88c973b2db288b5e4d03 100755
|
||||
GIT binary patch
|
||||
delta 91
|
||||
zcmX?nP<ics<qdoN*n%AWd_0{t@9~pl+59Z%$Itc$K8!%j1jNih%(DG~59<!M=|*j=
|
||||
q!qe@iu=Y&nn98a>-EJyt==60{S#P(`nZ^plY(UJuea<uvbuR!x+b0D8
|
||||
|
||||
delta 343
|
||||
zcmZ3xU-|Gs<qdoNHXremU=av%^z-p_a`tuMg0ME<4*L1C{gMwO5HkTWGZ3?EzvRQZ
|
||||
z%gt0-!L_2KC^5MtGcR2sGcPT_C^xYrGe1uuttdZNAty7bBtJh#y;vbRKQApay|f4{
|
||||
zIlXW-lc=kLwL(coYMz1>mx2P^N?Ror2wRCOHK#ZgE(H{K3{og6R<cG`tHd?E;VQet
|
||||
z^!bxndn_ROY*jQu{QZ3bf?VA+ixTsIE&!ULjHC%ee!AKeRs(K@#Jm&*h=%E5Q&>YK
|
||||
zU>4b?CTHZsIKV)ezG4dNJs|}(H3gMwh?TVpF)A8{?X6Q;ftU@5*|)b&<<Rf~05Vo_
|
||||
ARR910
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 2f4ebf9b30..13d6d1a326 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -119,8 +119,6 @@ AC_SUBST([bootstrapping_flexdll])
|
||||
AC_SUBST([long_shebang])
|
||||
AC_SUBST([shebangscripts])
|
||||
AC_SUBST([AR])
|
||||
-AC_SUBST([RANLIB])
|
||||
-AC_SUBST([RANLIBCMD])
|
||||
AC_SUBST([mklib])
|
||||
AC_SUBST([supports_shared_libraries])
|
||||
AC_SUBST([natdynlink])
|
||||
@@ -474,32 +472,24 @@ AS_CASE([$enable_dependency_generation],
|
||||
[compute_deps=true])],
|
||||
[compute_deps=false])])
|
||||
|
||||
-# Extracting information from libtool's configuration
|
||||
-AS_IF([test -n "$RANLIB" ],
|
||||
- [RANLIBCMD="$RANLIB"],
|
||||
- [RANLIB="$AR rs"; RANLIBCMD=""]
|
||||
-)
|
||||
-
|
||||
AS_CASE([$host],
|
||||
# In config/Makefile.mingw*, we had:
|
||||
# TARGET=i686-w64-mingw32 and x86_64-w64-mingw32
|
||||
# TOOLPREF=$(TARGET)-
|
||||
# ARCMD=$(TOOLPREF)ar
|
||||
- # RANLIB=$(TOOLPREF)ranlib
|
||||
- # RANLIBCMD=$(TOOLPREF)ranlib
|
||||
- # However autoconf and libtool seem to use ar and ranlib
|
||||
+ # However autoconf and libtool seem to use ar
|
||||
# So we let them do, at the moment
|
||||
[*-pc-windows],
|
||||
[
|
||||
libext=lib
|
||||
- AR=""; RANLIB=echo; RANLIBCMD=""
|
||||
+ AR=""
|
||||
AS_IF([test "$host_cpu" = "x86_64" ],
|
||||
[machine="-machine:AMD64 "],
|
||||
[machine=""])
|
||||
mklib="link -lib -nologo $machine /out:\$(1) \$(2)"
|
||||
],
|
||||
[
|
||||
- mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2) && ${RANLIB} \$(1)"
|
||||
+ mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2)"
|
||||
])
|
||||
|
||||
## Find vendor of the C compiler
|
||||
diff --git a/otherlibs/Makefile.otherlibs.common b/otherlibs/Makefile.otherlibs.common
|
||||
index 95ff4d58fe..17c8e2dfd7 100644
|
||||
--- a/otherlibs/Makefile.otherlibs.common
|
||||
+++ b/otherlibs/Makefile.otherlibs.common
|
||||
@@ -95,7 +95,6 @@ install::
|
||||
fi
|
||||
ifneq "$(STUBSLIB)" ""
|
||||
$(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/"
|
||||
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A)
|
||||
endif
|
||||
|
||||
$(INSTALL_DATA) \
|
||||
@@ -115,7 +114,6 @@ installopt:
|
||||
$(INSTALL_DATA) \
|
||||
$(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \
|
||||
"$(INSTALL_LIBDIR)/"
|
||||
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a
|
||||
if test -f $(LIBNAME).cmxs; then \
|
||||
$(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \
|
||||
fi
|
||||
diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile
|
||||
index 6b02dc1979..c21bf573da 100644
|
||||
--- a/otherlibs/dynlink/Makefile
|
||||
+++ b/otherlibs/dynlink/Makefile
|
||||
@@ -249,12 +249,11 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
|
||||
endif
|
||||
|
||||
installopt:
|
||||
- if $(NATDYNLINK); then \
|
||||
- $(INSTALL_DATA) \
|
||||
- $(NATOBJS) dynlink.cmxa dynlink.$(A) \
|
||||
- "$(INSTALL_LIBDIR)" && \
|
||||
- cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \
|
||||
- fi
|
||||
+ifeq "$(strip $(NATDYNLINK))" "true"
|
||||
+ $(INSTALL_DATA) \
|
||||
+ $(NATOBJS) dynlink.cmxa dynlink.$(A) \
|
||||
+ "$(INSTALL_LIBDIR)"
|
||||
+endif
|
||||
|
||||
partialclean:
|
||||
rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \
|
||||
diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
|
||||
index 8fc1bdb926..640a7666a8 100644
|
||||
--- a/otherlibs/systhreads/Makefile
|
||||
+++ b/otherlibs/systhreads/Makefile
|
||||
@@ -121,7 +121,6 @@ install:
|
||||
$(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \
|
||||
fi
|
||||
$(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
|
||||
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
|
||||
mkdir -p "$(INSTALL_THREADSLIBDIR)"
|
||||
$(INSTALL_DATA) \
|
||||
$(CMIFILES) threads.cma \
|
||||
@@ -136,11 +135,9 @@ endif
|
||||
|
||||
installopt:
|
||||
$(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)"
|
||||
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A)
|
||||
$(INSTALL_DATA) \
|
||||
$(THREADS_NCOBJS) threads.cmxa threads.$(A) \
|
||||
"$(INSTALL_THREADSLIBDIR)"
|
||||
- cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A)
|
||||
|
||||
%.cmi: %.mli
|
||||
$(CAMLC) -c $(COMPFLAGS) $<
|
||||
diff --git a/stdlib/Makefile b/stdlib/Makefile
|
||||
index df34bc2d49..f367956fbd 100644
|
||||
--- a/stdlib/Makefile
|
||||
+++ b/stdlib/Makefile
|
||||
@@ -105,7 +105,6 @@ installopt-default::
|
||||
$(INSTALL_DATA) \
|
||||
stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx \
|
||||
"$(INSTALL_LIBDIR)"
|
||||
- cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.$(A)
|
||||
|
||||
ifeq "$(UNIX_OR_WIN32)" "unix"
|
||||
HEADERPROGRAM = header
|
||||
diff --git a/tools/ocamlmklib.ml b/tools/ocamlmklib.ml
|
||||
index 0ca7b80f3b..48f636bc10 100644
|
||||
--- a/tools/ocamlmklib.ml
|
||||
+++ b/tools/ocamlmklib.ml
|
||||
@@ -25,10 +25,8 @@ let mklib out files opts =
|
||||
then "-machine:AMD64 "
|
||||
else ""
|
||||
in
|
||||
- Printf.sprintf "link -lib -nologo %s-out:%s %s %s"
|
||||
- machine out opts files
|
||||
- else Printf.sprintf "%s rcs %s %s %s && %s %s"
|
||||
- Config.ar out opts files Config.ranlib out
|
||||
+ Printf.sprintf "link -lib -nologo %s-out:%s %s %s" machine out opts files
|
||||
+ else Printf.sprintf "%s rc %s %s %s" Config.ar out opts files
|
||||
|
||||
(* PR#4783: under Windows, don't use absolute paths because we do
|
||||
not know where the binary distribution will be installed. *)
|
||||
diff --git a/utils/Makefile b/utils/Makefile
|
||||
index 7231fae28e..de923900f1 100644
|
||||
--- a/utils/Makefile
|
||||
+++ b/utils/Makefile
|
||||
@@ -73,7 +73,6 @@ config.ml: config.mlp $(ROOTDIR)/Makefile.config Makefile
|
||||
$(call SUBST_STRING,OCAMLOPT_CPPFLAGS) \
|
||||
$(call SUBST_STRING,PACKLD) \
|
||||
$(call SUBST,PROFINFO_WIDTH) \
|
||||
- $(call SUBST_STRING,RANLIBCMD) \
|
||||
$(call SUBST_STRING,RPATH) \
|
||||
$(call SUBST_STRING,MKSHAREDLIBRPATH) \
|
||||
$(call SUBST,FORCE_SAFE_STRING) \
|
||||
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
|
||||
index 955968d1cd..d23c3f2baa 100644
|
||||
--- a/utils/ccomp.ml
|
||||
+++ b/utils/ccomp.ml
|
||||
@@ -140,12 +140,8 @@ let create_archive archive file_list =
|
||||
quoted_archive (quote_files file_list))
|
||||
| _ ->
|
||||
assert(String.length Config.ar > 0);
|
||||
- let r1 =
|
||||
- command(Printf.sprintf "%s rc %s %s"
|
||||
- Config.ar quoted_archive (quote_files file_list)) in
|
||||
- if r1 <> 0 || String.length Config.ranlib = 0
|
||||
- then r1
|
||||
- else command(Config.ranlib ^ " " ^ quoted_archive)
|
||||
+ command(Printf.sprintf "%s rc %s %s"
|
||||
+ Config.ar quoted_archive (quote_files file_list))
|
||||
|
||||
let expand_libname cclibs =
|
||||
cclibs |> List.map (fun cclib ->
|
||||
diff --git a/utils/config.mli b/utils/config.mli
|
||||
index 7f70a52d52..94dee3cb92 100644
|
||||
--- a/utils/config.mli
|
||||
+++ b/utils/config.mli
|
||||
@@ -82,9 +82,6 @@ val mkexe: string
|
||||
val mkmaindll: string
|
||||
(** The linker command line to build main programs as dlls. *)
|
||||
|
||||
-val ranlib: string
|
||||
-(** Command to randomize a library, or "" if not needed *)
|
||||
-
|
||||
val default_rpath: string
|
||||
(** Option to add a directory to be searched for libraries at runtime
|
||||
(used by ocamlmklib) *)
|
||||
diff --git a/utils/config.mlp b/utils/config.mlp
|
||||
index 44c6ff8fa5..f758a9b483 100644
|
||||
--- a/utils/config.mlp
|
||||
+++ b/utils/config.mlp
|
||||
@@ -54,7 +54,6 @@ let native_c_compiler =
|
||||
c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags
|
||||
let native_c_libraries = "%%NATIVECCLIBS%%"
|
||||
let native_pack_linker = "%%PACKLD%%"
|
||||
-let ranlib = "%%RANLIBCMD%%"
|
||||
let default_rpath = "%%RPATH%%"
|
||||
let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%"
|
||||
let ar = "%%ARCMD%%"
|
||||
@@ -177,7 +176,6 @@ let configuration_variables =
|
||||
p "bytecomp_c_libraries" bytecomp_c_libraries;
|
||||
p "native_c_libraries" native_c_libraries;
|
||||
p "native_pack_linker" native_pack_linker;
|
||||
- p "ranlib" ranlib;
|
||||
p "architecture" architecture;
|
||||
p "model" model;
|
||||
p_int "int_size" Sys.int_size;
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From c04f2fbb3ae4dc8f67882bfe35d8565f016dee0f Mon Sep 17 00:00:00 2001
|
||||
From: Xavier Leroy <xavier.leroy@college-de-france.fr>
|
||||
Date: Fri, 15 Jul 2022 14:23:10 +0200
|
||||
Subject: [PATCH 13/24] tests/lib-bigarray-2/has-gfortran.sh: don't print
|
||||
anything on stdout
|
||||
|
||||
It confuses the summarize.awk script.
|
||||
---
|
||||
testsuite/tests/lib-bigarray-2/has-gfortran.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
|
||||
index 051122113a..7eef1e662e 100644
|
||||
--- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh
|
||||
+++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh
|
||||
@@ -5,7 +5,7 @@ if ! which gfortran > /dev/null 2>&1; then
|
||||
elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then
|
||||
echo "OCaml was not compiled with gcc" > ${ocamltest_response}
|
||||
test_result=${TEST_SKIP}
|
||||
-elif gcc --version 2>&1 | grep 'Apple clang version'; then
|
||||
+elif gcc --version 2>&1 | grep -q 'Apple clang version'; then
|
||||
echo "OCaml was not compiled with gcc" > ${ocamltest_response}
|
||||
test_result=${TEST_SKIP}
|
||||
else
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
From 4bb84be29e2ea5eb9f979c5e3bcbde1933aa300e Mon Sep 17 00:00:00 2001
|
||||
From: Florian Angeletti <florian.angeletti@inria.fr>
|
||||
Date: Mon, 18 Jul 2022 10:08:53 +0200
|
||||
Subject: [PATCH 14/24] Merge pull request #11417 from
|
||||
lpw25/fix-virtual-class-type-constrs
|
||||
|
||||
Fix regression allowing virtual methods in non-virtual classes
|
||||
|
||||
(cherry picked from commit 4be851ed8ea1f0c6be13dce04dcc97493c6c004b)
|
||||
---
|
||||
Changes | 13 +-----
|
||||
testsuite/tests/typing-objects/Tests.ml | 61 +++++++++++++++++++++++++
|
||||
typing/typeclass.ml | 11 +++++
|
||||
3 files changed, 74 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 6f92ee9965..a9a9ee92f4 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -25,17 +25,8 @@ OCaml 4.14 maintenance branch
|
||||
- #11392, #11392: assertion failure with -rectypes and external definitions
|
||||
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
|
||||
|
||||
-### Compiler user-interface and warnings:
|
||||
-
|
||||
-- #11184: Stop calling ranlib on created / installed libraries
|
||||
- (Sébastien Hinderer, review by Xavier Leroy)
|
||||
-
|
||||
-### Manual and documentation:
|
||||
-
|
||||
-- #11045, #11409: document that the array argument to `caml_callbackN`
|
||||
- must not have been declared by `CAMLlocalN`.
|
||||
- (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.)
|
||||
-
|
||||
+- #11417: Fix regression allowing virtual methods in non-virtual classes.
|
||||
+ (Leo White, review by Florian Angeletti)
|
||||
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml
|
||||
index 3dcd87c43c..9cab28e432 100644
|
||||
--- a/testsuite/tests/typing-objects/Tests.ml
|
||||
+++ b/testsuite/tests/typing-objects/Tests.ml
|
||||
@@ -1344,3 +1344,64 @@ let _ = (new foo)#f true
|
||||
class foo : object method f : bool -> bool end
|
||||
- : bool = true
|
||||
|}];;
|
||||
+
|
||||
+
|
||||
+class c : object
|
||||
+ method virtual m : int
|
||||
+end = object
|
||||
+ method m = 9
|
||||
+ end
|
||||
+[%%expect {|
|
||||
+Lines 1-3, characters 10-3:
|
||||
+1 | ..........object
|
||||
+2 | method virtual m : int
|
||||
+3 | end.........
|
||||
+Error: This non-virtual class type has virtual methods.
|
||||
+ The following methods are virtual : m
|
||||
+|}];;
|
||||
+
|
||||
+class virtual c : object
|
||||
+ method virtual m : int
|
||||
+end = object
|
||||
+ method m = 42
|
||||
+ end
|
||||
+[%%expect {|
|
||||
+class virtual c : object method virtual m : int end
|
||||
+|}];;
|
||||
+
|
||||
+class virtual cv = object
|
||||
+ method virtual m : int
|
||||
+ end
|
||||
+
|
||||
+class c : cv = object
|
||||
+ method m = 42
|
||||
+ end
|
||||
+[%%expect {|
|
||||
+class virtual cv : object method virtual m : int end
|
||||
+Line 5, characters 10-12:
|
||||
+5 | class c : cv = object
|
||||
+ ^^
|
||||
+Error: This non-virtual class type has virtual methods.
|
||||
+ The following methods are virtual : m
|
||||
+|}];;
|
||||
+
|
||||
+class virtual c : cv = object
|
||||
+ method m = 41
|
||||
+ end
|
||||
+[%%expect {|
|
||||
+class virtual c : cv
|
||||
+|}];;
|
||||
+
|
||||
+class c = cv
|
||||
+[%%expect {|
|
||||
+Line 1, characters 10-12:
|
||||
+1 | class c = cv
|
||||
+ ^^
|
||||
+Error: This non-virtual class has virtual methods.
|
||||
+ The following methods are virtual : m
|
||||
+|}];;
|
||||
+
|
||||
+class virtual c = cv
|
||||
+[%%expect {|
|
||||
+class virtual c : cv
|
||||
+|}];;
|
||||
diff --git a/typing/typeclass.ml b/typing/typeclass.ml
|
||||
index fedbc0e025..8fa8523cc9 100644
|
||||
--- a/typing/typeclass.ml
|
||||
+++ b/typing/typeclass.ml
|
||||
@@ -177,6 +177,13 @@ let check_virtual loc env virt kind sign =
|
||||
| meths, vars ->
|
||||
raise(Error(loc, env, Virtual_class(kind, meths, vars)))
|
||||
|
||||
+let rec check_virtual_clty loc env virt kind clty =
|
||||
+ match clty with
|
||||
+ | Cty_constr(_, _, clty) | Cty_arrow(_, _, clty) ->
|
||||
+ check_virtual_clty loc env virt kind clty
|
||||
+ | Cty_signature sign ->
|
||||
+ check_virtual loc env virt kind sign
|
||||
+
|
||||
(* Return the constructor type associated to a class type *)
|
||||
let rec constructor_type constr cty =
|
||||
match cty with
|
||||
@@ -398,6 +405,8 @@ and class_type_aux env virt self_scope scty =
|
||||
) styl params
|
||||
in
|
||||
let typ = Cty_constr (path, params, clty) in
|
||||
+ (* Check for unexpected virtual methods *)
|
||||
+ check_virtual_clty scty.pcty_loc env virt Class_type typ;
|
||||
cltyp (Tcty_constr ( path, lid , ctys)) typ
|
||||
|
||||
| Pcty_signature pcsig ->
|
||||
@@ -1077,6 +1086,8 @@ and class_expr_aux cl_num val_env met_env virt self_scope scl =
|
||||
try Ctype.unify val_env ty' ty with Ctype.Unify err ->
|
||||
raise(Error(cty'.ctyp_loc, val_env, Parameter_mismatch err)))
|
||||
tyl params;
|
||||
+ (* Check for unexpected virtual methods *)
|
||||
+ check_virtual_clty scl.pcl_loc val_env virt Class clty';
|
||||
let cl =
|
||||
rc {cl_desc = Tcl_ident (path, lid, tyl);
|
||||
cl_loc = scl.pcl_loc;
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
From 54eef17aeecfdbc6eeecd60b9cc64cd7c0129429 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Angeletti <florian.angeletti@inria.fr>
|
||||
Date: Wed, 20 Jul 2022 10:58:18 +0200
|
||||
Subject: [PATCH 15/24] Do not elide the whole module type error message
|
||||
(#11416)
|
||||
|
||||
(cherry picked from commit 8218be9e2b24907b8558776a34d12032bcc42496)
|
||||
---
|
||||
Changes | 5 +-
|
||||
.../inclusion_errors_elision.ml | 93 +++++++++++++++++++
|
||||
typing/includemod_errorprinter.ml | 11 ++-
|
||||
3 files changed, 107 insertions(+), 2 deletions(-)
|
||||
create mode 100644 testsuite/tests/typing-modules/inclusion_errors_elision.ml
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index a9a9ee92f4..6b9855f707 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -14,7 +14,10 @@ OCaml 4.14 maintenance branch
|
||||
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
|
||||
Sebastien Hinderer)
|
||||
|
||||
-- #11358, #11378: Refactor the initialization of bytecode threading.
|
||||
+- #11314, #11416: fix non-informative error message for module inclusion
|
||||
+ (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
|
||||
+
|
||||
+- #11358, #11379: Refactor the initialization of bytecode threading,
|
||||
This avoids a "dangling pointer" warning of GCC 12.1.
|
||||
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
|
||||
|
||||
diff --git a/testsuite/tests/typing-modules/inclusion_errors_elision.ml b/testsuite/tests/typing-modules/inclusion_errors_elision.ml
|
||||
new file mode 100644
|
||||
index 0000000000..3dbd0e67ff
|
||||
--- /dev/null
|
||||
+++ b/testsuite/tests/typing-modules/inclusion_errors_elision.ml
|
||||
@@ -0,0 +1,93 @@
|
||||
+(* TEST
|
||||
+ flags ="-keep-original-error-size"
|
||||
+ * expect
|
||||
+ *)
|
||||
+
|
||||
+
|
||||
+module A = struct
|
||||
+ type a and b and c and d
|
||||
+end
|
||||
+
|
||||
+module type S = sig
|
||||
+ module B = A
|
||||
+end
|
||||
+
|
||||
+module C : S = struct
|
||||
+ module B = struct
|
||||
+ type a and b and c and d and e and f and g and h
|
||||
+ end
|
||||
+end
|
||||
+[%%expect {|
|
||||
+module A : sig type a and b and c and d end
|
||||
+module type S = sig module B = A end
|
||||
+Lines 9-13, characters 15-3:
|
||||
+ 9 | ...............struct
|
||||
+10 | module B = struct
|
||||
+11 | type a and b and c and d and e and f and g and h
|
||||
+12 | end
|
||||
+13 | end
|
||||
+Error: Signature mismatch:
|
||||
+ ...
|
||||
+ In module B:
|
||||
+ Modules do not match:
|
||||
+ sig
|
||||
+ type a = B.a
|
||||
+ and b = B.b
|
||||
+ and c = B.c
|
||||
+ and d = B.d
|
||||
+ and e = B.e
|
||||
+ and f = B.f
|
||||
+ and g = B.g
|
||||
+ and h = B.h
|
||||
+ end
|
||||
+ is not included in
|
||||
+ (module A)
|
||||
+|}]
|
||||
+
|
||||
+module A = struct
|
||||
+ type a and b and c and d
|
||||
+end
|
||||
+
|
||||
+module type S = sig
|
||||
+ module type B = sig
|
||||
+ module C = A
|
||||
+ end
|
||||
+end
|
||||
+
|
||||
+module D : S = struct
|
||||
+ module type B = sig
|
||||
+ module C: sig
|
||||
+ type a and b and c and d and e and f and g and h
|
||||
+ end
|
||||
+ end
|
||||
+end
|
||||
+[%%expect{|
|
||||
+module A : sig type a and b and c and d end
|
||||
+module type S = sig module type B = sig module C = A end end
|
||||
+Lines 11-17, characters 15-3:
|
||||
+11 | ...............struct
|
||||
+12 | module type B = sig
|
||||
+13 | module C: sig
|
||||
+14 | type a and b and c and d and e and f and g and h
|
||||
+15 | end
|
||||
+16 | end
|
||||
+17 | end
|
||||
+Error: Signature mismatch:
|
||||
+ ...
|
||||
+ ...
|
||||
+ ...
|
||||
+ At position module type B = sig module C : <here> end
|
||||
+ Modules do not match:
|
||||
+ sig
|
||||
+ type a = C.a
|
||||
+ and b = C.b
|
||||
+ and c = C.c
|
||||
+ and d = C.d
|
||||
+ and e = C.e
|
||||
+ and f = C.f
|
||||
+ and g = C.g
|
||||
+ and h = C.h
|
||||
+ end
|
||||
+ is not included in
|
||||
+ (module A)
|
||||
+|}]
|
||||
diff --git a/typing/includemod_errorprinter.ml b/typing/includemod_errorprinter.ml
|
||||
index 24d452fddc..b719e1627d 100644
|
||||
--- a/typing/includemod_errorprinter.ml
|
||||
+++ b/typing/includemod_errorprinter.ml
|
||||
@@ -709,7 +709,16 @@ let rec module_type ~expansion_token ~eqmode ~env ~before ~ctx diff =
|
||||
functor_params ~expansion_token ~env ~before ~ctx d
|
||||
| _ ->
|
||||
let inner = if eqmode then eq_module_types else module_types in
|
||||
- let next = dwith_context_and_elision ctx inner diff in
|
||||
+ let next =
|
||||
+ match diff.symptom with
|
||||
+ | Mt_core _ ->
|
||||
+ (* In those cases, the refined error messages for the current error
|
||||
+ will at most add some minor comments on the current error.
|
||||
+ It is thus better to avoid eliding the current error message.
|
||||
+ *)
|
||||
+ dwith_context ctx (inner diff)
|
||||
+ | _ -> dwith_context_and_elision ctx inner diff
|
||||
+ in
|
||||
let before = next :: before in
|
||||
module_type_symptom ~eqmode ~expansion_token ~env ~before ~ctx
|
||||
diff.symptom
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
From 4d316cbe4b564be3aa57b969acf9ba03910dcba4 Mon Sep 17 00:00:00 2001
|
||||
From: David Allsopp <david.allsopp@metastack.com>
|
||||
Date: Sat, 30 Jul 2022 11:51:12 +0200
|
||||
Subject: [PATCH 16/24] Merge pull request #11373 from dra27/flexlink-detect
|
||||
|
||||
Don't use CFLAGS when testing flexlink
|
||||
|
||||
(cherry picked from commit 004d313ce4fdb071d0aeda8736b9e74bb6c6a21b)
|
||||
---
|
||||
Changes | 6 ++++++
|
||||
aclocal.m4 | 1 +
|
||||
configure | Bin 581549 -> 581563 bytes
|
||||
3 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 6b9855f707..99907b950a 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -1,6 +1,12 @@
|
||||
OCaml 4.14 maintenance branch
|
||||
-----------------------------
|
||||
|
||||
+### Build system:
|
||||
+
|
||||
+- #11370, #11373: Don't pass CFLAGS to flexlink during configure.
|
||||
+ (David Allsopp, report by William Hu, review by Xavier Leroy and
|
||||
+ Sébastien Hinderer)
|
||||
+
|
||||
### Bug fixes:
|
||||
|
||||
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
|
||||
diff --git a/aclocal.m4 b/aclocal.m4
|
||||
index 7e49468e48..2bc0a1dcc9 100644
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -328,6 +328,7 @@ AC_DEFUN([OCAML_TEST_FLEXLINK], [
|
||||
CC="$1 -chain $2 -exe"
|
||||
LIBS="conftest2.$ac_objext"
|
||||
CPPFLAGS="$3 $CPPFLAGS"
|
||||
+ CFLAGS=""
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_SOURCE([int main() { return 0; }])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
diff --git a/configure b/configure
|
||||
index 73ce66bfa0a3de5e886a88c973b2db288b5e4d03..c0dde03f183f86677b22a81238defdba60ad0080 100755
|
||||
GIT binary patch
|
||||
delta 57
|
||||
zcmZ3xUwQX_<%Sl<7N!>F7M3lnkFIk%yZJb}2iqzsO&46x?lIl3ot?8??*=OnvjH*t
|
||||
KcD)-M_3Qv?gA|zn
|
||||
|
||||
delta 47
|
||||
zcmdnJUwQ3*<%Sl<7N!>F7M3lnkFHM-Tg~P?U2ZNbN4xb6Rv=~rV)pIUH#i#D0n)${
|
||||
AvH$=8
|
||||
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
From defecc867a0b5653554c41b06e78c0f24f6c10a8 Mon Sep 17 00:00:00 2001
|
||||
From: David Allsopp <david.allsopp@metastack.com>
|
||||
Date: Tue, 2 Aug 2022 17:21:08 +0100
|
||||
Subject: [PATCH 17/24] Merge pull request #11468 from dra27/i686-mingw-ipv6
|
||||
|
||||
Fix detection of IPv6 on mingw-w64 i686
|
||||
|
||||
(cherry picked from commit 98392895940cc1c18534280ae001b70fa5bf24c2)
|
||||
---
|
||||
Changes | 4 ++++
|
||||
configure | Bin 581563 -> 581611 bytes
|
||||
configure.ac | 1 +
|
||||
3 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 99907b950a..6b537edca9 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -37,6 +37,10 @@ OCaml 4.14 maintenance branch
|
||||
- #11417: Fix regression allowing virtual methods in non-virtual classes.
|
||||
(Leo White, review by Florian Angeletti)
|
||||
|
||||
+- #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for
|
||||
+ mingw-w64 i686 port.
|
||||
+ (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index c0dde03f183f86677b22a81238defdba60ad0080..536a1cbee58a430692bfa3de11901e7e2f6b4ee2 100755
|
||||
GIT binary patch
|
||||
delta 53
|
||||
zcmdnJU-|WZ<%Sl<7N!>F7M2#)7Pc+y(YK}x+-47$p3}xEG`-+2o7nVsH`#OBfnwVQ
|
||||
JZgZ?=0RTku6-595
|
||||
|
||||
delta 53
|
||||
zcmV-50LuUCzazW9BY=bfgaU*Egam{Iga)(+TiTa!+Xo<*Y=#9AmvH?C7MJeX2fc@o
|
||||
L+XuIh+X!0(RZ<pp
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 13d6d1a326..ebb8bbdb80 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2016,6 +2016,7 @@ AS_CASE([$host],
|
||||
[*-*-mingw32],
|
||||
[AC_DEFINE([HAS_BROKEN_PRINTF])
|
||||
AC_DEFINE([HAS_STRERROR])
|
||||
+ AC_DEFINE([HAS_IPV6])
|
||||
AC_DEFINE([HAS_NICE])],
|
||||
[*-pc-windows],
|
||||
[AC_DEFINE([HAS_BROKEN_PRINTF])
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
From 1c4df0352d5f75464acdb27377ccd10d1e0ba10a Mon Sep 17 00:00:00 2001
|
||||
From: Xavier Leroy <xavierleroy@users.noreply.github.com>
|
||||
Date: Mon, 22 Aug 2022 16:06:50 +0200
|
||||
Subject: [PATCH 18/24] More prudent deallocation of alternate signal stack
|
||||
(#11496)
|
||||
|
||||
After `caml_setup_stack_overflow_detection` is called,
|
||||
a C library can install its own alternate stack for signal handling.
|
||||
|
||||
Therefore, `caml_stop_stack_overflow_detection` must not free the
|
||||
alternate signal stack block, only the block that
|
||||
`caml_setup_stack_overflow_detection` allocated.
|
||||
|
||||
Fixes: #11489
|
||||
---
|
||||
Changes | 4 +++
|
||||
otherlibs/systhreads/st_stubs.c | 5 ++--
|
||||
runtime/caml/signals.h | 4 +--
|
||||
runtime/signals_byt.c | 4 +--
|
||||
runtime/signals_nat.c | 47 +++++++++++++++++++++------------
|
||||
5 files changed, 41 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 6b537edca9..4d1bb10435 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -41,6 +41,10 @@ OCaml 4.14 maintenance branch
|
||||
mingw-w64 i686 port.
|
||||
(David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
|
||||
|
||||
+- #11489, #11496: More prudent deallocation of alternate signal stack
|
||||
+ (Xavier Leroy, report by @rajdakin, review by Florian Angeletti)
|
||||
+
|
||||
+
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
|
||||
diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c
|
||||
index b7a6a9a6bb..043e07031e 100644
|
||||
--- a/otherlibs/systhreads/st_stubs.c
|
||||
+++ b/otherlibs/systhreads/st_stubs.c
|
||||
@@ -524,6 +524,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
|
||||
{
|
||||
caml_thread_t th = (caml_thread_t) arg;
|
||||
value clos;
|
||||
+ void * signal_stack;
|
||||
#ifdef NATIVE_CODE
|
||||
struct longjmp_buffer termination_buf;
|
||||
char tos;
|
||||
@@ -536,7 +537,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
|
||||
/* Acquire the global mutex */
|
||||
caml_leave_blocking_section();
|
||||
st_thread_set_id(Ident(th->descr));
|
||||
- caml_setup_stack_overflow_detection();
|
||||
+ signal_stack = caml_setup_stack_overflow_detection();
|
||||
#ifdef NATIVE_CODE
|
||||
/* Setup termination handler (for caml_thread_exit) */
|
||||
if (sigsetjmp(termination_buf.buf, 0) == 0) {
|
||||
@@ -550,7 +551,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
|
||||
#ifdef NATIVE_CODE
|
||||
}
|
||||
#endif
|
||||
- caml_stop_stack_overflow_detection();
|
||||
+ caml_stop_stack_overflow_detection(signal_stack);
|
||||
/* The thread now stops running */
|
||||
return 0;
|
||||
}
|
||||
diff --git a/runtime/caml/signals.h b/runtime/caml/signals.h
|
||||
index c6aeebfc78..62b0e7fafa 100644
|
||||
--- a/runtime/caml/signals.h
|
||||
+++ b/runtime/caml/signals.h
|
||||
@@ -87,8 +87,8 @@ value caml_do_pending_actions_exn (void);
|
||||
value caml_process_pending_actions_with_root (value extra_root); // raises
|
||||
value caml_process_pending_actions_with_root_exn (value extra_root);
|
||||
int caml_set_signal_action(int signo, int action);
|
||||
-CAMLextern int caml_setup_stack_overflow_detection(void);
|
||||
-CAMLextern int caml_stop_stack_overflow_detection(void);
|
||||
+CAMLextern void * caml_setup_stack_overflow_detection(void);
|
||||
+CAMLextern int caml_stop_stack_overflow_detection(void *);
|
||||
CAMLextern void caml_init_signals(void);
|
||||
CAMLextern void caml_terminate_signals(void);
|
||||
CAMLextern void (*caml_enter_blocking_section_hook)(void);
|
||||
diff --git a/runtime/signals_byt.c b/runtime/signals_byt.c
|
||||
index 439fb56404..7cb461ac4d 100644
|
||||
--- a/runtime/signals_byt.c
|
||||
+++ b/runtime/signals_byt.c
|
||||
@@ -81,7 +81,7 @@ int caml_set_signal_action(int signo, int action)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; }
|
||||
-CAMLexport int caml_stop_stack_overflow_detection(void) { return 0; }
|
||||
+CAMLexport void * caml_setup_stack_overflow_detection(void) { return NULL; }
|
||||
+CAMLexport int caml_stop_stack_overflow_detection(void * p) { return 0; }
|
||||
CAMLexport void caml_init_signals(void) { }
|
||||
CAMLexport void caml_terminate_signals(void) { }
|
||||
diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c
|
||||
index 443f5d53b6..1dd8289c12 100644
|
||||
--- a/runtime/signals_nat.c
|
||||
+++ b/runtime/signals_nat.c
|
||||
@@ -254,6 +254,10 @@ DECLARE_SIGNAL_HANDLER(segv_handler)
|
||||
|
||||
/* Initialization of signal stuff */
|
||||
|
||||
+#ifdef HAS_STACK_OVERFLOW_DETECTION
|
||||
+static void * caml_signal_stack = NULL;
|
||||
+#endif
|
||||
+
|
||||
void caml_init_signals(void)
|
||||
{
|
||||
/* Bound-check trap handling */
|
||||
@@ -278,7 +282,8 @@ void caml_init_signals(void)
|
||||
#endif
|
||||
|
||||
#ifdef HAS_STACK_OVERFLOW_DETECTION
|
||||
- if (caml_setup_stack_overflow_detection() != -1) {
|
||||
+ caml_signal_stack = caml_setup_stack_overflow_detection();
|
||||
+ if (caml_signal_stack != NULL) {
|
||||
struct sigaction act;
|
||||
SET_SIGACT(act, segv_handler);
|
||||
act.sa_flags |= SA_ONSTACK | SA_NODEFER;
|
||||
@@ -314,7 +319,8 @@ void caml_terminate_signals(void)
|
||||
|
||||
#ifdef HAS_STACK_OVERFLOW_DETECTION
|
||||
set_signal_default(SIGSEGV);
|
||||
- caml_stop_stack_overflow_detection();
|
||||
+ caml_stop_stack_overflow_detection(caml_signal_stack);
|
||||
+ caml_signal_stack = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -323,37 +329,44 @@ void caml_terminate_signals(void)
|
||||
Each thread needs its own alternate stack.
|
||||
The alternate stack used to be statically-allocated for the main thread,
|
||||
but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
|
||||
- may not be a compile-time constant (issue #10250). */
|
||||
+ may not be a compile-time constant (issue #10250).
|
||||
+ Return the dynamically-allocated alternate signal stack, or NULL
|
||||
+ if an error occurred.
|
||||
+ The returned pointer must be passed to [caml_stop_stack_overflow_detection].
|
||||
+*/
|
||||
|
||||
-CAMLexport int caml_setup_stack_overflow_detection(void)
|
||||
+CAMLexport void * caml_setup_stack_overflow_detection(void)
|
||||
{
|
||||
#ifdef HAS_STACK_OVERFLOW_DETECTION
|
||||
stack_t stk;
|
||||
- stk.ss_sp = malloc(SIGSTKSZ);
|
||||
- if (stk.ss_sp == NULL) return -1;
|
||||
stk.ss_size = SIGSTKSZ;
|
||||
+ stk.ss_sp = malloc(stk.ss_size);
|
||||
+ if (stk.ss_sp == NULL) return NULL;
|
||||
stk.ss_flags = 0;
|
||||
if (sigaltstack(&stk, NULL) == -1) {
|
||||
free(stk.ss_sp);
|
||||
- return -1;
|
||||
+ return NULL;
|
||||
}
|
||||
+ return stk.ss_sp;
|
||||
+#else
|
||||
+ return NULL;
|
||||
#endif
|
||||
- /* Success (or stack overflow detection not available) */
|
||||
- return 0;
|
||||
}
|
||||
|
||||
-CAMLexport int caml_stop_stack_overflow_detection(void)
|
||||
+CAMLexport int caml_stop_stack_overflow_detection(void * signal_stack)
|
||||
{
|
||||
#ifdef HAS_STACK_OVERFLOW_DETECTION
|
||||
stack_t oldstk, stk;
|
||||
stk.ss_flags = SS_DISABLE;
|
||||
+ stk.ss_sp = NULL; /* not required but avoids a valgrind false alarm */
|
||||
+ stk.ss_size = SIGSTKSZ; /* macOS wants a valid size here */
|
||||
if (sigaltstack(&stk, &oldstk) == -1) return -1;
|
||||
- /* If caml_setup_stack_overflow_detection failed, we are not using
|
||||
- an alternate signal stack. SS_DISABLE will be set in oldstk,
|
||||
- and there is nothing to free in this case. */
|
||||
- if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
|
||||
- return 0;
|
||||
-#else
|
||||
- return 0;
|
||||
+ /* Check whether someone else installed their own signal stack */
|
||||
+ if (!(oldstk.ss_flags & SS_DISABLE) && oldstk.ss_sp != signal_stack) {
|
||||
+ /* Re-activate their signal stack. */
|
||||
+ sigaltstack(&oldstk, NULL);
|
||||
+ }
|
||||
+ free(signal_stack);
|
||||
#endif
|
||||
+ return 0;
|
||||
}
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
From a4633757e352b30f136d2a1cda827289d826ddc0 Mon Sep 17 00:00:00 2001
|
||||
From: David Allsopp <david.allsopp@metastack.com>
|
||||
Date: Thu, 25 Aug 2022 08:44:47 +0100
|
||||
Subject: [PATCH 19/24] Merge pull request #11487 from
|
||||
purplearmadillo77/fma_test
|
||||
|
||||
Thwart FMA test optimization during configure
|
||||
|
||||
(cherry picked from commit cd7dc7f6b9b5353acc2aa70bdc7bbecff56634d0)
|
||||
---
|
||||
Changes | 3 +++
|
||||
aclocal.m4 | 2 +-
|
||||
configure | Bin 581611 -> 581620 bytes
|
||||
3 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 4d1bb10435..763c0fa4b7 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -7,6 +7,9 @@ OCaml 4.14 maintenance branch
|
||||
(David Allsopp, report by William Hu, review by Xavier Leroy and
|
||||
Sébastien Hinderer)
|
||||
|
||||
+- #11???: Thwart FMA test optimization during configure
|
||||
+ (William Hu, review by ???)
|
||||
+
|
||||
### Bug fixes:
|
||||
|
||||
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
|
||||
diff --git a/aclocal.m4 b/aclocal.m4
|
||||
index 2bc0a1dcc9..addb0d8bbf 100644
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -440,7 +440,7 @@ int main (void) {
|
||||
broken implementations of Cygwin64, mingw-w64 (x86_64) and VS2013-2017.
|
||||
The static volatile variables aim to thwart GCC's constant folding. */
|
||||
static volatile double x, y, z;
|
||||
- double t264, t265, t266;
|
||||
+ volatile double t264, t265, t266;
|
||||
x = 0x3.bd5b7dde5fddap-496;
|
||||
y = 0x3.bd5b7dde5fddap-496;
|
||||
z = -0xd.fc352bc352bap-992;
|
||||
diff --git a/configure b/configure
|
||||
index 536a1cbee58a430692bfa3de11901e7e2f6b4ee2..1a1dd61863e0435952ba6d6baf8131e68f070b3d 100755
|
||||
GIT binary patch
|
||||
delta 44
|
||||
zcmaF8U-`>^<%Sl<7N!>F7M2#)Eo_r#a+KxgB$j06q_$6*$p*yi+b7NBh;#!0qIVJx
|
||||
|
||||
delta 35
|
||||
qcmeyeU-|WZ<%Sl<7N!>F7M2#)Eo_r#w$GW#2E^>!=gj1Ya037qBM!s>
|
||||
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
From 19f5ef04dc344a82a3831f4b16f0be75c813dbf6 Mon Sep 17 00:00:00 2001
|
||||
From: David Allsopp <david.allsopp@metastack.com>
|
||||
Date: Thu, 25 Aug 2022 08:48:34 +0100
|
||||
Subject: [PATCH 20/24] Fixup Changes
|
||||
|
||||
---
|
||||
Changes | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 763c0fa4b7..92d0837eb6 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -7,8 +7,8 @@ OCaml 4.14 maintenance branch
|
||||
(David Allsopp, report by William Hu, review by Xavier Leroy and
|
||||
Sébastien Hinderer)
|
||||
|
||||
-- #11???: Thwart FMA test optimization during configure
|
||||
- (William Hu, review by ???)
|
||||
+- #11487: Thwart FMA test optimization during configure
|
||||
+ (William Hu, review by David Allsopp and Sébastien Hinderer)
|
||||
|
||||
### Bug fixes:
|
||||
|
||||
@@ -21,7 +21,7 @@ OCaml 4.14 maintenance branch
|
||||
before using it to ensure that the headers can always be used in code which
|
||||
turns on -Wundef (or equivalent).
|
||||
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
|
||||
- Sebastien Hinderer)
|
||||
+ Sébastien Hinderer)
|
||||
|
||||
- #11314, #11416: fix non-informative error message for module inclusion
|
||||
(Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
From e6dfa704c0f7847fe8e7a2a153714b4075019a0f Mon Sep 17 00:00:00 2001
|
||||
From: Chris Casinghino <chris.casinghino@gmail.com>
|
||||
Date: Fri, 2 Sep 2022 10:28:55 -0400
|
||||
Subject: [PATCH 21/24] Fix [@deprecated_mutable], which couldn't be triggered.
|
||||
(#11524)
|
||||
|
||||
Fixes #11516
|
||||
|
||||
(cherry picked from commit 024ca164ab844a9be94e0675bb5a1693bab7c08f)
|
||||
---
|
||||
Changes | 2 ++
|
||||
.../warnings/deprecated_mutable.compilers.reference | 4 ++++
|
||||
testsuite/tests/warnings/deprecated_mutable.ml | 13 +++++++++++++
|
||||
typing/env.ml | 9 ++++++++-
|
||||
4 files changed, 27 insertions(+), 1 deletion(-)
|
||||
create mode 100644 testsuite/tests/warnings/deprecated_mutable.compilers.reference
|
||||
create mode 100644 testsuite/tests/warnings/deprecated_mutable.ml
|
||||
|
||||
diff --git a/Changes b/Changes
|
||||
index 92d0837eb6..aa8880ad07 100644
|
||||
--- a/Changes
|
||||
+++ b/Changes
|
||||
@@ -47,6 +47,8 @@ OCaml 4.14 maintenance branch
|
||||
- #11489, #11496: More prudent deallocation of alternate signal stack
|
||||
(Xavier Leroy, report by @rajdakin, review by Florian Angeletti)
|
||||
|
||||
+- #11516, #11524: Fix the `deprecated_mutable` attribute.
|
||||
+ (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)
|
||||
|
||||
OCaml 4.14.0 (28 March 2022)
|
||||
----------------------------
|
||||
diff --git a/testsuite/tests/warnings/deprecated_mutable.compilers.reference b/testsuite/tests/warnings/deprecated_mutable.compilers.reference
|
||||
new file mode 100644
|
||||
index 0000000000..620dc57de9
|
||||
--- /dev/null
|
||||
+++ b/testsuite/tests/warnings/deprecated_mutable.compilers.reference
|
||||
@@ -0,0 +1,4 @@
|
||||
+File "deprecated_mutable.ml", line 13, characters 11-12:
|
||||
+13 | let () = y.x <- 42
|
||||
+ ^
|
||||
+Alert deprecated: mutating field x
|
||||
diff --git a/testsuite/tests/warnings/deprecated_mutable.ml b/testsuite/tests/warnings/deprecated_mutable.ml
|
||||
new file mode 100644
|
||||
index 0000000000..78fb12ac41
|
||||
--- /dev/null
|
||||
+++ b/testsuite/tests/warnings/deprecated_mutable.ml
|
||||
@@ -0,0 +1,13 @@
|
||||
+(* TEST
|
||||
+
|
||||
+flags = "-w +A-70"
|
||||
+
|
||||
+* bytecode
|
||||
+
|
||||
+*)
|
||||
+
|
||||
+type t = {mutable x : int [@deprecated_mutable]}
|
||||
+
|
||||
+let y : t = {x = 5}
|
||||
+
|
||||
+let () = y.x <- 42
|
||||
diff --git a/typing/env.ml b/typing/env.ml
|
||||
index 06b99f4159..29d7cdb0e4 100644
|
||||
--- a/typing/env.ml
|
||||
+++ b/typing/env.ml
|
||||
@@ -104,6 +104,10 @@ let add_label_usage lu usage =
|
||||
lu.lu_mutation <- true;
|
||||
lu.lu_construct <- true
|
||||
|
||||
+let is_mutating_label_usage = function
|
||||
+ | Mutation -> true
|
||||
+ | (Projection | Construct | Exported_private | Exported) -> false
|
||||
+
|
||||
let label_usages () =
|
||||
{lu_projection = false; lu_mutation = false; lu_construct = false}
|
||||
|
||||
@@ -2723,7 +2727,10 @@ let use_cltype ~use ~loc path desc =
|
||||
let use_label ~use ~loc usage env lbl =
|
||||
if use then begin
|
||||
mark_label_description_used usage env lbl;
|
||||
- Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name
|
||||
+ Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name;
|
||||
+ if is_mutating_label_usage usage then
|
||||
+ Builtin_attributes.check_deprecated_mutable loc lbl.lbl_attributes
|
||||
+ lbl.lbl_name
|
||||
end
|
||||
|
||||
let use_constructor_desc ~use ~loc usage env cstr =
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From e5312a9c481f91f2ca2cae1dc4176a78baaebf40 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 24 Jun 2014 10:00:15 +0100
|
||||
Subject: [PATCH 22/24] Don't add rpaths to libraries.
|
||||
|
||||
---
|
||||
utils/config.mlp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/utils/config.mlp b/utils/config.mlp
|
||||
index f758a9b483..ee17a737dc 100644
|
||||
--- a/utils/config.mlp
|
||||
+++ b/utils/config.mlp
|
||||
@@ -54,8 +54,8 @@ let native_c_compiler =
|
||||
c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags
|
||||
let native_c_libraries = "%%NATIVECCLIBS%%"
|
||||
let native_pack_linker = "%%PACKLD%%"
|
||||
-let default_rpath = "%%RPATH%%"
|
||||
-let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%"
|
||||
+let default_rpath = ""
|
||||
+let mksharedlibrpath = ""
|
||||
let ar = "%%ARCMD%%"
|
||||
let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%%
|
||||
let mkdll, mkexe, mkmaindll =
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
|
@ -1,27 +1,27 @@
|
|||
From 8cc56a1515816c9cef84694e63eaed63a0474090 Mon Sep 17 00:00:00 2001
|
||||
From 2501cd8b3c40188e5eb6dd2158d61cfa023236c2 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 29 May 2012 20:44:18 +0100
|
||||
Subject: [PATCH 2/5] configure: Allow user defined C compiler flags.
|
||||
Subject: [PATCH 23/24] configure: Allow user defined C compiler flags.
|
||||
|
||||
---
|
||||
configure.ac | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f5d8a2687..ad5b701bd 100644
|
||||
index ebb8bbdb80..9e6c0b9745 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -553,6 +553,10 @@ AS_CASE([$host],
|
||||
internal_cflags="$gcc_warnings"],
|
||||
@@ -680,6 +680,10 @@ AS_CASE([$host],
|
||||
internal_cflags="$cc_warnings"],
|
||||
[common_cflags="-O"])])
|
||||
|
||||
+# Allow CFLAGS and LDFLAGS to be added.
|
||||
+common_cflags="$common_cflags $CFLAGS"
|
||||
+oc_ldflags="$oc_ldflags $LDFLAGS"
|
||||
+cclibs="$cclibs $LDFLAGS"
|
||||
+
|
||||
internal_cppflags="-DCAML_NAME_SPACE $internal_cppflags"
|
||||
|
||||
# Enable SSE2 on x86 mingw to avoid using 80-bit registers.
|
||||
--
|
||||
2.22.0.rc3
|
||||
2.37.0.rc2
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From 8e9ee6f765273d2c385b590a593e784472753d87 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 26 Jan 2022 15:47:02 +0000
|
||||
Subject: [PATCH 24/24] configure: Only use OC_* for building executables
|
||||
|
||||
Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for
|
||||
"package notes" which contains build paths.
|
||||
|
||||
In any case it seems pointless having both the OC_* variables and also
|
||||
including the regular CFLAGS/LDFLAGS. Give me full control over what
|
||||
ocamlopt uses.
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 9e6c0b9745..cab4cbd579 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -37,7 +37,7 @@ CONFIGURE_ARGS="$*"
|
||||
# at the moment they are not taken into account on Windows, because
|
||||
# flexlink, which is used to build executables on this platform, can
|
||||
# not handle them.
|
||||
-mkexe="\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_LDFLAGS) \$(LDFLAGS)"
|
||||
+mkexe="\$(CC) \$(OC_CFLAGS) \$(OC_LDFLAGS)"
|
||||
|
||||
# Flags for building executable files with debugging symbols
|
||||
mkexedebugflag="-g"
|
||||
--
|
||||
2.37.0.rc2
|
||||
|
315
ocaml.spec
315
ocaml.spec
|
@ -1,3 +1,6 @@
|
|||
# Don't add -Wl,-dT,<build dir>
|
||||
%undefine _package_note_flags
|
||||
|
||||
# OCaml has a bytecode backend that works on anything with a C
|
||||
# compiler, and a native code backend available on a subset of
|
||||
# architectures. A further subset of architectures support native
|
||||
|
@ -17,29 +20,29 @@
|
|||
|
||||
# These are all the architectures that the tests run on. The tests
|
||||
# take a long time to run, so don't run them on slow machines.
|
||||
%global test_arches aarch64 %{power64} x86_64
|
||||
%global test_arches aarch64 %{power64} riscv64 x86_64
|
||||
# These are the architectures for which the tests must pass otherwise
|
||||
# the build will fail.
|
||||
#%global test_arches_required aarch64 ppc64le x86_64
|
||||
#global test_arches_required aarch64 ppc64le x86_64
|
||||
%global test_arches_required NONE
|
||||
|
||||
# Architectures where parallel builds fail.
|
||||
#%global no_parallel_build_arches aarch64
|
||||
#global no_parallel_build_arches aarch64
|
||||
|
||||
#global rcver +git
|
||||
%global rcver %{nil}
|
||||
#global rcver +rc2
|
||||
|
||||
Name: ocaml
|
||||
Version: 4.08.1
|
||||
Release: 1%{?dist}
|
||||
Version: 4.14.0
|
||||
Release: 5%{?dist}
|
||||
|
||||
Summary: OCaml compiler and programming environment
|
||||
|
||||
License: QPL and (LGPLv2+ with exceptions)
|
||||
|
||||
URL: http://www.ocaml.org
|
||||
URL: https://www.ocaml.org
|
||||
|
||||
Source0: http://caml.inria.fr/pub/distrib/ocaml-4.08/ocaml-%{version}%{rcver}.tar.xz
|
||||
Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# IMPORTANT NOTE:
|
||||
#
|
||||
|
@ -50,22 +53,42 @@ Source0: http://caml.inria.fr/pub/distrib/ocaml-4.08/ocaml-%{version}%{rc
|
|||
#
|
||||
# https://pagure.io/fedora-ocaml
|
||||
#
|
||||
# Current branch: fedora-32-4.08.1
|
||||
# Current branch: fedora-38-4.14.0
|
||||
#
|
||||
# ALTERNATIVELY add a patch to the end of the list (leaving the
|
||||
# existing patches unchanged) adding a comment to note that it should
|
||||
# be incorporated into the git repo at a later time.
|
||||
#
|
||||
|
||||
# Fedora-specific downstream patches.
|
||||
Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch
|
||||
Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch
|
||||
Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch
|
||||
# Out of tree patch for RISC-V support.
|
||||
# https://github.com/nojb/riscv-ocaml
|
||||
Patch0004: 0004-Add-RISC-V-backend.patch
|
||||
Patch0005: 0005-riscv-Emit-debug-info.patch
|
||||
# Patches added after 4.14.0 was released
|
||||
Patch0001: 0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch
|
||||
Patch0002: 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch
|
||||
Patch0003: 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch
|
||||
Patch0004: 0004-Changes.patch
|
||||
Patch0005: 0005-Guard-more-instances-of-undefined-_MSC_VER.patch
|
||||
Patch0006: 0006-Better-documentation-for-string_of_float-.-11353.patch
|
||||
Patch0007: 0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch
|
||||
Patch0008: 0008-Refactor-the-initialization-of-bytecode-threading-11.patch
|
||||
Patch0009: 0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch
|
||||
Patch0010: 0010-Merge-pull-request-11396-from-gasche-fix11392.patch
|
||||
Patch0011: 0011-Document-limitation-on-caml_callbackN-11409.patch
|
||||
Patch0012: 0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch
|
||||
Patch0013: 0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch
|
||||
Patch0014: 0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch
|
||||
Patch0015: 0015-Do-not-elide-the-whole-module-type-error-message-114.patch
|
||||
Patch0016: 0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch
|
||||
Patch0017: 0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch
|
||||
Patch0018: 0018-More-prudent-deallocation-of-alternate-signal-stack-.patch
|
||||
Patch0019: 0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch
|
||||
Patch0020: 0020-Fixup-Changes.patch
|
||||
Patch0021: 0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch
|
||||
|
||||
# Fedora-specific patches
|
||||
Patch0022: 0022-Don-t-add-rpaths-to-libraries.patch
|
||||
Patch0023: 0023-configure-Allow-user-defined-C-compiler-flags.patch
|
||||
Patch0024: 0024-configure-Only-use-OC_-for-building-executables.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: git
|
||||
BuildRequires: gcc
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: binutils-devel
|
||||
|
@ -74,25 +97,19 @@ BuildRequires: gdbm-devel
|
|||
BuildRequires: gawk
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: util-linux
|
||||
BuildRequires: libICE-devel
|
||||
BuildRequires: libSM-devel
|
||||
BuildRequires: libX11-devel
|
||||
BuildRequires: libXaw-devel
|
||||
BuildRequires: libXext-devel
|
||||
BuildRequires: libXft-devel
|
||||
BuildRequires: libXmu-devel
|
||||
BuildRequires: libXrender-devel
|
||||
BuildRequires: libXt-devel
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: /usr/bin/annocheck
|
||||
|
||||
# ocamlopt runs gcc to link binaries. Because Fedora includes
|
||||
# hardening flags automatically, redhat-rpm-config is also required.
|
||||
Requires: gcc
|
||||
Requires: redhat-rpm-config
|
||||
|
||||
# Because we pass -c flag to ocaml-find-requires (to avoid circular
|
||||
# dependencies) we also have to explicitly depend on the right version
|
||||
# of ocaml-runtime.
|
||||
Requires: ocaml-runtime = %{version}-%{release}
|
||||
Requires: ocaml-runtime%{?_isa} = %{version}-%{release}
|
||||
|
||||
# Bundles an MD5 implementation in byterun/md5.{c,h}
|
||||
# Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c
|
||||
Provides: bundled(md5-plumb)
|
||||
|
||||
Provides: ocaml(compiler) = %{version}
|
||||
|
@ -126,25 +143,16 @@ bytecode.
|
|||
|
||||
%package source
|
||||
Summary: Source code for OCaml libraries
|
||||
Requires: ocaml = %{version}-%{release}
|
||||
Requires: ocaml%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description source
|
||||
Source code for OCaml libraries.
|
||||
|
||||
|
||||
%package x11
|
||||
Summary: X11 support for OCaml
|
||||
Requires: ocaml-runtime = %{version}-%{release}
|
||||
Requires: libX11-devel
|
||||
|
||||
%description x11
|
||||
X11 support for OCaml.
|
||||
|
||||
|
||||
%package ocamldoc
|
||||
Summary: Documentation generator for OCaml
|
||||
Requires: ocaml = %{version}-%{release}
|
||||
Provides: ocamldoc
|
||||
Requires: ocaml%{?_isa} = %{version}-%{release}
|
||||
Provides: ocamldoc = %{version}
|
||||
|
||||
%description ocamldoc
|
||||
Documentation generator for OCaml.
|
||||
|
@ -164,7 +172,7 @@ This package contains man pages.
|
|||
|
||||
%package compiler-libs
|
||||
Summary: Compiler libraries for OCaml
|
||||
Requires: ocaml = %{version}-%{release}
|
||||
Requires: ocaml%{?_isa} = %{version}-%{release}
|
||||
|
||||
|
||||
%description compiler-libs
|
||||
|
@ -178,28 +186,41 @@ may not be portable between versions.
|
|||
|
||||
|
||||
%prep
|
||||
%setup -q -T -b 0 -n %{name}-%{version}%{rcver}
|
||||
%autopatch -p1
|
||||
%autosetup -S git -n %{name}-%{version}%{rcver}
|
||||
# Patches touch configure.ac, so rebuild it:
|
||||
autoconf --force
|
||||
|
||||
|
||||
%build
|
||||
%ifnarch %{no_parallel_build_arches}
|
||||
make="make %{?_smp_mflags}"
|
||||
make="%make_build"
|
||||
%else
|
||||
unset MAKEFLAGS
|
||||
make=make
|
||||
%endif
|
||||
|
||||
# Don't use %%configure macro because it sets --build, --host which
|
||||
# breaks some incorrect assumptions made by OCaml's configure.ac
|
||||
#
|
||||
# See also:
|
||||
# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2O4HBOK6PTQZAFAVIRDVMZGG2PYB2QHM/
|
||||
# https://github.com/ocaml/ocaml/issues/8647
|
||||
#
|
||||
# We set --libdir to the unusual directory because we want OCaml to
|
||||
# install its libraries and other files into a subdirectory.
|
||||
#
|
||||
# Force --host because of:
|
||||
# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2O4HBOK6PTQZAFAVIRDVMZGG2PYB2QHM/
|
||||
%configure \
|
||||
# OC_CFLAGS/OC_LDFLAGS control what flags OCaml passes to the linker
|
||||
# when doing final linking of OCaml binaries. Setting these is
|
||||
# necessary to ensure that generated binaries have Fedora hardening
|
||||
# features.
|
||||
./configure \
|
||||
--prefix=%{_prefix} \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--libdir=%{_libdir}/ocaml \
|
||||
--host=`./config/gnu/config.guess`
|
||||
OC_CFLAGS="$CFLAGS" \
|
||||
OC_LDFLAGS="$LDFLAGS" \
|
||||
%{nil}
|
||||
$make world
|
||||
%if %{native_compiler}
|
||||
$make opt
|
||||
|
@ -208,41 +229,50 @@ $make opt.opt
|
|||
|
||||
|
||||
%check
|
||||
%ifarch %{test_arches}
|
||||
cd testsuite
|
||||
%ifarch %{ocaml_native_compiler}
|
||||
# For information only, compile a binary and dump the annocheck data
|
||||
# from it. Useful so we know if hardening is being enabled, but don't
|
||||
# fail because not every hardening feature can be enabled here.
|
||||
echo 'print_endline "hello, world"' > hello.ml
|
||||
./ocamlopt.opt -verbose -I stdlib hello.ml -o hello ||:
|
||||
annocheck -v hello ||:
|
||||
%endif
|
||||
|
||||
%ifarch %{test_arches}
|
||||
make ocamltest
|
||||
%ifarch %{ocaml_native_compiler}
|
||||
make ocamltest.opt
|
||||
%endif
|
||||
%ifarch %{test_arches_required}
|
||||
make -j1 all
|
||||
make -j1 tests
|
||||
%else
|
||||
make -j1 all ||:
|
||||
make -j1 tests ||:
|
||||
%endif
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
%make_install
|
||||
perl -pi -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf
|
||||
|
||||
echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release
|
||||
|
||||
# Remove rpaths from stublibs .so files.
|
||||
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so
|
||||
# Remove the installed documentation. We will install it using %%doc
|
||||
rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml
|
||||
|
||||
find $RPM_BUILD_ROOT -name .ignore -delete
|
||||
|
||||
# Remove .cmt and .cmti files, for now. We could package them later.
|
||||
# See also: http://www.ocamlpro.com/blog/2012/08/20/ocamlpro-and-4.00.0.html
|
||||
find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
|
||||
# Remove this file. It's only created in certain situations and it's
|
||||
# unclear why it is created at all.
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata
|
||||
|
||||
|
||||
%files
|
||||
%doc LICENSE
|
||||
%license LICENSE
|
||||
%{_bindir}/ocaml
|
||||
|
||||
%{_bindir}/ocamlcmt
|
||||
%{_bindir}/ocamldebug
|
||||
%{_bindir}/ocaml-instr-graph
|
||||
%{_bindir}/ocaml-instr-report
|
||||
#{_bindir}/ocaml-instr-graph
|
||||
#{_bindir}/ocaml-instr-report
|
||||
%{_bindir}/ocamlyacc
|
||||
|
||||
# symlink to either .byte or .opt version
|
||||
|
@ -286,12 +316,11 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
|
|||
%{_bindir}/ocamlopt.opt
|
||||
%endif
|
||||
|
||||
#%{_libdir}/ocaml/addlabels
|
||||
#%{_libdir}/ocaml/scrapelabels
|
||||
#%%{_libdir}/ocaml/addlabels
|
||||
#%%{_libdir}/ocaml/scrapelabels
|
||||
%{_libdir}/ocaml/camlheader
|
||||
%{_libdir}/ocaml/camlheader_ur
|
||||
%{_libdir}/ocaml/expunge
|
||||
%{_libdir}/ocaml/extract_crc
|
||||
%{_libdir}/ocaml/ld.conf
|
||||
%{_libdir}/ocaml/Makefile.config
|
||||
%{_libdir}/ocaml/*.a
|
||||
|
@ -306,9 +335,7 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
|
|||
%endif
|
||||
%{_libdir}/ocaml/*.mli
|
||||
%{_libdir}/ocaml/libcamlrun_shared.so
|
||||
%{_libdir}/ocaml/objinfo_helper
|
||||
%{_libdir}/ocaml/vmthreads/*.mli
|
||||
%{_libdir}/ocaml/vmthreads/*.a
|
||||
#%%{_libdir}/ocaml/objinfo_helper
|
||||
%{_libdir}/ocaml/threads/*.mli
|
||||
%if %{native_compiler}
|
||||
%{_libdir}/ocaml/threads/*.a
|
||||
|
@ -316,45 +343,37 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
|
|||
%{_libdir}/ocaml/threads/*.cmx
|
||||
%endif
|
||||
%{_libdir}/ocaml/caml
|
||||
%exclude %{_libdir}/ocaml/graphicsX11.mli
|
||||
|
||||
|
||||
%files runtime
|
||||
%doc README.adoc LICENSE Changes
|
||||
%doc README.adoc Changes
|
||||
%license LICENSE
|
||||
%{_bindir}/ocamlrun
|
||||
%{_bindir}/ocamlrund
|
||||
%{_bindir}/ocamlruni
|
||||
%dir %{_libdir}/ocaml
|
||||
%{_libdir}/ocaml/VERSION
|
||||
#%%{_libdir}/ocaml/VERSION
|
||||
%{_libdir}/ocaml/*.cmo
|
||||
%{_libdir}/ocaml/*.cmi
|
||||
%{_libdir}/ocaml/*.cma
|
||||
%{_libdir}/ocaml/camlheaderd
|
||||
%{_libdir}/ocaml/camlheaderi
|
||||
%{_libdir}/ocaml/stublibs
|
||||
%{_libdir}/ocaml/target_camlheaderd
|
||||
%{_libdir}/ocaml/target_camlheaderi
|
||||
%dir %{_libdir}/ocaml/vmthreads
|
||||
%{_libdir}/ocaml/vmthreads/*.cmi
|
||||
%{_libdir}/ocaml/vmthreads/*.cma
|
||||
%dir %{_libdir}/ocaml/threads
|
||||
%{_libdir}/ocaml/threads/*.cmi
|
||||
%{_libdir}/ocaml/threads/*.cma
|
||||
%{_libdir}/ocaml/fedora-ocaml-release
|
||||
%exclude %{_libdir}/ocaml/graphicsX11.cmi
|
||||
|
||||
|
||||
%files source
|
||||
%doc LICENSE
|
||||
%license LICENSE
|
||||
%{_libdir}/ocaml/*.ml
|
||||
|
||||
|
||||
%files x11
|
||||
%doc LICENSE
|
||||
%{_libdir}/ocaml/graphicsX11.cmi
|
||||
%{_libdir}/ocaml/graphicsX11.mli
|
||||
%{_libdir}/ocaml/*.cmt*
|
||||
%{_libdir}/ocaml/*/*.cmt*
|
||||
|
||||
|
||||
%files ocamldoc
|
||||
%doc LICENSE
|
||||
%license LICENSE
|
||||
%doc ocamldoc/Changes.txt
|
||||
%{_bindir}/ocamldoc*
|
||||
%{_libdir}/ocaml/ocamldoc
|
||||
|
@ -366,7 +385,7 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
|
|||
|
||||
|
||||
%files compiler-libs
|
||||
%doc LICENSE
|
||||
%license LICENSE
|
||||
%dir %{_libdir}/ocaml/compiler-libs
|
||||
%{_libdir}/ocaml/compiler-libs/*.mli
|
||||
%{_libdir}/ocaml/compiler-libs/*.cmi
|
||||
|
@ -381,6 +400,124 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete
|
|||
|
||||
|
||||
%changelog
|
||||
* Mon Jan 23 2023 Richard W.M. Jones <rjones@redhat.com> - 4.14.0-5
|
||||
- Rebuild OCaml packages for F38
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.14.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Mon Sep 5 2022 Richard W.M. Jones <rjones@redhat.com> - 4.14.0-3
|
||||
- Include more upstream patches from 4.14 branch
|
||||
|
||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.14.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Sat Jun 18 2022 Richard W.M. Jones <rjones@redhat.com> - 4.14.0-1
|
||||
- New upstream version 4.14.0
|
||||
|
||||
* Thu Jun 9 2022 Jerry James <loganjerry@gmail.com> - 4.13.1-4
|
||||
- Fix the Source0 URL
|
||||
- chrpath is no longer needed
|
||||
- Use the %%license macro
|
||||
- Build the test binaries so the tests will run
|
||||
|
||||
* Fri Feb 04 2022 Richard W.M. Jones <rjones@redhat.com> - 4.13.1-4
|
||||
- Rebuild 4.13.1 to remove package notes
|
||||
|
||||
* Wed Jan 26 2022 Richard W.M. Jones <rjones@redhat.com> - 4.13.1-3
|
||||
- Disable package note misfeature
|
||||
- Remove duplicate flags from mkexe
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.13.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Mon Oct 04 2021 Richard W.M. Jones <rjones@redhat.com> - 4.13.1-1
|
||||
- New upstream version 4.13.1
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.12.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Wed Jun 23 2021 Richard W.M. Jones <rjones@redhat.com> - 4.12.0-2
|
||||
- Move to final version of upstream patch for non-constant SIGSTKSZ
|
||||
|
||||
* Sun Feb 28 2021 Richard W.M. Jones <rjones@redhat.com> - 4.12.0-1
|
||||
- OCaml 4.12.0 release (RHBZ#1893381).
|
||||
- Workaround for glibc non-constant SIGSTKSZ
|
||||
(https://github.com/ocaml/ocaml/issues/10250)
|
||||
- Package *.cmt and *.cmti files.
|
||||
- Remove objinfo_helper since it is no longer built.
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Sep 01 2020 Richard W.M. Jones <rjones@redhat.com> - 4.11.1-1
|
||||
- OCaml 4.11.1 release (RHBZ#1870368#c26).
|
||||
|
||||
* Fri Aug 21 2020 Richard W.M. Jones <rjones@redhat.com> - 4.11.0-1
|
||||
- OCaml 4.11.0 release (RHBZ#1870368).
|
||||
|
||||
* Tue Aug 04 2020 Richard W.M. Jones <rjones@redhat.com> - 4.11.0-0.9.dev2
|
||||
- Bump and rebuild to fix DWARF versioning issues.
|
||||
- Enable LTO again.
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-0.7.dev2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 4.11.0-0.6.dev2
|
||||
- Use make macros
|
||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||
|
||||
* Wed Jul 01 2020 Jeff Law <law@redhat.com> - 4.11.0-0.5.dev2.fc33
|
||||
- Disable LTO
|
||||
|
||||
* Mon May 04 2020 Richard W.M. Jones <rjones@redhat.com> - 4.11.0-0.4.dev2.fc33
|
||||
- Move to OCaml 4.11.0+dev2-2020-04-22.
|
||||
- Backport upstream RISC-V backend from 4.12 + fixes.
|
||||
- Enable tests on riscv64.
|
||||
- Disable ocaml-instr-* tools on riscv64.
|
||||
|
||||
* Tue Apr 21 2020 Richard W.M. Jones <rjones@redhat.com> - 4.11.0-0.3.pre.fc33
|
||||
- Add fixes for various issues found in the previous build.
|
||||
|
||||
* Fri Apr 17 2020 Richard W.M. Jones <rjones@redhat.com> - 4.11.0-0.2.pre.fc33
|
||||
- Move to OCaml 4.11.0 pre-release with support for RISC-V.
|
||||
|
||||
* Sat Apr 11 2020 Richard W.M. Jones <rjones@redhat.com> - 4.10.0-4.fc33
|
||||
- Fix RISC-V backend.
|
||||
|
||||
* Thu Apr 02 2020 Richard W.M. Jones <rjones@redhat.com> - 4.10.0-3.fc33
|
||||
- Update all OCaml dependencies for RPM 4.16.
|
||||
|
||||
* Thu Feb 27 2020 Richard W.M. Jones <rjones@redhat.com> - 4.10.0-2.fc33
|
||||
- Add dist tag.
|
||||
|
||||
* Tue Feb 25 2020 Richard W.M. Jones <rjones@redhat.com> - 4.10.0-1
|
||||
- OCaml 4.10.0 final.
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.0-0.beta1.0.1
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Sat Jan 18 2020 Richard W.M. Jones <rjones@redhat.com> - 4.10.0-0.beta1
|
||||
- OCaml 4.10.0+beta1.
|
||||
|
||||
* Tue Jan 07 2020 Richard W.M. Jones <rjones@redhat.com> - 4.09.0-13
|
||||
- Bump release and rebuild.
|
||||
|
||||
* Tue Jan 07 2020 Richard W.M. Jones <rjones@redhat.com> - 4.09.0-4
|
||||
- OCaml 4.09.0 for riscv64
|
||||
|
||||
* Tue Dec 10 2019 Richard W.M. Jones <rjones@redhat.com> - 4.09.0-3
|
||||
- Require redhat-rpm-config to get hardening flags when linking.
|
||||
|
||||
* Thu Dec 05 2019 Richard W.M. Jones <rjones@redhat.com> - 4.09.0-2
|
||||
- OCaml 4.09.0 final.
|
||||
- Use autosetup, remove old setup line.
|
||||
- Remove ocamloptp binaries.
|
||||
- Rename target_camlheader[di] -> camlheader[di] files.
|
||||
- Remove vmthreads - old threading library which is no longer built.
|
||||
- Remove x11 subpackage which is obsolete.
|
||||
- Further fixes to CFLAGS and annobin.
|
||||
|
||||
* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 4.08.1-1
|
||||
- OCaml 4.08.1 final.
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (ocaml-4.08.1.tar.xz) = ebcc065c4cc4bf16256c6dad6795d9660d355c5facbe432591811dc4aa02af6498899219ec4e786358dffcfc38c68f5af2d1c3787d418a78732ec37e84a28cd4
|
||||
SHA512 (ocaml-4.14.0.tar.gz) = 3c5e5b9f00bb109dd99b5f7b0078cf8663d4247e548f3e601d6b2a55582e04bb20f6de85005c4cf2f78ae9aaa449f5ca6f2bab2f6ce83eeb3aeb386e3f2fcc32
|
||||
|
|
Loading…
Reference in New Issue