Fixes for ppc64/ppc64le (RHBZ#1156300).

This commit is contained in:
Richard W.M. Jones 2014-10-24 10:15:31 +01:00
parent eaa1438730
commit a7ead0bb4e
14 changed files with 114 additions and 26 deletions

View File

@ -1,7 +1,7 @@
From ccc1bf226619608230dc94b26377756719cf7b20 Mon Sep 17 00:00:00 2001 From ccc1bf226619608230dc94b26377756719cf7b20 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 22:29:38 +0100 Date: Tue, 24 Jun 2014 22:29:38 +0100
Subject: [PATCH 01/12] Don't ignore ./configure, it's a real git file. Subject: [PATCH 01/13] Don't ignore ./configure, it's a real git file.
--- ---
.gitignore | 1 - .gitignore | 1 -

View File

@ -1,7 +1,7 @@
From 0e3b6450f6ab803442a809b6da41d5d5c5da650f Mon Sep 17 00:00:00 2001 From 0e3b6450f6ab803442a809b6da41d5d5c5da650f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 7 Jun 2012 15:36:16 +0100 Date: Thu, 7 Jun 2012 15:36:16 +0100
Subject: [PATCH 02/12] Ensure empty compilerlibs/ directory is created by git. Subject: [PATCH 02/13] Ensure empty compilerlibs/ directory is created by git.
This directory exists in the OCaml tarball, but is empty. As a This directory exists in the OCaml tarball, but is empty. As a
result, git ignores it unless we put a dummy file in it. result, git ignores it unless we put a dummy file in it.

View File

@ -1,7 +1,7 @@
From 79f0f91e3e4abbfbd3564c11ea72e53310236afc Mon Sep 17 00:00:00 2001 From 79f0f91e3e4abbfbd3564c11ea72e53310236afc Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 24 Jun 2014 10:00:15 +0100 Date: Tue, 24 Jun 2014 10:00:15 +0100
Subject: [PATCH 03/12] Don't add rpaths to libraries. Subject: [PATCH 03/13] Don't add rpaths to libraries.
--- ---
tools/Makefile.shared | 6 +++--- tools/Makefile.shared | 6 +++---

View File

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

View File

@ -1,7 +1,7 @@
From 5308c47681201ef3beef3e543ab877f81aa08784 Mon Sep 17 00:00:00 2001 From 5308c47681201ef3beef3e543ab877f81aa08784 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:44:18 +0100 Date: Tue, 29 May 2012 20:44:18 +0100
Subject: [PATCH 05/12] configure: Allow user defined C compiler flags. Subject: [PATCH 05/13] configure: Allow user defined C compiler flags.
--- ---
configure | 4 ++++ configure | 4 ++++

View File

@ -1,7 +1,7 @@
From b97622b54339f810bdca378ba7e58e5ad3152330 Mon Sep 17 00:00:00 2001 From 3628c89d319ac8286b62ec1405561b72bda4ba0d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:47:07 +0100 Date: Tue, 29 May 2012 20:47:07 +0100
Subject: [PATCH 06/12] Add support for ppc64. Subject: [PATCH 06/13] Add support for ppc64.
Note (1): This patch was rejected upstream because they don't have Note (1): This patch was rejected upstream because they don't have
appropriate hardware for testing. appropriate hardware for testing.
@ -2105,7 +2105,7 @@ index 92b3c28..5202c3a 100644
#define Saved_return_address(sp) *((intnat *)((sp) - 4)) #define Saved_return_address(sp) *((intnat *)((sp) - 4))
#define Callback_link(sp) ((struct caml_context *)((sp) + 8)) #define Callback_link(sp) ((struct caml_context *)((sp) + 8))
diff --git a/configure b/configure diff --git a/configure b/configure
index c1133ee..3d258dc 100755 index c1133ee..954b25e 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -808,6 +808,7 @@ case "$target" in @@ -808,6 +808,7 @@ case "$target" in
@ -2120,7 +2120,7 @@ index c1133ee..3d258dc 100755
aspp="/usr/ccs/bin/${TOOLPREF}as -P";; aspp="/usr/ccs/bin/${TOOLPREF}as -P";;
power,elf) as="${TOOLPREF}as -u -m ppc" power,elf) as="${TOOLPREF}as -u -m ppc"
aspp="${TOOLPREF}gcc -c";; aspp="${TOOLPREF}gcc -c";;
+ power64,*,elf) as='${TOOLPREF}as -u -m ppc64' + power64,elf) as='${TOOLPREF}as -u -m ppc64'
+ aspp='${TOOLPREF}gcc -c';; + aspp='${TOOLPREF}gcc -c';;
power,rhapsody) as="${TOOLPREF}as -arch $model" power,rhapsody) as="${TOOLPREF}as -arch $model"
aspp="$bytecc -c";; aspp="$bytecc -c";;

View File

@ -1,7 +1,7 @@
From 6e3ca14f2d4dba2612eff59126140cde0d04394f Mon Sep 17 00:00:00 2001 From ab7ac2b3c241dfd2db8f9b6818d324997c982708 Mon Sep 17 00:00:00 2001
From: Michel Normand <normand@linux.vnet.ibm.com> From: Michel Normand <normand@linux.vnet.ibm.com>
Date: Tue, 18 Mar 2014 09:15:47 -0400 Date: Tue, 18 Mar 2014 09:15:47 -0400
Subject: [PATCH 07/12] Add support for ppc64le. Subject: [PATCH 07/13] Add support for ppc64le.
Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com> Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
--- ---
@ -1892,7 +1892,7 @@ index b79252d..049652e 100755
echo powerpc-unknown-linux-${LIBC} echo powerpc-unknown-linux-${LIBC}
exit ;; exit ;;
diff --git a/configure b/configure diff --git a/configure b/configure
index 3d258dc..0bf4ebd 100755 index 954b25e..cc3cbbf 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -809,6 +809,7 @@ case "$target" in @@ -809,6 +809,7 @@ case "$target" in
@ -1905,9 +1905,9 @@ index 3d258dc..0bf4ebd 100755
powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;; powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;;
@@ -891,6 +892,8 @@ case "$arch,$system" in @@ -891,6 +892,8 @@ case "$arch,$system" in
aspp="${TOOLPREF}gcc -c";; aspp="${TOOLPREF}gcc -c";;
power64,*,elf) as='${TOOLPREF}as -u -m ppc64' power64,elf) as='${TOOLPREF}as -u -m ppc64'
aspp='${TOOLPREF}gcc -c';; aspp='${TOOLPREF}gcc -c';;
+ power64le,*,elf) as='${TOOLPREF}as -u -m ppc64' + power64le,elf) as='${TOOLPREF}as -u -m ppc64'
+ aspp='${TOOLPREF}gcc -c';; + aspp='${TOOLPREF}gcc -c';;
power,rhapsody) as="${TOOLPREF}as -arch $model" power,rhapsody) as="${TOOLPREF}as -arch $model"
aspp="$bytecc -c";; aspp="$bytecc -c";;

View File

@ -1,7 +1,7 @@
From a2a1e564bbe995f44de2023893f6dea51668b51e Mon Sep 17 00:00:00 2001 From 515d0ac7418f3ec999dae4821ffb4888ef8c9825 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 10 May 2014 03:20:35 -0400 Date: Sat, 10 May 2014 03:20:35 -0400
Subject: [PATCH 08/12] arm, arm64: Mark stack as non-executable. Subject: [PATCH 08/13] arm, arm64: Mark stack as non-executable.
The same fix as this one, which was only fully applied to The same fix as this one, which was only fully applied to
i686 & x86-64: i686 & x86-64:

View File

@ -1,7 +1,7 @@
From 0641f11626be99c8bde349520ac28a8d93106856 Mon Sep 17 00:00:00 2001 From c2783885f93b0394376cc99354f67b3647cfcfc2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 1 Apr 2014 11:17:07 +0100 Date: Tue, 1 Apr 2014 11:17:07 +0100
Subject: [PATCH 09/12] arg: Add no_arg and get_arg helper functions. Subject: [PATCH 09/13] arg: Add no_arg and get_arg helper functions.
The no_arg function in this patch is a no-op. It will do something The no_arg function in this patch is a no-op. It will do something
useful in the followups. useful in the followups.

View File

@ -1,7 +1,7 @@
From 4d1defe6f017b86b0766fd02005a468bedd9aa88 Mon Sep 17 00:00:00 2001 From 21a743dc1983b3b41ddaa790c621fe0b46969e1f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 1 Apr 2014 11:21:40 +0100 Date: Tue, 1 Apr 2014 11:21:40 +0100
Subject: [PATCH 10/12] arg: Allow flags such as --flag=arg as well as --flag Subject: [PATCH 10/13] arg: Allow flags such as --flag=arg as well as --flag
arg. arg.
Allow flags to be followed directly by their argument, separated by an '=' Allow flags to be followed directly by their argument, separated by an '='

View File

@ -1,7 +1,7 @@
From 6156d208e6cc6e28a964be5dd34585bd54f6eadf Mon Sep 17 00:00:00 2001 From 8dcd718671ad2bd5384a9d9ffeed7d33b1b34a27 Mon Sep 17 00:00:00 2001
From: Xavier Leroy <xavier.leroy@inria.fr> From: Xavier Leroy <xavier.leroy@inria.fr>
Date: Wed, 27 Aug 2014 09:58:33 +0000 Date: Wed, 27 Aug 2014 09:58:33 +0000
Subject: [PATCH 11/12] PR#6517: use ISO C99 types {,u}int{32,64}_t in Subject: [PATCH 11/13] PR#6517: use ISO C99 types {,u}int{32,64}_t in
preference to our homegrown types {,u}int{32,64}. preference to our homegrown types {,u}int{32,64}.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15131 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15131 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
@ -1697,7 +1697,7 @@ index 6df440b..603b050 100644
#define HAS_STRERROR #define HAS_STRERROR
#define HAS_SOCKETS #define HAS_SOCKETS
diff --git a/configure b/configure diff --git a/configure b/configure
index 0bf4ebd..8a9be78 100755 index cc3cbbf..ff27aa9 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -615,26 +615,6 @@ case "$target" in @@ -615,26 +615,6 @@ case "$target" in

View File

@ -1,7 +1,7 @@
From 4e06fda2060d8696649260937f8a551815de24cf Mon Sep 17 00:00:00 2001 From 719dd72c791d557ab6bc17a1327a36fb04ea9237 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 11 Sep 2014 14:49:54 +0100 Date: Thu, 11 Sep 2014 14:49:54 +0100
Subject: [PATCH 12/12] ppc, ppc64, ppc64le: Mark stack as non-executable. Subject: [PATCH 12/13] ppc, ppc64, ppc64le: Mark stack as non-executable.
The same fix as this one, which was only fully applied to The same fix as this one, which was only fully applied to
i686 & x86-64: i686 & x86-64:

View File

@ -0,0 +1,84 @@
From 0d60237e349595e1022c2258fe6fcb4137d9e128 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 13/13] 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 372303d..85a8742 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 9b98577..ea956b8 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.0.4

View File

@ -17,7 +17,7 @@
Name: ocaml Name: ocaml
Version: 4.02.0 Version: 4.02.0
Release: 4%{?dist} Release: 5%{?dist}
Summary: OCaml compiler and programming environment Summary: OCaml compiler and programming environment
@ -57,6 +57,7 @@ Patch0009: 0009-arg-Add-no_arg-and-get_arg-helper-functions.patch
Patch0010: 0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch Patch0010: 0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch
Patch0011: 0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch Patch0011: 0011-PR-6517-use-ISO-C99-types-u-int-32-64-_t-in-preferen.patch
Patch0012: 0012-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch Patch0012: 0012-ppc-ppc64-ppc64le-Mark-stack-as-non-executable.patch
Patch0013: 0013-ppc64-ppc64le-proc-Interim-definitions-for-op_is_pur.patch
# Add BFD support so that ocamlobjinfo supports *.cmxs format (RHBZ#1113735). # Add BFD support so that ocamlobjinfo supports *.cmxs format (RHBZ#1113735).
BuildRequires: binutils-devel BuildRequires: binutils-devel
@ -419,6 +420,9 @@ fi
%changelog %changelog
* Fri Oct 24 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-5
- Fixes for ppc64/ppc64le (RHBZ#1156300).
* Mon Oct 20 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-4 * Mon Oct 20 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-4
- ocaml-emacs should require emacs(bin) (RHBZ#1154513). - ocaml-emacs should require emacs(bin) (RHBZ#1154513).