New upstream version 4.04.0+beta2.

This commit is contained in:
Richard W.M. Jones 2016-11-03 18:32:19 +00:00
parent 496d4e4eaf
commit 22dd7125c6
24 changed files with 138 additions and 7188 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/ocaml-*.tar.bz2
/ocaml-*.tar.gz
/ocaml-*-refman.pdf
/4.04.0+beta2.tar.gz

View File

@ -1,20 +1,20 @@
From 73db2ab33221880d2399b2e98038219d798861ff Mon Sep 17 00:00:00 2001
From 4e42fcf72faacc4394fcb2e6c007c3dab60423d7 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 03/20] Don't add rpaths to libraries.
Subject: [PATCH 1/4] Don't add rpaths to libraries.
---
tools/Makefile.shared | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/Makefile.shared b/tools/Makefile.shared
index 0b90cd3..dc48712 100644
index 2803d78..d6c42bb 100644
--- a/tools/Makefile.shared
+++ b/tools/Makefile.shared
@@ -113,9 +113,9 @@ ocamlmklibconfig.ml: ../config/Makefile
echo 'let ext_dll = "$(EXT_DLL)"'; \
@@ -154,9 +154,9 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo \
ocamlmklibconfig.ml: ../config/Makefile Makefile
(echo 'let bindir = "$(BINDIR)"'; \
echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\
echo 'let mkdll = "$(MKDLL)"'; \
- echo 'let byteccrpath = "$(BYTECCRPATH)"'; \
- echo 'let nativeccrpath = "$(NATIVECCRPATH)"'; \
- echo 'let mksharedlibrpath = "$(MKSHAREDLIBRPATH)"'; \
@ -25,5 +25,5 @@ index 0b90cd3..dc48712 100644
sed -n -e 's/^#ml //p' ../config/Makefile) \
> ocamlmklibconfig.ml
--
2.7.4
2.9.3

View File

@ -1,24 +0,0 @@
From 988c1068100b7f30bd8b0d2c1195ac383705dc1c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 22:29:38 +0100
Subject: [PATCH 01/20] Don't ignore ./configure, it's a real git file.
---
.gitignore | 1 -
1 file changed, 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 87f7cda..8aad7c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,7 +19,6 @@
/.depend
/.depend.nt
/.DS_Store
-/configure
/ocamlc
/ocamlc.opt
/expunge
--
2.7.4

View File

@ -1,18 +0,0 @@
From d08dc9232f0ee90e3dc8132b9e63935be58e668e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 7 Jun 2012 15:36:16 +0100
Subject: [PATCH 02/20] Ensure empty compilerlibs/ directory is created by git.
This directory exists in the OCaml tarball, but is empty. As a
result, git ignores it unless we put a dummy file in it.
---
compilerlibs/.exists | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 compilerlibs/.exists
diff --git a/compilerlibs/.exists b/compilerlibs/.exists
new file mode 100644
index 0000000..e69de29
--
2.7.4

View File

@ -1,7 +1,7 @@
From 953b84dd9626f2be68f5cc8942478338250d560b Mon Sep 17 00:00:00 2001
From 1ad7a315e15abfc3eacd199d0e865849204af29c 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 04/20] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Subject: [PATCH 2/4] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Debian, sent upstream.
See:
@ -236,5 +236,5 @@ index 0000000..e28800f
+ header.units
+ end
--
2.7.4
2.9.3

View File

@ -1,19 +1,19 @@
From 613c9273f4cd73eb6e6750d8be29d7fa7f5a68c9 Mon Sep 17 00:00:00 2001
From 1fbe91a9effb87f018f0a5234fd85f2742128279 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 05/20] configure: Allow user defined C compiler flags.
Subject: [PATCH 3/4] configure: Allow user defined C compiler flags.
---
configure | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configure b/configure
index 4ea1498..d006010 100755
index ef002cc..5121666 100755
--- a/configure
+++ b/configure
@@ -1701,6 +1701,10 @@ case "$buggycc" in
nativecccompopts="$nativecccompopts -fomit-frame-pointer";;
esac
@@ -1901,6 +1901,10 @@ if $with_fpic; then
echo "#define CAML_WITH_FPIC" >> m.h
fi
+# Allow user defined C Compiler flags
+bytecccompopts="$bytecccompopts $CFLAGS"
@ -23,5 +23,5 @@ index 4ea1498..d006010 100755
cclibs="$cclibs $mathlib"
--
2.7.4
2.9.3

View File

@ -0,0 +1,28 @@
From 5e378e1b4f3b8a0697962f95383bf1796cbc36f8 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/4] 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 85be2db..1764d0e 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.9.3

File diff suppressed because it is too large Load Diff

View File

@ -1,205 +0,0 @@
From 49dcd94b5db72c7d6d0801309ca1e218b759fa00 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 24 Oct 2014 12:59:23 +0200
Subject: [PATCH 07/20] ppc64: Update for OCaml 4.02.0.
These are based on the power (ppc32) branch and some guesswork.
In particular, I'm not convinced that my changes to floating
point constant handling are correct, although I wrote a small
test program which worked.
Therefore these are not yet integrated into the main patch.
---
asmcomp/power64/CSE.ml | 37 +++++++++++++++++++++++++++++++++++++
asmcomp/power64/emit.mlp | 23 ++++++++++++++---------
asmcomp/power64/proc.ml | 8 ++++----
asmcomp/power64/scheduling.ml | 2 +-
4 files changed, 56 insertions(+), 14 deletions(-)
create mode 100644 asmcomp/power64/CSE.ml
diff --git a/asmcomp/power64/CSE.ml b/asmcomp/power64/CSE.ml
new file mode 100644
index 0000000..ec10d2d
--- /dev/null
+++ b/asmcomp/power64/CSE.ml
@@ -0,0 +1,37 @@
+(***********************************************************************)
+(* *)
+(* OCaml *)
+(* *)
+(* Xavier Leroy, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2014 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* CSE for the PowerPC *)
+
+open Arch
+open Mach
+open CSEgen
+
+class cse = object (self)
+
+inherit cse_generic as super
+
+method! class_of_operation op =
+ match op with
+ | Ispecific(Imultaddf | Imultsubf) -> Op_pure
+ | Ispecific(Ialloc_far _) -> Op_other
+ | _ -> super#class_of_operation op
+
+method! is_cheap_operation op =
+ match op with
+ | Iconst_int n | Iconst_blockheader n -> n <= 32767n && n >= -32768n
+ | _ -> false
+
+end
+
+let fundecl f =
+ (new cse)#fundecl f
diff --git a/asmcomp/power64/emit.mlp b/asmcomp/power64/emit.mlp
index d84ac5c..9fd59b2 100644
--- a/asmcomp/power64/emit.mlp
+++ b/asmcomp/power64/emit.mlp
@@ -292,6 +292,7 @@ let name_for_int_comparison = function
let name_for_intop = function
Iadd -> "add"
| Imul -> "mulld"
+ | Imulh -> "mulhd"
| Idiv -> "divd"
| Iand -> "and"
| Ior -> "or"
@@ -354,7 +355,8 @@ let load_store_size = function
let instr_size = function
Lend -> 0
| Lop(Imove | Ispill | Ireload) -> 1
- | Lop(Iconst_int n) -> if is_native_immediate n then 1 else 2
+ | Lop(Iconst_int n | Iconst_blockheader n) ->
+ if is_native_immediate n then 1 else 2
| Lop(Iconst_float s) -> 2
| Lop(Iconst_symbol s) -> 2
| Lop(Icall_ind) -> 6
@@ -370,7 +372,7 @@ let instr_size = function
if chunk = Byte_signed
then load_store_size addr + 1
else load_store_size addr
- | Lop(Istore(chunk, addr)) -> load_store_size addr
+ | Lop(Istore(chunk, addr, _)) -> load_store_size addr
| Lop(Ialloc n) -> 4
| Lop(Ispecific(Ialloc_far n)) -> 5
| Lop(Iintop Imod) -> 3
@@ -397,7 +399,7 @@ let instr_size = function
| Lsetuptrap lbl -> 1
| Lpushtrap -> 7
| Lpoptrap -> 1
- | Lraise -> 6
+ | Lraise _ -> 6
let label_map code =
let map = Hashtbl.create 37 in
@@ -492,7 +494,7 @@ let rec emit_instr i dslot =
| (_, _) ->
fatal_error "Emit: Imove"
end
- | Lop(Iconst_int n) ->
+ | Lop(Iconst_int n | Iconst_blockheader n) ->
if is_native_immediate n then
` li {emit_reg i.res.(0)}, {emit_nativeint n}\n`
else if n >= -0x8000_0000n && n <= 0x7FFF_FFFFn then begin
@@ -502,7 +504,8 @@ let rec emit_instr i dslot =
end else begin
` ld {emit_reg i.res.(0)}, {emit_tocref (TocInt n)}\n`
end
- | Lop(Iconst_float s) ->
+ | Lop(Iconst_float f) ->
+ let s = string_of_float f in
` lfd {emit_reg i.res.(0)}, {emit_tocref (TocFloat s)}\n`
| Lop(Iconst_symbol s) ->
` ld {emit_reg i.res.(0)}, {emit_tocref (TocSymOfs (s,0))}\n`
@@ -581,7 +584,7 @@ let rec emit_instr i dslot =
emit_load_store loadinstr addr i.arg 0 i.res.(0);
if chunk = Byte_signed then
` extsb {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
- | Lop(Istore(chunk, addr)) ->
+ | Lop(Istore(chunk, addr, _)) ->
let storeinstr =
match chunk with
Byte_unsigned | Byte_signed -> "stb"
@@ -772,7 +775,7 @@ let rec emit_instr i dslot =
` mr {emit_gpr 29}, {emit_gpr 11}\n`
| Lpoptrap ->
` ld {emit_gpr 29}, 0({emit_gpr 29})\n`
- | Lraise ->
+ | Lraise _ ->
` ld {emit_gpr 0}, 8({emit_gpr 29})\n`;
` ld {emit_gpr 1}, 16({emit_gpr 29})\n`;
` ld {emit_gpr 2}, 24({emit_gpr 29})\n`;
@@ -903,9 +906,11 @@ let emit_item = function
| Cint n ->
` .quad {emit_nativeint n}\n`
| Csingle f ->
- ` .float 0d{emit_string f}\n`
+ let s = string_of_float f in
+ ` .float 0d{emit_string s}\n`
| Cdouble f ->
- ` .double 0d{emit_string f}\n`
+ let s = string_of_float f in
+ ` .double 0d{emit_string s}\n`
| Csymbol_address s ->
` .quad {emit_symbol s}\n`
| Clabel_address lbl ->
diff --git a/asmcomp/power64/proc.ml b/asmcomp/power64/proc.ml
index 372303d..a5a35f3 100644
--- a/asmcomp/power64/proc.ml
+++ b/asmcomp/power64/proc.ml
@@ -85,11 +85,11 @@ let rotate_registers = true
(* Representation of hard registers by pseudo-registers *)
let hard_int_reg =
- let v = Array.create 23 Reg.dummy in
+ let v = Array.make 23 Reg.dummy in
for i = 0 to 22 do v.(i) <- Reg.at_location Int (Reg i) done; v
let hard_float_reg =
- let v = Array.create 31 Reg.dummy in
+ let v = Array.make 31 Reg.dummy in
for i = 0 to 30 do v.(i) <- Reg.at_location Float (Reg(100 + i)) done; v
let all_phys_regs =
@@ -105,7 +105,7 @@ let stack_slot slot ty =
let calling_conventions
first_int last_int first_float last_float make_stack stack_ofs arg =
- let loc = Array.create (Array.length arg) Reg.dummy in
+ let loc = Array.make (Array.length arg) Reg.dummy in
let int = ref first_int in
let float = ref first_float in
let ofs = ref stack_ofs in
@@ -159,7 +159,7 @@ let loc_results res =
let poweropen_external_conventions first_int last_int
first_float last_float arg =
- let loc = Array.create (Array.length arg) Reg.dummy in
+ let loc = Array.make (Array.length arg) Reg.dummy in
let int = ref first_int in
let float = ref first_float in
let ofs = ref (14 * size_addr) in
diff --git a/asmcomp/power64/scheduling.ml b/asmcomp/power64/scheduling.ml
index b7bba9b..b582b6a 100644
--- a/asmcomp/power64/scheduling.ml
+++ b/asmcomp/power64/scheduling.ml
@@ -46,7 +46,7 @@ method reload_retaddr_latency = 12
method oper_issue_cycles = function
Iconst_float _ | Iconst_symbol _ -> 2
| Iload(_, Ibased(_, _)) -> 2
- | Istore(_, Ibased(_, _)) -> 2
+ | Istore(_, Ibased(_, _), _) -> 2
| Ialloc _ -> 4
| Iintop(Imod) -> 40 (* assuming full stall *)
| Iintop(Icomp _) -> 4
--
2.7.4

File diff suppressed because it is too large Load Diff

View File

@ -1,204 +0,0 @@
From 5abd39f1a1e4f7c4dd0c1b1252f98e7ee5a95e27 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 24 Oct 2014 12:59:23 +0200
Subject: [PATCH 09/20] ppc64le: Update for OCaml 4.02.0.
These are based on the power (ppc32) branch and some guesswork. In
particular, I'm not convinced that my changes to floating point
constant handling are correct.
Therefore these are not yet integrated into the main patch.
---
asmcomp/power64le/CSE.ml | 37 +++++++++++++++++++++++++++++++++++++
asmcomp/power64le/emit.mlp | 23 ++++++++++++++---------
asmcomp/power64le/proc.ml | 8 ++++----
asmcomp/power64le/scheduling.ml | 2 +-
4 files changed, 56 insertions(+), 14 deletions(-)
create mode 100644 asmcomp/power64le/CSE.ml
diff --git a/asmcomp/power64le/CSE.ml b/asmcomp/power64le/CSE.ml
new file mode 100644
index 0000000..ec10d2d
--- /dev/null
+++ b/asmcomp/power64le/CSE.ml
@@ -0,0 +1,37 @@
+(***********************************************************************)
+(* *)
+(* OCaml *)
+(* *)
+(* Xavier Leroy, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2014 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* CSE for the PowerPC *)
+
+open Arch
+open Mach
+open CSEgen
+
+class cse = object (self)
+
+inherit cse_generic as super
+
+method! class_of_operation op =
+ match op with
+ | Ispecific(Imultaddf | Imultsubf) -> Op_pure
+ | Ispecific(Ialloc_far _) -> Op_other
+ | _ -> super#class_of_operation op
+
+method! is_cheap_operation op =
+ match op with
+ | Iconst_int n | Iconst_blockheader n -> n <= 32767n && n >= -32768n
+ | _ -> false
+
+end
+
+let fundecl f =
+ (new cse)#fundecl f
diff --git a/asmcomp/power64le/emit.mlp b/asmcomp/power64le/emit.mlp
index 5736a18..3f34102 100644
--- a/asmcomp/power64le/emit.mlp
+++ b/asmcomp/power64le/emit.mlp
@@ -297,6 +297,7 @@ let name_for_int_comparison = function
let name_for_intop = function
Iadd -> "add"
| Imul -> "mulld"
+ | Imulh -> "mulhd"
| Idiv -> "divd"
| Iand -> "and"
| Ior -> "or"
@@ -359,7 +360,8 @@ let load_store_size = function
let instr_size = function
Lend -> 0
| Lop(Imove | Ispill | Ireload) -> 1
- | Lop(Iconst_int n) -> if is_native_immediate n then 1 else 2
+ | Lop(Iconst_int n | Iconst_blockheader n) ->
+ if is_native_immediate n then 1 else 2
| Lop(Iconst_float s) -> 2
| Lop(Iconst_symbol s) -> 2
| Lop(Icall_ind) -> 4
@@ -375,7 +377,7 @@ let instr_size = function
if chunk = Byte_signed
then load_store_size addr + 1
else load_store_size addr
- | Lop(Istore(chunk, addr)) -> load_store_size addr
+ | Lop(Istore(chunk, addr, _)) -> load_store_size addr
| Lop(Ialloc n) -> 4
| Lop(Ispecific(Ialloc_far n)) -> 5
| Lop(Iintop Imod) -> 3
@@ -402,7 +404,7 @@ let instr_size = function
| Lsetuptrap lbl -> 1
| Lpushtrap -> 7
| Lpoptrap -> 1
- | Lraise -> 6
+ | Lraise _ -> 6
let label_map code =
let map = Hashtbl.create 37 in
@@ -497,7 +499,7 @@ let rec emit_instr i dslot =
| (_, _) ->
fatal_error "Emit: Imove"
end
- | Lop(Iconst_int n) ->
+ | Lop(Iconst_int n | Iconst_blockheader n) ->
if is_native_immediate n then
` li {emit_reg i.res.(0)}, {emit_nativeint n}\n`
else if n >= -0x8000_0000n && n <= 0x7FFF_FFFFn then begin
@@ -507,7 +509,8 @@ let rec emit_instr i dslot =
end else begin
` ld {emit_reg i.res.(0)}, {emit_tocref (TocInt n)}\n`
end
- | Lop(Iconst_float s) ->
+ | Lop(Iconst_float f) ->
+ let s = string_of_float f in
` lfd {emit_reg i.res.(0)}, {emit_tocref (TocFloat s)}\n`
| Lop(Iconst_symbol s) ->
` ld {emit_reg i.res.(0)}, {emit_tocref (TocSymOfs (s,0))}\n`
@@ -576,7 +579,7 @@ let rec emit_instr i dslot =
emit_load_store loadinstr addr i.arg 0 i.res.(0);
if chunk = Byte_signed then
` extsb {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n`
- | Lop(Istore(chunk, addr)) ->
+ | Lop(Istore(chunk, addr, _)) ->
let storeinstr =
match chunk with
Byte_unsigned | Byte_signed -> "stb"
@@ -767,7 +770,7 @@ let rec emit_instr i dslot =
` mr {emit_gpr 29}, {emit_gpr 11}\n`
| Lpoptrap ->
` ld {emit_gpr 29}, 0({emit_gpr 29})\n`
- | Lraise ->
+ | Lraise _ ->
` ld {emit_gpr 0}, 8({emit_gpr 29})\n`;
` ld {emit_gpr 1}, 16({emit_gpr 29})\n`;
` ld {emit_gpr 2}, 24({emit_gpr 29})\n`;
@@ -895,9 +898,11 @@ let emit_item = function
| Cint n ->
` .quad {emit_nativeint n}\n`
| Csingle f ->
- ` .float 0d{emit_string f}\n`
+ let s = string_of_float f in
+ ` .float 0d{emit_string s}\n`
| Cdouble f ->
- ` .double 0d{emit_string f}\n`
+ let s = string_of_float f in
+ ` .double 0d{emit_string s}\n`
| Csymbol_address s ->
` .quad {emit_symbol s}\n`
| Clabel_address lbl ->
diff --git a/asmcomp/power64le/proc.ml b/asmcomp/power64le/proc.ml
index 9b98577..476c984 100644
--- a/asmcomp/power64le/proc.ml
+++ b/asmcomp/power64le/proc.ml
@@ -85,11 +85,11 @@ let rotate_registers = true
(* Representation of hard registers by pseudo-registers *)
let hard_int_reg =
- let v = Array.create 23 Reg.dummy in
+ let v = Array.make 23 Reg.dummy in
for i = 0 to 22 do v.(i) <- Reg.at_location Int (Reg i) done; v
let hard_float_reg =
- let v = Array.create 31 Reg.dummy in
+ let v = Array.make 31 Reg.dummy in
for i = 0 to 30 do v.(i) <- Reg.at_location Float (Reg(100 + i)) done; v
let all_phys_regs =
@@ -105,7 +105,7 @@ let stack_slot slot ty =
let calling_conventions
first_int last_int first_float last_float make_stack stack_ofs arg =
- let loc = Array.create (Array.length arg) Reg.dummy in
+ let loc = Array.make (Array.length arg) Reg.dummy in
let int = ref first_int in
let float = ref first_float in
let ofs = ref stack_ofs in
@@ -159,7 +159,7 @@ let loc_results res =
let poweropen_external_conventions first_int last_int
first_float last_float arg =
- let loc = Array.create (Array.length arg) Reg.dummy in
+ let loc = Array.make (Array.length arg) Reg.dummy in
let int = ref first_int in
let float = ref first_float in
let ofs = ref (14 * size_addr) in
diff --git a/asmcomp/power64le/scheduling.ml b/asmcomp/power64le/scheduling.ml
index b7bba9b..b582b6a 100644
--- a/asmcomp/power64le/scheduling.ml
+++ b/asmcomp/power64le/scheduling.ml
@@ -46,7 +46,7 @@ method reload_retaddr_latency = 12
method oper_issue_cycles = function
Iconst_float _ | Iconst_symbol _ -> 2
| Iload(_, Ibased(_, _)) -> 2
- | Istore(_, Ibased(_, _)) -> 2
+ | Istore(_, Ibased(_, _), _) -> 2
| Ialloc _ -> 4
| Iintop(Imod) -> 40 (* assuming full stall *)
| Iintop(Icomp _) -> 4
--
2.7.4

View File

@ -1,39 +0,0 @@
From e3a29e8c9e85c5d1a4dc28f2ab746dae57c2636b Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 10 May 2014 03:20:35 -0400
Subject: [PATCH 10/20] arm, arm64: Mark stack as non-executable.
The same fix as this one, which was only fully applied to
i686 & x86-64:
http://caml.inria.fr/mantis/view.php?id=4564
---
asmrun/arm.S | 3 +++
asmrun/arm64.S | 3 +++
2 files changed, 6 insertions(+)
diff --git a/asmrun/arm.S b/asmrun/arm.S
index 9720665..6a9eef0 100644
--- a/asmrun/arm.S
+++ b/asmrun/arm.S
@@ -498,3 +498,6 @@ caml_system__frametable:
.align 2
.type caml_system__frametable, %object
.size caml_system__frametable, .-caml_system__frametable
+
+ /* Mark stack as non-executable, PR#4564 */
+ .section .note.GNU-stack,"",%progbits
diff --git a/asmrun/arm64.S b/asmrun/arm64.S
index 9b4b9ab..c23168b 100644
--- a/asmrun/arm64.S
+++ b/asmrun/arm64.S
@@ -549,3 +549,6 @@ caml_system__frametable:
.align 3
.type caml_system__frametable, %object
.size caml_system__frametable, .-caml_system__frametable
+
+ /* Mark stack as non-executable, PR#4564 */
+ .section .note.GNU-stack,"",%progbits
--
2.7.4

View File

@ -1,118 +0,0 @@
From e48a32ed47b6b5a77653ca3b40afb7c26aca7123 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 1 Apr 2014 11:17:07 +0100
Subject: [PATCH 11/20] arg: Add no_arg and get_arg helper functions.
The no_arg function in this patch is a no-op. It will do something
useful in the followups.
The get_arg function simply checks the next position on the command
line exists and returns that argument or raises a Arg.Missing.
This patch should introduce no functional change, it is simply code
refactoring.
In particular, this should not change the treatment of Arg.current
(see: http://caml.inria.fr/mantis/view.php?id=5197#c11147)
---
stdlib/arg.ml | 47 ++++++++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 21 deletions(-)
diff --git a/stdlib/arg.ml b/stdlib/arg.ml
index d7b8ac0..a8f3964 100644
--- a/stdlib/arg.ml
+++ b/stdlib/arg.ml
@@ -134,56 +134,62 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
try assoc3 s !speclist
with Not_found -> stop (Unknown s)
in
+ let no_arg () = () in
+ let get_arg () =
+ if !current + 1 < l then argv.(!current + 1)
+ else stop (Missing s)
+ in
begin try
let rec treat_action = function
- | Unit f -> f ();
- | Bool f when !current + 1 < l ->
- let arg = argv.(!current + 1) in
+ | Unit f -> no_arg (); f ();
+ | Bool f ->
+ let arg = get_arg () in
begin try f (bool_of_string arg)
with Invalid_argument "bool_of_string" ->
raise (Stop (Wrong (s, arg, "a boolean")))
end;
incr current;
- | Set r -> r := true;
- | Clear r -> r := false;
- | String f when !current + 1 < l ->
- f argv.(!current + 1);
+ | Set r -> no_arg (); r := true;
+ | Clear r -> no_arg (); r := false;
+ | String f ->
+ let arg = get_arg () in
+ f arg;
incr current;
- | Symbol (symb, f) when !current + 1 < l ->
- let arg = argv.(!current + 1) in
+ | Symbol (symb, f) ->
+ let arg = get_arg () in
if List.mem arg symb then begin
- f argv.(!current + 1);
+ f arg;
incr current;
end else begin
raise (Stop (Wrong (s, arg, "one of: "
^ (make_symlist "" " " "" symb))))
end
- | Set_string r when !current + 1 < l ->
- r := argv.(!current + 1);
+ | Set_string r ->
+ r := get_arg ();
incr current;
- | Int f when !current + 1 < l ->
- let arg = argv.(!current + 1) in
+ | Int f ->
+ let arg = get_arg () in
begin try f (int_of_string arg)
with Failure "int_of_string" ->
raise (Stop (Wrong (s, arg, "an integer")))
end;
incr current;
- | Set_int r when !current + 1 < l ->
- let arg = argv.(!current + 1) in
+ | Set_int r ->
+ let arg = get_arg () in
begin try r := (int_of_string arg)
with Failure "int_of_string" ->
raise (Stop (Wrong (s, arg, "an integer")))
end;
incr current;
- | Float f when !current + 1 < l ->
- let arg = argv.(!current + 1) in
+ | Float f ->
+ let arg = get_arg () in
begin try f (float_of_string arg);
with Failure "float_of_string" ->
raise (Stop (Wrong (s, arg, "a float")))
end;
incr current;
- | Set_float r when !current + 1 < l ->
- let arg = argv.(!current + 1) in
+ | Set_float r ->
+ let arg = get_arg () in
begin try r := (float_of_string arg);
with Failure "float_of_string" ->
raise (Stop (Wrong (s, arg, "a float")))
@@ -196,7 +202,6 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
f argv.(!current + 1);
incr current;
done;
- | _ -> raise (Stop (Missing s))
in
treat_action action
with Bad m -> stop (Message m);
--
2.7.4

View File

@ -1,84 +0,0 @@
From b5e341afca2bdb390255cb74b3e3f5d1e3971590 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 1 Apr 2014 11:21:40 +0100
Subject: [PATCH 12/20] arg: Allow flags such as --flag=arg as well as --flag
arg.
Allow flags to be followed directly by their argument, separated by an '='
sign. This is consistent with what GNU getopt_long and many other
command line parsing libraries allow.
Fix for the following issue:
http://caml.inria.fr/mantis/view.php?id=5197
---
stdlib/arg.ml | 30 ++++++++++++++++++++++++------
stdlib/arg.mli | 3 ++-
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/stdlib/arg.ml b/stdlib/arg.ml
index a8f3964..f2b6f13 100644
--- a/stdlib/arg.ml
+++ b/stdlib/arg.ml
@@ -55,6 +55,12 @@ let rec assoc3 x l =
| _ :: t -> assoc3 x t
;;
+let split s =
+ let i = String.index s '=' in
+ let len = String.length s in
+ String.sub s 0 i, String.sub s (i+1) (len-(i+1))
+;;
+
let make_symlist prefix sep suffix l =
match l with
| [] -> "<none>"
@@ -130,14 +136,26 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
while !current < l do
let s = argv.(!current) in
if String.length s >= 1 && s.[0] = '-' then begin
- let action =
- try assoc3 s !speclist
- with Not_found -> stop (Unknown s)
+ let action, follow =
+ try assoc3 s !speclist, None
+ with Not_found ->
+ try
+ let keyword, arg = split s in
+ assoc3 keyword !speclist, Some arg
+ with Not_found -> stop (Unknown s)
in
- let no_arg () = () in
+ let no_arg () =
+ match follow with
+ | None -> ()
+ | Some arg -> stop (Wrong (s, arg, "no argument")) in
let get_arg () =
- if !current + 1 < l then argv.(!current + 1)
- else stop (Missing s)
+ match follow with
+ | None ->
+ if !current + 1 < l then argv.(!current + 1)
+ else stop (Missing s)
+ | Some arg ->
+ decr current;
+ arg
in
begin try
let rec treat_action = function
diff --git a/stdlib/arg.mli b/stdlib/arg.mli
index 0999edf..71af638 100644
--- a/stdlib/arg.mli
+++ b/stdlib/arg.mli
@@ -25,7 +25,8 @@
[Unit], [Set] and [Clear] keywords take no argument. A [Rest]
keyword takes the remaining of the command line as arguments.
Every other keyword takes the following word on the command line
- as argument.
+ as argument. For compatibility with GNU getopt_long, [keyword=arg]
+ is also allowed.
Arguments not preceded by a keyword are called anonymous arguments.
Examples ([cmd] is assumed to be the command name):
--
2.7.4

File diff suppressed because it is too large Load Diff

View File

@ -1,74 +0,0 @@
From e6b37c1b0c9ee724ae81b74a84e133a75ed9e3a3 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 11 Sep 2014 14:49:54 +0100
Subject: [PATCH 14/20] ppc, ppc64, ppc64le: Mark stack as non-executable.
The same fix as this one, which was only fully applied to
i686 & x86-64:
http://caml.inria.fr/mantis/view.php?id=4564
---
asmcomp/power/emit.mlp | 3 ++-
asmcomp/power64/emit.mlp | 3 ++-
asmcomp/power64le/emit.mlp | 3 ++-
asmrun/power-elf.S | 3 +++
asmrun/power64-elf.S | 2 ++
5 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp
index 4344085..717ab12 100644
--- a/asmcomp/power/emit.mlp
+++ b/asmcomp/power/emit.mlp
@@ -927,4 +927,5 @@ let end_assembly() =
` .long ({emit_label lbl} - .) + {emit_int32 ofs}\n`);
efa_def_label = (fun l -> `{emit_label l}:\n`);
efa_string = (fun s -> emit_bytes_directive " .byte " (s ^ "\000"))
- }
+ };
+ `.section .note.GNU-stack,\"\",%progbits; .previous\n`
diff --git a/asmcomp/power64/emit.mlp b/asmcomp/power64/emit.mlp
index 9fd59b2..4e0317a 100644
--- a/asmcomp/power64/emit.mlp
+++ b/asmcomp/power64/emit.mlp
@@ -990,4 +990,5 @@ let end_assembly() =
`{emit_symbol lbl}:\n`;
` .quad {emit_int (List.length !frame_descriptors)}\n`;
List.iter emit_frame !frame_descriptors;
- frame_descriptors := []
+ frame_descriptors := [];
+ `.section .note.GNU-stack,\"\",%progbits; .previous\n`
diff --git a/asmcomp/power64le/emit.mlp b/asmcomp/power64le/emit.mlp
index 3f34102..60df72c 100644
--- a/asmcomp/power64le/emit.mlp
+++ b/asmcomp/power64le/emit.mlp
@@ -983,4 +983,5 @@ let end_assembly() =
`{emit_symbol lbl}:\n`;
` .quad {emit_int (List.length !frame_descriptors)}\n`;
List.iter emit_frame !frame_descriptors;
- frame_descriptors := []
+ frame_descriptors := [];
+ `.section .note.GNU-stack,\"\",%progbits; .previous\n`
diff --git a/asmrun/power-elf.S b/asmrun/power-elf.S
index facbfbf..14d28a0 100644
--- a/asmrun/power-elf.S
+++ b/asmrun/power-elf.S
@@ -478,3 +478,6 @@ caml_system__frametable:
.long .L105 + 4 /* return address into callback */
.short -1 /* negative size count => use callback link */
.short 0 /* no roots here */
+
+/* Mark stack as non-executable, PR#4564 */
+ .section .note.GNU-stack,"",%progbits
diff --git a/asmrun/power64-elf.S b/asmrun/power64-elf.S
index 98c42e2..b7bfce4 100644
--- a/asmrun/power64-elf.S
+++ b/asmrun/power64-elf.S
@@ -577,3 +577,5 @@ caml_system__frametable:
.short 0 /* no roots here */
.align 3
+/* Mark stack as non-executable, PR#4564 */
+ .section .note.GNU-stack,"",%progbits
--
2.7.4

View File

@ -1,84 +0,0 @@
From 3f2be69df7fa930e0584abc217ef9d06b1155696 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 24 Oct 2014 10:10:54 +0100
Subject: [PATCH 15/20] ppc64/ppc64le: proc: Interim definitions for op_is_pure
and regs_are_volatile.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1156300
These are based somewhat on guesswork and need to be checked by
someone more familiar with the compiler and POWER architecture.
---
asmcomp/power64/proc.ml | 15 +++++++++++++++
asmcomp/power64le/proc.ml | 15 +++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/asmcomp/power64/proc.ml b/asmcomp/power64/proc.ml
index a5a35f3..c377f69 100644
--- a/asmcomp/power64/proc.ml
+++ b/asmcomp/power64/proc.ml
@@ -202,6 +202,10 @@ let loc_external_results res =
let loc_exn_bucket = phys_reg 0
+(* Volatile registers: none *)
+
+let regs_are_volatile rs = false
+
(* Registers destroyed by operations *)
let destroyed_at_c_call =
@@ -226,6 +230,17 @@ let max_register_pressure = function
Iextcall(_, _) -> [| 15; 18 |]
| _ -> [| 23; 30 |]
+(* Pure operations (without any side effect besides updating their result
+ registers). *)
+
+let op_is_pure = function
+ | Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
+ | Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
+ | Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) -> false
+ | Ispecific(Imultaddf | Imultsubf) -> true
+ | Ispecific _ -> false
+ | _ -> true
+
(* Layout of the stack *)
let num_stack_slots = [| 0; 0 |]
diff --git a/asmcomp/power64le/proc.ml b/asmcomp/power64le/proc.ml
index 476c984..56473ac 100644
--- a/asmcomp/power64le/proc.ml
+++ b/asmcomp/power64le/proc.ml
@@ -202,6 +202,10 @@ let loc_external_results res =
let loc_exn_bucket = phys_reg 0
+(* Volatile registers: none *)
+
+let regs_are_volatile rs = false
+
(* Registers destroyed by operations *)
let destroyed_at_c_call =
@@ -226,6 +230,17 @@ let max_register_pressure = function
Iextcall(_, _) -> [| 15; 18 |]
| _ -> [| 23; 30 |]
+(* Pure operations (without any side effect besides updating their result
+ registers). *)
+
+let op_is_pure = function
+ | Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
+ | Iextcall _ | Istackoffset _ | Istore _ | Ialloc _
+ | Iintop(Icheckbound) | Iintop_imm(Icheckbound, _) -> false
+ | Ispecific(Imultaddf | Imultsubf) -> true
+ | Ispecific _ -> false
+ | _ -> true
+
(* Layout of the stack *)
let num_stack_slots = [| 0; 0 |]
--
2.7.4

View File

@ -1,34 +0,0 @@
From 3aff352bb01751cddeb2b18c26576337d1b46c90 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 28 May 2015 16:13:40 -0400
Subject: [PATCH 16/20] ppc64le: Fix calling convention of external functions
with > 8 parameters (RHBZ#1225995).
For external (ie. C) functions with more than 8 parameters, we must
pass the first 8 parameters in registers and then all the remaining
parameters on the stack.
Unfortunately the original backend copied the stack offset from ppc64,
where it works, but the offset was wrong for ppc64le.
By experimentation I found the correct offset.
---
asmcomp/power64le/proc.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/asmcomp/power64le/proc.ml b/asmcomp/power64le/proc.ml
index 56473ac..c705695 100644
--- a/asmcomp/power64le/proc.ml
+++ b/asmcomp/power64le/proc.ml
@@ -188,7 +188,7 @@ let poweropen_external_conventions first_int last_int
let loc_external_arguments =
match Config.system with
| "rhapsody" -> poweropen_external_conventions 0 7 100 112
- | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 48
+ | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 32
| _ -> assert false
let extcall_use_push = false
--
2.7.4

View File

@ -1,26 +0,0 @@
From 8f8713a113a218e7d7203c1575e8302f49821f41 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 29 Jun 2015 08:31:31 -0400
Subject: [PATCH 17/20] ppc64: Fix PIC variant of asmrun.
---
asmrun/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/asmrun/Makefile b/asmrun/Makefile
index a63321e..4aa2fc9 100644
--- a/asmrun/Makefile
+++ b/asmrun/Makefile
@@ -128,6 +128,9 @@ power64.o: power64-$(SYSTEM).o
power64.p.o: power64-$(SYSTEM).o
cp power64-$(SYSTEM).o power64.p.o
+power64.pic.o: power64-$(SYSTEM).pic.o
+ cp power64-$(SYSTEM).pic.o power64.pic.o
+
power64le.o: power64le-$(SYSTEM).o
cp power64le-$(SYSTEM).o power64le.o
--
2.7.4

View File

@ -1,26 +0,0 @@
From 184190bc52eb86fe37864acc4679297a52756b01 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 29 Jun 2015 08:32:31 -0400
Subject: [PATCH 18/20] ppc64le: Fix PIC variant of asmrun.
---
asmrun/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/asmrun/Makefile b/asmrun/Makefile
index 4aa2fc9..8997e15 100644
--- a/asmrun/Makefile
+++ b/asmrun/Makefile
@@ -137,6 +137,9 @@ power64le.o: power64le-$(SYSTEM).o
power64le.p.o: power64le-$(SYSTEM).o
cp power64le-$(SYSTEM).o power64le.p.o
+power64le.pic.o: power64le-$(SYSTEM).pic.o
+ cp power64le-$(SYSTEM).pic.o power64le.pic.o
+
main.c: ../byterun/main.c
ln -s ../byterun/main.c main.c
misc.c: ../byterun/misc.c
--
2.7.4

View File

@ -1,45 +0,0 @@
From 351e776744c56bf6c4afb75e8e9f510e89c15233 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 29 Jun 2015 14:18:38 -0400
Subject: [PATCH 19/20] =?UTF-8?q?ppc64/ppc64le:=20Fix=20behaviour=20of=20I?=
=?UTF-8?q?nt64.max=5Fint=20=C3=B7=20-1=20(RHBZ#1236615).?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
I only tested this on ppc64le, but assume the behaviour is the
same on ppc64.
---
asmcomp/power64/arch.ml | 2 +-
asmcomp/power64le/arch.ml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/asmcomp/power64/arch.ml b/asmcomp/power64/arch.ml
index 73c516d..ccd11fc 100644
--- a/asmcomp/power64/arch.ml
+++ b/asmcomp/power64/arch.ml
@@ -46,7 +46,7 @@ let allow_unaligned_access = false
(* Behavior of division *)
-let division_crashes_on_overflow = false
+let division_crashes_on_overflow = true
(* Operations on addressing modes *)
diff --git a/asmcomp/power64le/arch.ml b/asmcomp/power64le/arch.ml
index 586534b..2155e79 100644
--- a/asmcomp/power64le/arch.ml
+++ b/asmcomp/power64le/arch.ml
@@ -46,7 +46,7 @@ let allow_unaligned_access = false
(* Behavior of division *)
-let division_crashes_on_overflow = false
+let division_crashes_on_overflow = true
(* Operations on addressing modes *)
--
2.7.4

View File

@ -1,88 +0,0 @@
From 27381a26db4604d9f37ab9f1a12f885d1dbd278a Mon Sep 17 00:00:00 2001
From: Damien Doligez <damien.doligez-inria.fr>
Date: Mon, 19 Oct 2015 15:47:33 +0000
Subject: [PATCH 20/20] fix PR#7003 and a few other bugs caused by misuse of
Int_val
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
(cherry picked from commit 659615c7b100a89eafe6253e7a5b9d84d0e8df74)
---
Changes | 2 ++
byterun/alloc.c | 4 ++--
byterun/intern.c | 2 +-
byterun/str.c | 4 ++--
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Changes b/Changes
index 3587d44..9649e1a 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,8 @@ OCaml 4.02.3:
-------------
Bug fixes:
+- PR#7003: String.sub causes segmentation fault
+ (Damien Doligez, report by Radek Micek)
- PR#6908: Top-level custom printing for GADTs: interface change in 4.02.2
(Grégoire Henry, report by Jeremy Yallop)
- PR#6919: corrupted final_table
diff --git a/byterun/alloc.c b/byterun/alloc.c
index b421cac..3d7dfc4 100644
--- a/byterun/alloc.c
+++ b/byterun/alloc.c
@@ -147,7 +147,7 @@ CAMLexport int caml_convert_flag_list(value list, int *flags)
CAMLprim value caml_alloc_dummy(value size)
{
- mlsize_t wosize = Int_val(size);
+ mlsize_t wosize = Long_val(size);
if (wosize == 0) return Atom(0);
return caml_alloc (wosize, 0);
@@ -161,7 +161,7 @@ CAMLprim value caml_alloc_dummy_function(value size,value arity)
CAMLprim value caml_alloc_dummy_float (value size)
{
- mlsize_t wosize = Int_val(size) * Double_wosize;
+ mlsize_t wosize = Long_val(size) * Double_wosize;
if (wosize == 0) return Atom(0);
return caml_alloc (wosize, 0);
diff --git a/byterun/intern.c b/byterun/intern.c
index 6f2d49f..4ddc8d0 100644
--- a/byterun/intern.c
+++ b/byterun/intern.c
@@ -287,7 +287,7 @@ static void intern_rec(value *dest)
case OFreshOID:
/* Refresh the object ID */
/* but do not do it for predefined exception slots */
- if (Int_val(Field((value)dest, 1)) >= 0)
+ if (Long_val(Field((value)dest, 1)) >= 0)
caml_set_oo_id((value)dest);
/* Pop item and iterate */
sp--;
diff --git a/byterun/str.c b/byterun/str.c
index d88c3d2..5bc4e0a 100644
--- a/byterun/str.c
+++ b/byterun/str.c
@@ -266,7 +266,7 @@ CAMLprim value caml_string_greaterequal(value s1, value s2)
CAMLprim value caml_blit_string(value s1, value ofs1, value s2, value ofs2,
value n)
{
- memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n));
+ memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Long_val(n));
return Val_unit;
}
@@ -293,7 +293,7 @@ CAMLprim value caml_is_printable(value chr)
CAMLprim value caml_bitvect_test(value bv, value n)
{
- int pos = Int_val(n);
+ intnat pos = Long_val(n);
return Val_int(Byte_u(bv, pos >> 3) & (1 << (pos & 7)));
}
--
2.7.4

View File

@ -15,9 +15,19 @@
%global natdynlink 0
%endif
# 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
# These are the architectures for which the tests must pass otherwise
# the build will fail.
%global test_arches_required %{power64} x86_64
# Architectures where parallel builds fail.
%global no_parallel_build_arches aarch64
Name: ocaml
Version: 4.02.3
Release: 3%{?dist}
Version: 4.04.0
Release: 0.1.beta2%{?dist}
Summary: OCaml compiler and programming environment
@ -25,10 +35,12 @@ License: QPL and (LGPLv2+ with exceptions)
URL: http://www.ocaml.org
Source0: http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-%{version}.tar.gz
Source1: http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02-refman-html.tar.gz
Source2: http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02-refman.pdf
Source3: http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02-refman.info.tar.gz
#Source0: http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-%{version}.tar.gz
Source0: https://github.com/ocaml/ocaml/archive/4.04.0+beta2.tar.gz
Source1: http://caml.inria.fr/pub/distrib/ocaml-4.03/ocaml-4.03-refman-html.tar.gz
Source2: http://caml.inria.fr/pub/distrib/ocaml-4.03/ocaml-4.03-refman.pdf
Source3: http://caml.inria.fr/pub/distrib/ocaml-4.03/ocaml-4.03-refman.info.tar.gz
# IMPORTANT NOTE:
#
@ -39,36 +51,18 @@ Source3: http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02-refman.in
#
# https://git.fedorahosted.org/cgit/fedora-ocaml.git/
#
# Current branch: fedora-24-4.02
# Current branch: fedora-26-4.04.0-beta2
#
# 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-ignore-.-configure-it-s-a-real-git-file.patch
Patch0002: 0002-Ensure-empty-compilerlibs-directory-is-created-by-gi.patch
Patch0003: 0003-Don-t-add-rpaths-to-libraries.patch
Patch0004: 0004-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch
Patch0005: 0005-configure-Allow-user-defined-C-compiler-flags.patch
Patch0006: 0006-Add-support-for-ppc64.patch
Patch0007: 0007-ppc64-Update-for-OCaml-4.02.0.patch
Patch0008: 0008-Add-support-for-ppc64le.patch
Patch0009: 0009-ppc64le-Update-for-OCaml-4.02.0.patch
Patch0010: 0010-arm-arm64-Mark-stack-as-non-executable.patch
Patch0011: 0011-arg-Add-no_arg-and-get_arg-helper-functions.patch
Patch0012: 0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch
Patch0013: 0013-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch
Patch0014: 0014-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch
Patch0015: 0015-ppc64-ppc64le-proc-Interim-definitions-for-op_is_pur.patch
Patch0016: 0016-ppc64le-Fix-calling-convention-of-external-functions.patch
Patch0017: 0017-ppc64-Fix-PIC-variant-of-asmrun.patch
Patch0018: 0018-ppc64le-Fix-PIC-variant-of-asmrun.patch
Patch0019: 0019-ppc64-ppc64le-Fix-behaviour-of-Int64.max_int-1-RHBZ-.patch
Patch0020: 0020-fix-PR-7003-and-a-few-other-bugs-caused-by-misuse-of.patch
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
# Add BFD support so that ocamlobjinfo supports *.cmxs format (RHBZ#1113735).
BuildRequires: binutils-devel
BuildRequires: ncurses-devel
BuildRequires: gdbm-devel
BuildRequires: emacs
@ -88,9 +82,6 @@ BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: chrpath
# git is required for patch management.
BuildRequires: git
Requires: gcc
# Because we pass -c flag to ocaml-find-requires (to avoid circular
@ -103,8 +94,8 @@ Provides: bundled(md5-plumb)
Provides: ocaml(compiler) = %{version}
%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo'
%global __ocaml_provides_opts -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo'
%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte'
%global __ocaml_provides_opts -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte'
%description
@ -196,32 +187,19 @@ may not be portable between versions.
%prep
%setup -q -T -b 0 -n %{name}-%{version}
%setup -q -T -D -a 1 -n %{name}-%{version}
%setup -q -T -D -a 3 -n %{name}-%{version}
%setup -q -T -b 0 -n %{name}-%{version}-beta2
%setup -q -T -D -a 1 -n %{name}-%{version}-beta2
%setup -q -T -D -a 3 -n %{name}-%{version}-beta2
cp %{SOURCE2} refman.pdf
git init
git config user.email "noone@example.com"
git config user.name "no one"
git add .
git add -f configure .depend ;# required because .gitignore lists these files
git commit -a -q -m "%{version} baseline"
git am %{patches} </dev/null
%autopatch -p1
%build
# make -jN (N > 1) breaks the build. Therefore we cannot use
# %{?_smp_mflags} nor MAKEFLAGS.
%ifnarch %{no_parallel_build_arches}
make="make %{?_smp_mflags}"
%else
unset MAKEFLAGS
# For ppc64 we need a larger stack than default to compile some files
# because the stages in the OCaml compiler are not mutually tail
# recursive.
%ifarch ppc64 ppc64le
ulimit -a
ulimit -Hs 65536
ulimit -Ss 65536
make=make
%endif
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
@ -232,9 +210,10 @@ CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
-x11include %{_includedir} \
-mandir %{_mandir}/man1 \
-no-curses
make world
$make world
%if %{native_compiler}
make opt opt.opt
$make opt
$make opt.opt
%endif
make -C emacs ocamltags
@ -249,18 +228,15 @@ boot/ocamlrun ./ocamlc $includes dynlinkaux.cmo ocamlbyteinfo.ml -o ocamlbyteinf
%check
%ifarch %{test_arches}
cd testsuite
# See comments above.
unset MAKEFLAGS
%ifarch ppc64 ppc64le
ulimit -a
ulimit -Hs 65536
ulimit -Ss 65536
%ifarch %{test_arches_required}
make -j1 all
%else
make -j1 all ||:
%endif
%endif
make all ||:
%install
@ -317,37 +293,53 @@ fi
%files
%doc LICENSE
%{_bindir}/ocaml
%{_bindir}/ocamlbyteinfo
%{_bindir}/ocamlbuild
%{_bindir}/ocamlbuild.byte
%if %{native_compiler}
%{_bindir}/ocamlbuild.native
%endif
%{_bindir}/ocamlc
%if %{native_compiler}
%{_bindir}/ocamlc.opt
%endif
%{_bindir}/ocamlcp
%{_bindir}/ocamldebug
#%{_bindir}/ocamlplugininfo
%{_bindir}/ocamlyacc
# symlink to either .byte or .opt version
%{_bindir}/ocamlc
%{_bindir}/ocamlcp
%{_bindir}/ocamldep
%if %{native_compiler}
%{_bindir}/ocamldep.opt
%endif
%{_bindir}/ocamllex
%if %{native_compiler}
%{_bindir}/ocamllex.opt
%endif
%{_bindir}/ocamlmklib
%{_bindir}/ocamlmktop
%{_bindir}/ocamlobjinfo
%{_bindir}/ocamloptp
%{_bindir}/ocamlprof
# bytecode versions
%{_bindir}/ocamlc.byte
%{_bindir}/ocamlcp.byte
%{_bindir}/ocamldep.byte
%{_bindir}/ocamllex.byte
%{_bindir}/ocamlmklib.byte
%{_bindir}/ocamlmktop.byte
%{_bindir}/ocamlobjinfo.byte
%{_bindir}/ocamloptp.byte
%{_bindir}/ocamlprof.byte
%if %{native_compiler}
# native code versions
%{_bindir}/ocamlc.opt
%{_bindir}/ocamlcp.opt
%{_bindir}/ocamldep.opt
%{_bindir}/ocamllex.opt
%{_bindir}/ocamlmklib.opt
%{_bindir}/ocamlmktop.opt
%{_bindir}/ocamlobjinfo.opt
%{_bindir}/ocamloptp.opt
%{_bindir}/ocamlprof.opt
%endif
%if %{native_compiler}
%{_bindir}/ocamlopt
%{_bindir}/ocamlopt.byte
%{_bindir}/ocamlopt.opt
%endif
%{_bindir}/ocamloptp
#%{_bindir}/ocamlplugininfo
%{_bindir}/ocamlprof
%{_bindir}/ocamlyacc
#%{_libdir}/ocaml/addlabels
#%{_libdir}/ocaml/scrapelabels
%{_libdir}/ocaml/camlheader
@ -377,12 +369,11 @@ fi
%{_libdir}/ocaml/threads/*.cmx
%endif
%{_libdir}/ocaml/caml
%{_libdir}/ocaml/ocamlbuild
%exclude %{_libdir}/ocaml/graphicsX11.mli
%files runtime
%doc README LICENSE Changes
%doc README.adoc LICENSE Changes
%{_bindir}/ocamlrun
%dir %{_libdir}/ocaml
%{_libdir}/ocaml/VERSION
@ -446,6 +437,15 @@ fi
%changelog
* Thu Nov 03 2016 Richard W.M. Jones <rjones@redhat.com> - 4.04.0-0.1.beta2
- New upstream version 4.04.0+beta2.
- Remove our downstream ppc64 backends, and switch to upstream power backend.
- Use autopatch instead of git for patching.
- Allow parallel builds again.
- Restore ppc stack limits.
- Remove ocamlbuild.
- Add *.byte bytecode binaries.
* Wed May 04 2016 Richard W.M. Jones <rjones@redhat.com> - 4.02.3-3
- CVE-2015-8869 ocaml: sizes arguments are sign-extended from
32 to 64 bits (RHBZ#1332090)

View File

@ -1,4 +1,4 @@
20b691d71d36df69f9cb16ab4521ed49 ocaml-4.02-refman-html.tar.gz
265b7db123e925e8b7b70ca2266b4206 ocaml-4.02-refman.info.tar.gz
1d683029a6ef48e34cc24eb1982cdd05 ocaml-4.02-refman.pdf
ef1a324608c97031cbd92a442d685ab7 ocaml-4.02.3.tar.gz
92570f6b3cecf04427c3d30f9ffaff4d 4.04.0+beta2.tar.gz
d3e44d3984d029d2e88ba219ad8e24c2 ocaml-4.03-refman-html.tar.gz
4cf4acfe6b2a09610918bb9989595125 ocaml-4.03-refman.info.tar.gz
b331d36a2913348ac27a0f24aaa03871 ocaml-4.03-refman.pdf