From 2730b0fa320ebe6d264132c95b1b8d11df2c01b7 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Nov 11 2016 12:15:04 +0000 Subject: riscv64: Fix intermediate operands. (https://github.com/nojb/riscv-ocaml/issues/1) --- diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 2a448f7..10056ae 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From fc5ac0d955afce294fe58a20cab8e9dda572de78 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/6] Don't add rpaths to libraries. +Subject: [PATCH 1/7] Don't add rpaths to libraries. --- tools/Makefile.shared | 6 +++--- diff --git a/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch b/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch index c33cedb..1c6a5bf 100644 --- a/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch +++ b/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch @@ -1,7 +1,7 @@ From 61bdb02cedd1be6ecdc37bc4a80ffe3f19aa5521 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:40:36 +0100 -Subject: [PATCH 2/6] ocamlbyteinfo, ocamlplugininfo: Useful utilities from +Subject: [PATCH 2/7] ocamlbyteinfo, ocamlplugininfo: Useful utilities from Debian, sent upstream. See: diff --git a/0003-configure-Allow-user-defined-C-compiler-flags.patch b/0003-configure-Allow-user-defined-C-compiler-flags.patch index 4f359ed..96a9f2c 100644 --- a/0003-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0003-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From 2f93494aea56c9216bb561800a6861b653f409ce Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 3/6] configure: Allow user defined C compiler flags. +Subject: [PATCH 3/7] configure: Allow user defined C compiler flags. --- configure | 4 ++++ diff --git a/0004-Don-t-rewrite-Werror.patch b/0004-Don-t-rewrite-Werror.patch index fc707b3..6b7d74c 100644 --- a/0004-Don-t-rewrite-Werror.patch +++ b/0004-Don-t-rewrite-Werror.patch @@ -1,7 +1,7 @@ From cdd42ba82210bfaa97cfa010eaac3d805b80cb49 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Nov 2016 19:50:20 +0000 -Subject: [PATCH 4/6] Don't rewrite -Werror. +Subject: [PATCH 4/7] Don't rewrite -Werror. In Fedora our CFLAGS contains -Wall -Werror=format-security. diff --git a/0005-RISC-V-support-2016-11-08.patch b/0005-RISC-V-support-2016-11-08.patch index df0ac11..042268e 100644 --- a/0005-RISC-V-support-2016-11-08.patch +++ b/0005-RISC-V-support-2016-11-08.patch @@ -1,7 +1,7 @@ From 4d586c823b021c3091aab7bb3f88f1678c194558 Mon Sep 17 00:00:00 2001 From: Nicolas Ojeda Bar Date: Fri, 4 Nov 2016 20:39:09 +0100 -Subject: [PATCH 5/6] RISC-V support 2016-11-08 +Subject: [PATCH 5/7] RISC-V support 2016-11-08 This commit contains the squashed commits from: diff --git a/0006-PR-7405-s390x-Fix-address-of-caml_raise_exn-in-nativ.patch b/0006-PR-7405-s390x-Fix-address-of-caml_raise_exn-in-nativ.patch index f89e77a..2f3d4fc 100644 --- a/0006-PR-7405-s390x-Fix-address-of-caml_raise_exn-in-nativ.patch +++ b/0006-PR-7405-s390x-Fix-address-of-caml_raise_exn-in-nativ.patch @@ -1,7 +1,7 @@ From d82ea2b77261e030be5a75d0277ce5b62b52b751 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 9 Nov 2016 11:01:15 -0500 -Subject: [PATCH 6/6] PR#7405: s390x: Fix address of caml_raise_exn in native +Subject: [PATCH 6/7] PR#7405: s390x: Fix address of caml_raise_exn in native dynlink modules. This commit started as Fedora patch e732c39340e86939530a087744caa8d8f1247878. diff --git a/0007-Try-fix-for-andi-ori-xori-immediates-1.patch b/0007-Try-fix-for-andi-ori-xori-immediates-1.patch new file mode 100644 index 0000000..816caab --- /dev/null +++ b/0007-Try-fix-for-andi-ori-xori-immediates-1.patch @@ -0,0 +1,44 @@ +From fcb3b532e59bef94af09047b0199a1c32caeaa27 Mon Sep 17 00:00:00 2001 +From: Nicolas Ojeda Bar +Date: Thu, 10 Nov 2016 14:12:53 +0100 +Subject: [PATCH 7/7] Try fix for andi/ori/xori immediates (#1) + +(cherry picked from commit 4e01c71358c8f7571914c09369a402e6e290f6c9) +--- + asmcomp/riscv/selection.ml | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/asmcomp/riscv/selection.ml b/asmcomp/riscv/selection.ml +index da69f09..a1cbb82 100644 +--- a/asmcomp/riscv/selection.ml ++++ b/asmcomp/riscv/selection.ml +@@ -36,11 +36,6 @@ method! select_operation op args = + match (op, args) with + (* RISC-V does not support immediate operands for multiply high *) + | (Cmulhi, _) -> (Iintop Imulh, args) +- (* The and, or and xor instructions have a different range of immediate +- operands than the other instructions *) +- | (Cand, _) -> self#select_logical Iand args +- | (Cor, _) -> self#select_logical Ior args +- | (Cxor, _) -> self#select_logical Ixor args + (* Recognize (neg-)mult-add and (neg-)mult-sub instructions *) + | (Caddf, [Cop(Cmulf, [arg1; arg2]); arg3]) + | (Caddf, [arg3; Cop(Cmulf, [arg1; arg2])]) -> +@@ -58,14 +53,6 @@ method! select_operation op args = + | _ -> + super#select_operation op args + +-method select_logical op = function +- | [arg; Cconst_int n] when n >= 0 && n <= 0xFFF -> +- (Iintop_imm(op, n), [arg]) +- | [Cconst_int n; arg] when n >= 0 && n <= 0xFFF -> +- (Iintop_imm(op, n), [arg]) +- | args -> +- (Iintop op, args) +- + (* Instruction selection for conditionals *) + + method! select_condition = function +-- +2.9.3 + diff --git a/ocaml.spec b/ocaml.spec index 2d2b511..2030e4b 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -27,7 +27,7 @@ Name: ocaml Version: 4.04.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -64,6 +64,8 @@ Patch0004: 0004-Don-t-rewrite-Werror.patch # https://github.com/nojb/riscv-ocaml Patch0005: 0005-RISC-V-support-2016-11-08.patch Patch0006: 0006-PR-7405-s390x-Fix-address-of-caml_raise_exn-in-nativ.patch +# https://github.com/nojb/riscv-ocaml/issues/1 +Patch0007: 0007-Try-fix-for-andi-ori-xori-immediates-1.patch BuildRequires: binutils-devel BuildRequires: ncurses-devel @@ -440,6 +442,10 @@ fi %changelog +* Fri Nov 11 2016 Richard W.M. Jones - 4.04.0-4 +- riscv64: Fix intermediate operands. + (https://github.com/nojb/riscv-ocaml/issues/1) + * Wed Nov 09 2016 Richard W.M. Jones - 4.04.0-3 - s390x: Fix address of caml_raise_exn in native dynlink modules. (https://caml.inria.fr/mantis/view.php?id=7405)