- New upstream version 4.05.0.

- Disable parallel builds for now.
- *.mli files are now included in ocaml-compiler-libs.
- Add possible fix for aarch64 with new binutils.
This commit is contained in:
Richard W.M. Jones 2017-08-05 16:19:56 +01:00
parent 42b3c165c6
commit 5f905fc187
15 changed files with 635 additions and 85 deletions

View File

@ -0,0 +1,36 @@
From 5bd96201dbd70c387c5af4b510d0de4abc0cfd7d Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <gabriel.scherer@gmail.com>
Date: Wed, 12 Jul 2017 11:57:22 -0400
Subject: [PATCH 01/12] Changes: clarify compatibility-breaking change items
---
Changes | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Changes b/Changes
index cc59f635e..10642f19d 100644
--- a/Changes
+++ b/Changes
@@ -64,6 +64,9 @@ OCaml 4.05.0 (13 Jul 2017):
* MPR#7414, GPR#929: Soundness bug with non-generalized type variables and
functors.
+ (compatibility: some code using module-global mutable state will
+ fail at compile-time and is fixed by adding extra annotations;
+ see the Mantis and Github discussions.)
(Jacques Garrigue, report by Leo White)
### Compiler user-interface and warnings:
@@ -567,6 +570,9 @@ The complete list of changes is listed below.
(Mark Shinwell, Leo White, review by Xavier Leroy)
* GPR#1088: Gc.minor_words now returns accurate numbers.
+ (compatibility: the .mli declaration of `Gc.minor_words`
+ and `Gc.get_minor_free` changed, which may break libraries
+ re-exporting these values.)
(Stephen Dolan, review by Pierre Chambart and Xavier Leroy)
OCaml 4.04.2 (23 Jun 2017):
--
2.13.1

View File

@ -0,0 +1,44 @@
From 22dbcdfb921b19d171134de90984805622877e55 Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavier.leroy@inria.fr>
Date: Sat, 22 Jul 2017 16:32:23 -0400
Subject: [PATCH 02/12] MPR#7591: frametable not 8-aligned on x86-64 port
Cherry-pick of 7077b60 from trunk.
---
Changes | 7 +++++++
asmcomp/amd64/emit.mlp | 3 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes
index 10642f19d..cc7e0a82f 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+Working 4.05.x branch
+---------------------
+
+- MPR#7591, GPR#1257: on x86-64, frame table is not 8-aligned
+ (Xavier Leroy, report by Mantis user "voglerr", review by Gabriel Scherer)
+
+
OCaml 4.05.0 (13 Jul 2017):
---------------------------
diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp
index c3f8692a8..75a785f74 100644
--- a/asmcomp/amd64/emit.mlp
+++ b/asmcomp/amd64/emit.mlp
@@ -1065,8 +1065,9 @@ let end_assembly() =
D.data ();
emit_global_label "data_end";
- D.long (const 0);
+ D.qword (const 0);
+ D.align 8; (* PR#7591 *)
emit_global_label "frametable";
let setcnt = ref 0 in
--
2.13.1

View File

@ -0,0 +1,409 @@
From 664f0763d37f85e2ec53d6394251b5948dcfa727 Mon Sep 17 00:00:00 2001
From: Mark Shinwell <mshinwell@janestreet.com>
Date: Mon, 31 Jul 2017 14:37:47 +0100
Subject: [PATCH 03/12] Fixes for out-of-range Ialloc
Cherry-pick of GPR#1271 which was merged on trunk.
Fixes for Ialloc instructions allocating more than Max_young_wosize words in the minor heap
Out-of-range Ialloc instructions cause various problems, see in particular GPR #1250.
---
Changes | 5 +
asmcomp/cmmgen.ml | 38 ++--
asmcomp/selectgen.ml | 3 +-
testsuite/tests/basic-more/pr1271.ml | 288 ++++++++++++++++++++++++++++
testsuite/tests/basic-more/pr1271.reference | 2 +
5 files changed, 317 insertions(+), 19 deletions(-)
create mode 100644 testsuite/tests/basic-more/pr1271.ml
create mode 100644 testsuite/tests/basic-more/pr1271.reference
diff --git a/Changes b/Changes
index cc7e0a82f..e8dbd42e2 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,11 @@ Working 4.05.x branch
- MPR#7591, GPR#1257: on x86-64, frame table is not 8-aligned
(Xavier Leroy, report by Mantis user "voglerr", review by Gabriel Scherer)
+- GPR#1271: Don't generate Ialloc instructions for closures that exceed
+ Max_young_wosize; instead allocate them on the major heap. (Related
+ to GPR#1250.)
+ (Mark Shinwell)
+
OCaml 4.05.0 (13 Jul 2017):
---------------------------
diff --git a/asmcomp/cmmgen.ml b/asmcomp/cmmgen.ml
index 4ac4b40c6..2120d3985 100644
--- a/asmcomp/cmmgen.ml
+++ b/asmcomp/cmmgen.ml
@@ -1641,29 +1641,31 @@ let rec transl env e =
List.iter (fun f -> Queue.add f functions) fundecls;
Cconst_symbol lbl
| Uclosure(fundecls, clos_vars) ->
- let block_size =
- fundecls_size fundecls + List.length clos_vars in
let rec transl_fundecls pos = function
[] ->
List.map (transl env) clos_vars
| f :: rem ->
Queue.add f functions;
- let header =
- if pos = 0
- then alloc_closure_header block_size f.dbg
- else alloc_infix_header pos f.dbg in
- if f.arity = 1 || f.arity = 0 then
- header ::
- Cconst_symbol f.label ::
- int_const f.arity ::
- transl_fundecls (pos + 3) rem
- else
- header ::
- Cconst_symbol(curry_function f.arity) ::
- int_const f.arity ::
- Cconst_symbol f.label ::
- transl_fundecls (pos + 4) rem in
- Cop(Calloc, transl_fundecls 0 fundecls, Debuginfo.none)
+ let without_header =
+ if f.arity = 1 || f.arity = 0 then
+ Cconst_symbol f.label ::
+ int_const f.arity ::
+ transl_fundecls (pos + 3) rem
+ else
+ Cconst_symbol(curry_function f.arity) ::
+ int_const f.arity ::
+ Cconst_symbol f.label ::
+ transl_fundecls (pos + 4) rem
+ in
+ if pos = 0 then without_header
+ else (alloc_infix_header pos f.dbg) :: without_header
+ in
+ let dbg =
+ match fundecls with
+ | [] -> Debuginfo.none
+ | fundecl::_ -> fundecl.dbg
+ in
+ make_alloc dbg Obj.closure_tag (transl_fundecls 0 fundecls)
| Uoffset(arg, offset) ->
(* produces a valid Caml value, pointing just after an infix header *)
let ptr = transl env arg in
diff --git a/asmcomp/selectgen.ml b/asmcomp/selectgen.ml
index 7cd8cd5c3..1158fc0d0 100644
--- a/asmcomp/selectgen.ml
+++ b/asmcomp/selectgen.ml
@@ -738,7 +738,8 @@ method emit_expr (env:environment) exp =
loc_arg (Proc.loc_external_results rd) in
self#insert_move_results loc_res rd stack_ofs;
Some rd
- | Ialloc { words = _; spacetime_index; label_after_call_gc; } ->
+ | Ialloc { words; spacetime_index; label_after_call_gc; } ->
+ assert (words <= Config.max_young_wosize);
let rd = self#regs_for typ_val in
let size = size_expr env (Ctuple new_args) in
let op =
diff --git a/testsuite/tests/basic-more/pr1271.ml b/testsuite/tests/basic-more/pr1271.ml
new file mode 100644
index 000000000..3890d0fbb
--- /dev/null
+++ b/testsuite/tests/basic-more/pr1271.ml
@@ -0,0 +1,288 @@
+(* GPR#1271 *)
+
+module F (X : sig val x : int end) = struct
+ let rec f1 y = f270 (X.x + y)
+ and f2 y = (f1 [@inlined never]) y
+ and f3 y = (f2 [@inlined never]) y
+ and f4 y = (f3 [@inlined never]) y
+ and f5 y = (f4 [@inlined never]) y
+ and f6 y = (f5 [@inlined never]) y
+ and f7 y = (f6 [@inlined never]) y
+ and f8 y = (f7 [@inlined never]) y
+ and f9 y = (f8 [@inlined never]) y
+ and f10 y = (f9 [@inlined never]) y
+ and f11 y = (f10 [@inlined never]) y
+ and f12 y = (f11 [@inlined never]) y
+ and f13 y = (f12 [@inlined never]) y
+ and f14 y = (f13 [@inlined never]) y
+ and f15 y = (f14 [@inlined never]) y
+ and f16 y = (f15 [@inlined never]) y
+ and f17 y = (f16 [@inlined never]) y
+ and f18 y = (f17 [@inlined never]) y
+ and f19 y = (f18 [@inlined never]) y
+ and f20 y = (f19 [@inlined never]) y
+ and f21 y = (f20 [@inlined never]) y
+ and f22 y = (f21 [@inlined never]) y
+ and f23 y = (f22 [@inlined never]) y
+ and f24 y = (f23 [@inlined never]) y
+ and f25 y = (f24 [@inlined never]) y
+ and f26 y = (f25 [@inlined never]) y
+ and f27 y = (f26 [@inlined never]) y
+ and f28 y = (f27 [@inlined never]) y
+ and f29 y = (f28 [@inlined never]) y
+ and f30 y = (f29 [@inlined never]) y
+ and f31 y = (f30 [@inlined never]) y
+ and f32 y = (f31 [@inlined never]) y
+ and f33 y = (f32 [@inlined never]) y
+ and f34 y = (f33 [@inlined never]) y
+ and f35 y = (f34 [@inlined never]) y
+ and f36 y = (f35 [@inlined never]) y
+ and f37 y = (f36 [@inlined never]) y
+ and f38 y = (f37 [@inlined never]) y
+ and f39 y = (f38 [@inlined never]) y
+ and f40 y = (f39 [@inlined never]) y
+ and f41 y = (f40 [@inlined never]) y
+ and f42 y = (f41 [@inlined never]) y
+ and f43 y = (f42 [@inlined never]) y
+ and f44 y = (f43 [@inlined never]) y
+ and f45 y = (f44 [@inlined never]) y
+ and f46 y = (f45 [@inlined never]) y
+ and f47 y = (f46 [@inlined never]) y
+ and f48 y = (f47 [@inlined never]) y
+ and f49 y = (f48 [@inlined never]) y
+ and f50 y = (f49 [@inlined never]) y
+ and f51 y = (f50 [@inlined never]) y
+ and f52 y = (f51 [@inlined never]) y
+ and f53 y = (f52 [@inlined never]) y
+ and f54 y = (f53 [@inlined never]) y
+ and f55 y = (f54 [@inlined never]) y
+ and f56 y = (f55 [@inlined never]) y
+ and f57 y = (f56 [@inlined never]) y
+ and f58 y = (f57 [@inlined never]) y
+ and f59 y = (f58 [@inlined never]) y
+ and f60 y = (f59 [@inlined never]) y
+ and f61 y = (f60 [@inlined never]) y
+ and f62 y = (f61 [@inlined never]) y
+ and f63 y = (f62 [@inlined never]) y
+ and f64 y = (f63 [@inlined never]) y
+ and f65 y = (f64 [@inlined never]) y
+ and f66 y = (f65 [@inlined never]) y
+ and f67 y = (f66 [@inlined never]) y
+ and f68 y = (f67 [@inlined never]) y
+ and f69 y = (f68 [@inlined never]) y
+ and f70 y = (f69 [@inlined never]) y
+ and f71 y = (f70 [@inlined never]) y
+ and f72 y = (f71 [@inlined never]) y
+ and f73 y = (f72 [@inlined never]) y
+ and f74 y = (f73 [@inlined never]) y
+ and f75 y = (f74 [@inlined never]) y
+ and f76 y = (f75 [@inlined never]) y
+ and f77 y = (f76 [@inlined never]) y
+ and f78 y = (f77 [@inlined never]) y
+ and f79 y = (f78 [@inlined never]) y
+ and f80 y = (f79 [@inlined never]) y
+ and f81 y = (f80 [@inlined never]) y
+ and f82 y = (f81 [@inlined never]) y
+ and f83 y = (f82 [@inlined never]) y
+ and f84 y = (f83 [@inlined never]) y
+ and f85 y = (f84 [@inlined never]) y
+ and f86 y = (f85 [@inlined never]) y
+ and f87 y = (f86 [@inlined never]) y
+ and f88 y = (f87 [@inlined never]) y
+ and f89 y = (f88 [@inlined never]) y
+ and f90 y = (f89 [@inlined never]) y
+ and f91 y = (f90 [@inlined never]) y
+ and f92 y = (f91 [@inlined never]) y
+ and f93 y = (f92 [@inlined never]) y
+ and f94 y = (f93 [@inlined never]) y
+ and f95 y = (f94 [@inlined never]) y
+ and f96 y = (f95 [@inlined never]) y
+ and f97 y = (f96 [@inlined never]) y
+ and f98 y = (f97 [@inlined never]) y
+ and f99 y = (f98 [@inlined never]) y
+ and f100 y = (f99 [@inlined never]) y
+ and f101 y = (f100 [@inlined never]) y
+ and f102 y = (f101 [@inlined never]) y
+ and f103 y = (f102 [@inlined never]) y
+ and f104 y = (f103 [@inlined never]) y
+ and f105 y = (f104 [@inlined never]) y
+ and f106 y = (f105 [@inlined never]) y
+ and f107 y = (f106 [@inlined never]) y
+ and f108 y = (f107 [@inlined never]) y
+ and f109 y = (f108 [@inlined never]) y
+ and f110 y = (f109 [@inlined never]) y
+ and f111 y = (f110 [@inlined never]) y
+ and f112 y = (f111 [@inlined never]) y
+ and f113 y = (f112 [@inlined never]) y
+ and f114 y = (f113 [@inlined never]) y
+ and f115 y = (f114 [@inlined never]) y
+ and f116 y = (f115 [@inlined never]) y
+ and f117 y = (f116 [@inlined never]) y
+ and f118 y = (f117 [@inlined never]) y
+ and f119 y = (f118 [@inlined never]) y
+ and f120 y = (f119 [@inlined never]) y
+ and f121 y = (f120 [@inlined never]) y
+ and f122 y = (f121 [@inlined never]) y
+ and f123 y = (f122 [@inlined never]) y
+ and f124 y = (f123 [@inlined never]) y
+ and f125 y = (f124 [@inlined never]) y
+ and f126 y = (f125 [@inlined never]) y
+ and f127 y = (f126 [@inlined never]) y
+ and f128 y = (f127 [@inlined never]) y
+ and f129 y = (f128 [@inlined never]) y
+ and f130 y = (f129 [@inlined never]) y
+ and f131 y = (f130 [@inlined never]) y
+ and f132 y = (f131 [@inlined never]) y
+ and f133 y = (f132 [@inlined never]) y
+ and f134 y = (f133 [@inlined never]) y
+ and f135 y = (f134 [@inlined never]) y
+ and f136 y = (f135 [@inlined never]) y
+ and f137 y = (f136 [@inlined never]) y
+ and f138 y = (f137 [@inlined never]) y
+ and f139 y = (f138 [@inlined never]) y
+ and f140 y = (f139 [@inlined never]) y
+ and f141 y = (f140 [@inlined never]) y
+ and f142 y = (f141 [@inlined never]) y
+ and f143 y = (f142 [@inlined never]) y
+ and f144 y = (f143 [@inlined never]) y
+ and f145 y = (f144 [@inlined never]) y
+ and f146 y = (f145 [@inlined never]) y
+ and f147 y = (f146 [@inlined never]) y
+ and f148 y = (f147 [@inlined never]) y
+ and f149 y = (f148 [@inlined never]) y
+ and f150 y = (f149 [@inlined never]) y
+ and f151 y = (f150 [@inlined never]) y
+ and f152 y = (f151 [@inlined never]) y
+ and f153 y = (f152 [@inlined never]) y
+ and f154 y = (f153 [@inlined never]) y
+ and f155 y = (f154 [@inlined never]) y
+ and f156 y = (f155 [@inlined never]) y
+ and f157 y = (f156 [@inlined never]) y
+ and f158 y = (f157 [@inlined never]) y
+ and f159 y = (f158 [@inlined never]) y
+ and f160 y = (f159 [@inlined never]) y
+ and f161 y = (f160 [@inlined never]) y
+ and f162 y = (f161 [@inlined never]) y
+ and f163 y = (f162 [@inlined never]) y
+ and f164 y = (f163 [@inlined never]) y
+ and f165 y = (f164 [@inlined never]) y
+ and f166 y = (f165 [@inlined never]) y
+ and f167 y = (f166 [@inlined never]) y
+ and f168 y = (f167 [@inlined never]) y
+ and f169 y = (f168 [@inlined never]) y
+ and f170 y = (f169 [@inlined never]) y
+ and f171 y = (f170 [@inlined never]) y
+ and f172 y = (f171 [@inlined never]) y
+ and f173 y = (f172 [@inlined never]) y
+ and f174 y = (f173 [@inlined never]) y
+ and f175 y = (f174 [@inlined never]) y
+ and f176 y = (f175 [@inlined never]) y
+ and f177 y = (f176 [@inlined never]) y
+ and f178 y = (f177 [@inlined never]) y
+ and f179 y = (f178 [@inlined never]) y
+ and f180 y = (f179 [@inlined never]) y
+ and f181 y = (f180 [@inlined never]) y
+ and f182 y = (f181 [@inlined never]) y
+ and f183 y = (f182 [@inlined never]) y
+ and f184 y = (f183 [@inlined never]) y
+ and f185 y = (f184 [@inlined never]) y
+ and f186 y = (f185 [@inlined never]) y
+ and f187 y = (f186 [@inlined never]) y
+ and f188 y = (f187 [@inlined never]) y
+ and f189 y = (f188 [@inlined never]) y
+ and f190 y = (f189 [@inlined never]) y
+ and f191 y = (f190 [@inlined never]) y
+ and f192 y = (f191 [@inlined never]) y
+ and f193 y = (f192 [@inlined never]) y
+ and f194 y = (f193 [@inlined never]) y
+ and f195 y = (f194 [@inlined never]) y
+ and f196 y = (f195 [@inlined never]) y
+ and f197 y = (f196 [@inlined never]) y
+ and f198 y = (f197 [@inlined never]) y
+ and f199 y = (f198 [@inlined never]) y
+ and f200 y = (f199 [@inlined never]) y
+ and f201 y = (f200 [@inlined never]) y
+ and f202 y = (f201 [@inlined never]) y
+ and f203 y = (f202 [@inlined never]) y
+ and f204 y = (f203 [@inlined never]) y
+ and f205 y = (f204 [@inlined never]) y
+ and f206 y = (f205 [@inlined never]) y
+ and f207 y = (f206 [@inlined never]) y
+ and f208 y = (f207 [@inlined never]) y
+ and f209 y = (f208 [@inlined never]) y
+ and f210 y = (f209 [@inlined never]) y
+ and f211 y = (f210 [@inlined never]) y
+ and f212 y = (f211 [@inlined never]) y
+ and f213 y = (f212 [@inlined never]) y
+ and f214 y = (f213 [@inlined never]) y
+ and f215 y = (f214 [@inlined never]) y
+ and f216 y = (f215 [@inlined never]) y
+ and f217 y = (f216 [@inlined never]) y
+ and f218 y = (f217 [@inlined never]) y
+ and f219 y = (f218 [@inlined never]) y
+ and f220 y = (f219 [@inlined never]) y
+ and f221 y = (f220 [@inlined never]) y
+ and f222 y = (f221 [@inlined never]) y
+ and f223 y = (f222 [@inlined never]) y
+ and f224 y = (f223 [@inlined never]) y
+ and f225 y = (f224 [@inlined never]) y
+ and f226 y = (f225 [@inlined never]) y
+ and f227 y = (f226 [@inlined never]) y
+ and f228 y = (f227 [@inlined never]) y
+ and f229 y = (f228 [@inlined never]) y
+ and f230 y = (f229 [@inlined never]) y
+ and f231 y = (f230 [@inlined never]) y
+ and f232 y = (f231 [@inlined never]) y
+ and f233 y = (f232 [@inlined never]) y
+ and f234 y = (f233 [@inlined never]) y
+ and f235 y = (f234 [@inlined never]) y
+ and f236 y = (f235 [@inlined never]) y
+ and f237 y = (f236 [@inlined never]) y
+ and f238 y = (f237 [@inlined never]) y
+ and f239 y = (f238 [@inlined never]) y
+ and f240 y = (f239 [@inlined never]) y
+ and f241 y = (f240 [@inlined never]) y
+ and f242 y = (f241 [@inlined never]) y
+ and f243 y = (f242 [@inlined never]) y
+ and f244 y = (f243 [@inlined never]) y
+ and f245 y = (f244 [@inlined never]) y
+ and f246 y = (f245 [@inlined never]) y
+ and f247 y = (f246 [@inlined never]) y
+ and f248 y = (f247 [@inlined never]) y
+ and f249 y = (f248 [@inlined never]) y
+ and f250 y = (f249 [@inlined never]) y
+ and f251 y = (f250 [@inlined never]) y
+ and f252 y = (f251 [@inlined never]) y
+ and f253 y = (f252 [@inlined never]) y
+ and f254 y = (f253 [@inlined never]) y
+ and f255 y = (f254 [@inlined never]) y
+ and f256 y = (f255 [@inlined never]) y
+ and f257 y = (f256 [@inlined never]) y
+ and f258 y = (f257 [@inlined never]) y
+ and f259 y = (f258 [@inlined never]) y
+ and f260 y = (f259 [@inlined never]) y
+ and f261 y = (f260 [@inlined never]) y
+ and f262 y = (f261 [@inlined never]) y
+ and f263 y = (f262 [@inlined never]) y
+ and f264 y = (f263 [@inlined never]) y
+ and f265 y = (f264 [@inlined never]) y
+ and f266 y = (f265 [@inlined never]) y
+ and f267 y = (f266 [@inlined never]) y
+ and f268 y = (f267 [@inlined never]) y
+ and f269 y = (f268 [@inlined never]) y
+ and f270 y = (f269 [@inlined never]) y
+end
+
+let words0 = Gc.minor_words ()
+let words1 = Gc.minor_words ()
+module X = F (struct let x = 42 end)
+let words2 = Gc.minor_words ()
+
+let expected = words1 -. words0
+
+let () =
+ match Sys.backend_type with
+ | Sys.Native ->
+ Printf.printf "%.0f" ((words2 -. words1) -. expected)
+ | Sys.Bytecode | Sys.Other _ ->
+ print_string "0"
diff --git a/testsuite/tests/basic-more/pr1271.reference b/testsuite/tests/basic-more/pr1271.reference
new file mode 100644
index 000000000..6e374c16e
--- /dev/null
+++ b/testsuite/tests/basic-more/pr1271.reference
@@ -0,0 +1,2 @@
+0
+All tests succeeded.
--
2.13.1

View File

@ -1,17 +1,17 @@
From ff87e5c4252e5545e50fff0a2e7c10b813c02ec2 Mon Sep 17 00:00:00 2001
From b2118848e9a0aa96c5ccb3ede65f2d0e9cfb114a 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/9] Don't add rpaths to libraries.
Subject: [PATCH 04/12] Don't add rpaths to libraries.
---
tools/Makefile.shared | 6 +++---
tools/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/Makefile.shared b/tools/Makefile.shared
index a873bdd98..ba263b88f 100644
--- a/tools/Makefile.shared
+++ b/tools/Makefile.shared
@@ -154,9 +154,9 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo misc.cmo \
diff --git a/tools/Makefile b/tools/Makefile
index 9a8cf652b..269aa18e6 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -156,9 +156,9 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo misc.cmo \
ocamlmklibconfig.ml: ../config/Makefile Makefile
(echo 'let bindir = "$(BINDIR)"'; \
echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\

View File

@ -1,28 +0,0 @@
From 5376164719c12fbad2321551425b3c46ec794817 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 3 Nov 2016 19:50:20 +0000
Subject: [PATCH 4/9] Don't rewrite -Werror.
In Fedora our CFLAGS contains -Wall -Werror=format-security.
As written, the sed phrase substitutes this with -Wall=format-security
which is bogus. Remove this rewriting completely.
---
Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/Makefile b/Makefile
index b30564d00..e8514d41e 100644
--- a/Makefile
+++ b/Makefile
@@ -409,7 +409,6 @@ utils/config.ml: utils/config.mlp config/Makefile
-e 's|%%CCOMPTYPE%%|cc|' \
-e 's|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)|' \
-e 's|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|' \
- -e '/c_compiler =/s| -Werror||' \
-e 's|%%PACKLD%%|$(PACKLD)|' \
-e 's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \
-e 's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \
--
2.13.1

View File

@ -1,7 +1,7 @@
From c047077c1c8a2acdc1d9bfe502c1a9b910ac3b9d Mon Sep 17 00:00:00 2001
From 80e2921e472f66f70575d6e4e6c8ff6f5714e4e4 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:40:36 +0100
Subject: [PATCH 2/9] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Subject: [PATCH 05/12] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Debian, sent upstream.
See:

View File

@ -1,17 +1,17 @@
From 77475cec6718b9f15bc6e8e5c7e6edb936b93cd2 Mon Sep 17 00:00:00 2001
From 313692e7425fd91917d4e35ad4ade459cb2c1138 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 3/9] configure: Allow user defined C compiler flags.
Subject: [PATCH 06/12] configure: Allow user defined C compiler flags.
---
configure | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configure b/configure
index 3b2636035..d53d90367 100755
index e79659954..786f4cdbe 100755
--- a/configure
+++ b/configure
@@ -1912,6 +1912,10 @@ if $with_fpic; then
@@ -2002,6 +2002,10 @@ if $with_fpic; then
echo "#define CAML_WITH_FPIC" >> m.h
fi

View File

@ -1,7 +1,7 @@
From 8860338049b0a43377c2ea7fa05a47766b3b21aa Mon Sep 17 00:00:00 2001
From 68a8eb8f3bbc254cd5cb685f058bc5b0ef1029e7 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Tue, 8 Nov 2016 23:56:50 +0100
Subject: [PATCH 5/9] Adapt config.guess for RISC-V
Subject: [PATCH 07/12] Adapt config.guess for RISC-V
---
config/gnu/config.guess | 5 ++++-

View File

@ -1,7 +1,7 @@
From c7d7b98e82b5571965e57c1537899094222f3157 Mon Sep 17 00:00:00 2001
From d0f08d1cfa01efb02721f7d2e04ce61f38d6d6a7 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Fri, 4 Nov 2016 20:39:09 +0100
Subject: [PATCH 6/9] Add RISC-V backend & runtime
Subject: [PATCH 08/12] Add RISC-V backend & runtime
---
README.adoc | 1 +
@ -26,7 +26,7 @@ Subject: [PATCH 6/9] Add RISC-V backend & runtime
create mode 100644 asmrun/riscv.S
diff --git a/README.adoc b/README.adoc
index 480b0250f..cb6eebf1d 100644
index fe07edbba..f7d13bc06 100644
--- a/README.adoc
+++ b/README.adoc
@@ -34,6 +34,7 @@ IA32 (Pentium):: NetBSD, OpenBSD, Solaris 9
@ -1683,10 +1683,10 @@ index fd9d528e9..781c2517b 100644
struct caml_context {
diff --git a/configure b/configure
index d53d90367..04acb43be 100755
index 786f4cdbe..b88dab26b 100755
--- a/configure
+++ b/configure
@@ -820,6 +820,7 @@ if test $with_sharedlibs = "yes"; then
@@ -854,6 +854,7 @@ if test $with_sharedlibs = "yes"; then
arm*-*-freebsd*) natdynlink=true;;
earm*-*-netbsd*) natdynlink=true;;
aarch64-*-linux*) natdynlink=true;;
@ -1694,7 +1694,7 @@ index d53d90367..04acb43be 100755
esac
fi
@@ -889,6 +890,8 @@ case "$target" in
@@ -947,6 +948,8 @@ case "$target" in
x86_64-*-mingw*) arch=amd64; system=mingw;;
aarch64-*-linux*) arch=arm64; system=linux;;
x86_64-*-cygwin*) arch=amd64; system=cygwin;;
@ -1703,15 +1703,15 @@ index d53d90367..04acb43be 100755
esac
# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
@@ -964,7 +967,7 @@ case "$arch,$system" in
@@ -1023,7 +1026,7 @@ case "$arch,$system" in
aspp="${TOOLPREF}cc -c";;
*,freebsd) as="${TOOLPREF}as"
aspp="${TOOLPREF}cc -c";;
- amd64,*|arm,*|arm64,*|i386,*|power,bsd*|sparc,*)
+ amd64,*|arm,*|arm64,*|i386,*|power,bsd*|sparc,*|riscv,*)
as="${TOOLPREF}as"
aspp="${TOOLPREF}gcc -c";;
esac
case "$ccfamily" in
clang-*)
--
2.13.1

View File

@ -1,7 +1,7 @@
From 80e5cd3dc503319490761a705e14f3fa421ff760 Mon Sep 17 00:00:00 2001
From 84a4b62e1305795f6599c91a50b6e0d9e675cbd5 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Thu, 10 Nov 2016 14:12:53 +0100
Subject: [PATCH 7/9] Try fix for andi/ori/xori immediates (#1)
Subject: [PATCH 09/12] Try fix for andi/ori/xori immediates (#1)
---
asmcomp/riscv/selection.ml | 13 -------------

View File

@ -1,7 +1,7 @@
From ded14c206a5e73ba5eae6d84ed4ee82c11ce6245 Mon Sep 17 00:00:00 2001
From bf083b3beeb9a622017137c246d2cfa863056cc0 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Tue, 22 Nov 2016 22:30:35 +0100
Subject: [PATCH 8/9] Fix immediates' range when adjusting/indexing sp
Subject: [PATCH 10/12] Fix immediates' range when adjusting/indexing sp
---
asmcomp/riscv/arch.ml | 3 +++

View File

@ -1,7 +1,7 @@
From 664a26d436919be1fe3a33094aa44403b4bf710d Mon Sep 17 00:00:00 2001
From 9e8d87c255713f7bf397083be9e6453d312c93a3 Mon Sep 17 00:00:00 2001
From: Nicolas Ojeda Bar <n.oje.bar@gmail.com>
Date: Wed, 23 Nov 2016 12:38:28 +0100
Subject: [PATCH 9/9] Another immediate range fix
Subject: [PATCH 11/12] Another immediate range fix
---
asmcomp/riscv/emit.mlp | 57 ++++++++++++++++++++++++++++++--------------------

View File

@ -0,0 +1,67 @@
From 2cc11dbf4e046610e85e66139f0d1ffc9e1cff65 Mon Sep 17 00:00:00 2001
From: Jiong Wang <jiong.wang@foss.arm.com>
Date: Fri, 28 Jul 2017 19:00:00 +0200
Subject: [PATCH 12/12] Mark certain symbols as .hidden in arm64 codegen,
possibly fixes MPR#7585
binutils 2.29 arm64 linker is more strict about when to perform pc-relative
relocations for global symbols. Specifically, they must be marked as .hidden.
ocaml arm64 codegen does not do this, so tests/lib-dynlink-native/ fails as
some symbols were not relocated. This patch fixes that by marking (hopefully)
the appropriate symbols as .hidden.
---
asmcomp/arm64/emit.mlp | 4 ++++
asmcomp/compilenv.ml | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp
index f75646e12..ee72c114f 100644
--- a/asmcomp/arm64/emit.mlp
+++ b/asmcomp/arm64/emit.mlp
@@ -324,6 +324,7 @@ let emit_literals() =
let emit_load_symbol_addr dst s =
if (not !Clflags.dlcode) || Compilenv.symbol_in_current_unit s then begin
+ ` .hidden {emit_symbol s}\n`;
` adrp {emit_reg dst}, {emit_symbol s}\n`;
` add {emit_reg dst}, {emit_reg dst}, #:lo12:{emit_symbol s}\n`
end else begin
@@ -575,6 +576,7 @@ let emit_instr i =
` fmov {emit_reg i.res.(0)}, #{emit_printf "0x%Lx" f}\n`
else begin
let lbl = float_literal f in
+ ` .hidden {emit_label lbl}\n`;
` adrp {emit_reg reg_tmp1}, {emit_label lbl}\n`;
` ldr {emit_reg i.res.(0)}, [{emit_reg reg_tmp1}, #:lo12:{emit_label lbl}]\n`
end
@@ -609,6 +611,7 @@ let emit_instr i =
match addr with
| Iindexed _ -> i.arg.(0)
| Ibased(s, ofs) ->
+ ` .hidden {emit_symbol s}\n`;
` adrp {emit_reg reg_tmp1}, {emit_symbol_offset s ofs}\n`;
reg_tmp1 in
begin match size with
@@ -636,6 +639,7 @@ let emit_instr i =
match addr with
| Iindexed _ -> i.arg.(1)
| Ibased(s, ofs) ->
+ ` .hidden {emit_symbol s}\n`;
` adrp {emit_reg reg_tmp1}, {emit_symbol_offset s ofs}\n`;
reg_tmp1 in
begin match size with
diff --git a/asmcomp/compilenv.ml b/asmcomp/compilenv.ml
index a50c57f45..32f8bf1da 100644
--- a/asmcomp/compilenv.ml
+++ b/asmcomp/compilenv.ml
@@ -161,7 +161,6 @@ let make_symbol ?(unitname = current_unit.ui_symbol) idopt =
let symbol_in_current_unit name =
let prefix = "caml" ^ current_unit.ui_symbol in
- name = prefix ||
(let lp = String.length prefix in
String.length name >= 2 + lp
&& String.sub name 0 lp = prefix
--
2.13.1

View File

@ -23,11 +23,11 @@
%global test_arches_required aarch64 %{power64} x86_64
# Architectures where parallel builds fail.
%global no_parallel_build_arches aarch64
#%global no_parallel_build_arches aarch64
Name: ocaml
Version: 4.04.2
Release: 5%{?dist}
Version: 4.05.0
Release: 1%{?dist}
Summary: OCaml compiler and programming environment
@ -35,11 +35,11 @@ License: QPL and (LGPLv2+ with exceptions)
URL: http://www.ocaml.org
Source0: http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-%{version}.tar.xz
Source0: http://caml.inria.fr/pub/distrib/ocaml-4.05/ocaml-%{version}.tar.xz
Source1: http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04-refman-html.tar.gz
Source2: http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04-refman.pdf
Source3: http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04-refman.info.tar.gz
Source1: http://caml.inria.fr/pub/distrib/ocaml-4.05/ocaml-4.05-refman-html.tar.gz
Source2: http://caml.inria.fr/pub/distrib/ocaml-4.05/ocaml-4.05-refman.pdf
Source3: http://caml.inria.fr/pub/distrib/ocaml-4.05/ocaml-4.05-refman.info.tar.gz
# IMPORTANT NOTE:
#
@ -50,23 +50,36 @@ Source3: http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04-refman.in
#
# https://pagure.io/fedora-ocaml
#
# Current branch: fedora-27-4.04.1
# Current branch: fedora-27-4.05.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.
#
Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch
Patch0002: 0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch
Patch0003: 0003-configure-Allow-user-defined-C-compiler-flags.patch
Patch0004: 0004-Don-t-rewrite-Werror.patch
# Out of tree patches from
# Upstream patches after 4.05.
Patch0001: 0001-Changes-clarify-compatibility-breaking-change-items.patch
Patch0002: 0002-MPR-7591-frametable-not-8-aligned-on-x86-64-port.patch
Patch0003: 0003-Fixes-for-out-of-range-Ialloc.patch
# Fedora-specific downstream patches.
Patch0004: 0004-Don-t-add-rpaths-to-libraries.patch
Patch0005: 0005-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch
Patch0006: 0006-configure-Allow-user-defined-C-compiler-flags.patch
# Out of tree patches for RISC-V support.
# https://github.com/nojb/riscv-ocaml
Patch0005: 0005-Adapt-config.guess-for-RISC-V.patch
Patch0006: 0006-Add-RISC-V-backend-runtime.patch
Patch0007: 0007-Try-fix-for-andi-ori-xori-immediates-1.patch
Patch0008: 0008-Fix-immediates-range-when-adjusting-indexing-sp.patch
Patch0009: 0009-Another-immediate-range-fix.patch
Patch0007: 0007-Adapt-config.guess-for-RISC-V.patch
Patch0008: 0008-Add-RISC-V-backend-runtime.patch
Patch0009: 0009-Try-fix-for-andi-ori-xori-immediates-1.patch
Patch0010: 0010-Fix-immediates-range-when-adjusting-indexing-sp.patch
Patch0011: 0011-Another-immediate-range-fix.patch
# Fix for some aarch64 linker problems.
# https://caml.inria.fr/mantis/view.php?id=7585
# This patch is from https://github.com/ocaml/ocaml/pull/1268
# where at time of writing it is not upstream.
Patch0012: 0012-Mark-certain-symbols-as-.hidden-in-arm64-codegen-pos.patch
BuildRequires: binutils-devel
BuildRequires: ncurses-devel
@ -205,12 +218,14 @@ cp %{SOURCE2} refman.pdf
%build
%ifnarch %{no_parallel_build_arches}
make="make %{?_smp_mflags}"
%else
# Parallel builds are broken in 4.05.0, see
# https://caml.inria.fr/mantis/view.php?id=7587
#%ifnarch %{no_parallel_build_arches}
#make="make %{?_smp_mflags}"
#%else
unset MAKEFLAGS
make=make
%endif
#%endif
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
./configure \
@ -441,6 +456,7 @@ fi
%files compiler-libs
%doc LICENSE
%dir %{_libdir}/ocaml/compiler-libs
%{_libdir}/ocaml/compiler-libs/*.mli
%{_libdir}/ocaml/compiler-libs/*.cmi
%{_libdir}/ocaml/compiler-libs/*.cmo
%{_libdir}/ocaml/compiler-libs/*.cma
@ -453,6 +469,12 @@ fi
%changelog
* Sat Aug 05 2017 Richard W.M. Jones <rjones@redhat.com> - 4.05.0-1
- New upstream version 4.05.0.
- Disable parallel builds for now.
- *.mli files are now included in ocaml-compiler-libs.
- Add possible fix for aarch64 with new binutils.
* Sat Aug 05 2017 Richard W.M. Jones <rjones@redhat.com> - 4.04.2-4
- Disable tests on aarch64 (https://caml.inria.fr/mantis/view.php?id=7602)

View File

@ -1,4 +1,4 @@
SHA512 (ocaml-4.04-refman-html.tar.gz) = 027ad5ea08488beb5ce65ec97a8aaf04197317d7d3194de771a4170dea9f8b90fc4309fd917b4176cd930dd0835c84448771b84fa92a735cfc60668ef0a6a413
SHA512 (ocaml-4.04-refman.info.tar.gz) = e83a28e8fb6af198471d26e790ce64ae11d6a2262110ecd5a7b150f9248c221847b1bde3e076b38a7e412ea1d709e0c1bfbf890ccbd5721869ea98d6d9dcc052
SHA512 (ocaml-4.04-refman.pdf) = 9194d0a9cddb1cde3f86f90fbe6e23740ef0e4e49515f40708fe5a2acc3318f6c3839377f93163e2520770357ad0ce7145c5cfb1424503e8873106b17338e4b6
SHA512 (ocaml-4.04.2.tar.xz) = 0449f650388fe63e1f96c6f63d994855cf76bac5b52d3f76e781c8d9f5fddb657a24a88063c1280d45ccc741c372085bad46cdb3dbc186e1861627d500290629
SHA512 (ocaml-4.05.0.tar.xz) = e87bb25d8a580f608ea3c8308129c4e4f4513e9bb3d218a5038a67b3f39b06656ff6ebe08a4b6f36960fb603be62e6bef2694fc3cf1b0fa0df3a1ca177d4e004
SHA512 (ocaml-4.05-refman-html.tar.gz) = a01aef22015cfcb1d230e63f24f2deeba6a8bc1a1225152e346a15e3a52be261d7f22430e561c7cbf64fbc53d3fa13606b87823efb56d139cf5e988c9a326af8
SHA512 (ocaml-4.05-refman.info.tar.gz) = 49cd780445576061e89cf46690a5f7297d5b2c92446e6fc0e2d8878089e6b18e235785d5eb658e508a15c2bfbdd4a1c990b6eca7dadb4b4a7f313e1a8f3d0642
SHA512 (ocaml-4.05-refman.pdf) = 2190deef5f89064774236790a130c036fe7d615177ce7e17c17a60b4d8500f78a75e15157fe13cf47125219ad731d04fb1339692047aced1ee9d768aae2a8038