Use -fno-strict-aliasing when building the compiler (RHBZ#990540).

ppc, ppc64, ppc64le: Mark stack as non-executable.
This commit is contained in:
Richard W.M. Jones 2014-09-11 14:45:22 +01:00
parent e4cc04ad4a
commit 5d60b03be0
13 changed files with 56 additions and 13 deletions

View File

@ -1,7 +1,7 @@
From ccc1bf226619608230dc94b26377756719cf7b20 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/11] Don't ignore ./configure, it's a real git file.
Subject: [PATCH 01/12] Don't ignore ./configure, it's a real git file.
---
.gitignore | 1 -

View File

@ -1,7 +1,7 @@
From 0e3b6450f6ab803442a809b6da41d5d5c5da650f 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/11] Ensure empty compilerlibs/ directory is created by git.
Subject: [PATCH 02/12] 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.

View File

@ -1,7 +1,7 @@
From 79f0f91e3e4abbfbd3564c11ea72e53310236afc 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/11] Don't add rpaths to libraries.
Subject: [PATCH 03/12] Don't add rpaths to libraries.
---
tools/Makefile.shared | 6 +++---

View File

@ -1,7 +1,7 @@
From 11b377aee2811891635982a5590fef62f12645b6 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/11] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Subject: [PATCH 04/12] ocamlbyteinfo, ocamlplugininfo: Useful utilities from
Debian, sent upstream.
See:

View File

@ -1,7 +1,7 @@
From 5308c47681201ef3beef3e543ab877f81aa08784 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/11] configure: Allow user defined C compiler flags.
Subject: [PATCH 05/12] configure: Allow user defined C compiler flags.
---
configure | 4 ++++

View File

@ -1,7 +1,7 @@
From b97622b54339f810bdca378ba7e58e5ad3152330 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:47:07 +0100
Subject: [PATCH 06/11] Add support for ppc64.
Subject: [PATCH 06/12] Add support for ppc64.
Note (1): This patch was rejected upstream because they don't have
appropriate hardware for testing.

View File

@ -1,7 +1,7 @@
From 6e3ca14f2d4dba2612eff59126140cde0d04394f Mon Sep 17 00:00:00 2001
From: Michel Normand <normand@linux.vnet.ibm.com>
Date: Tue, 18 Mar 2014 09:15:47 -0400
Subject: [PATCH 07/11] Add support for ppc64le.
Subject: [PATCH 07/12] Add support for ppc64le.
Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
---

View File

@ -1,7 +1,7 @@
From a2a1e564bbe995f44de2023893f6dea51668b51e 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 08/11] arm, arm64: Mark stack as non-executable.
Subject: [PATCH 08/12] arm, arm64: Mark stack as non-executable.
The same fix as this one, which was only fully applied to
i686 & x86-64:

View File

@ -1,7 +1,7 @@
From 0641f11626be99c8bde349520ac28a8d93106856 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 09/11] arg: Add no_arg and get_arg helper functions.
Subject: [PATCH 09/12] 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.

View File

@ -1,7 +1,7 @@
From 4d1defe6f017b86b0766fd02005a468bedd9aa88 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 10/11] arg: Allow flags such as --flag=arg as well as --flag
Subject: [PATCH 10/12] arg: Allow flags such as --flag=arg as well as --flag
arg.
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: Xavier Leroy <xavier.leroy@inria.fr>
Date: Wed, 27 Aug 2014 09:58:33 +0000
Subject: [PATCH 11/11] PR#6517: use ISO C99 types {,u}int{32,64}_t in
Subject: [PATCH 11/12] PR#6517: use ISO C99 types {,u}int{32,64}_t in
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

View File

@ -0,0 +1,38 @@
From 4e06fda2060d8696649260937f8a551815de24cf 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 12/12] 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
---
asmrun/power-elf.S | 3 +++
asmrun/power64-elf.S | 2 ++
2 files changed, 5 insertions(+)
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.0.4

View File

@ -17,7 +17,7 @@
Name: ocaml
Version: 4.02.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: OCaml compiler and programming environment
@ -56,6 +56,7 @@ Patch0008: 0008-arm-arm64-Mark-stack-as-non-executable.patch
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
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
# Add BFD support so that ocamlobjinfo supports *.cmxs format (RHBZ#1113735).
BuildRequires: binutils-devel
@ -216,7 +217,7 @@ ulimit -Hs 65536
ulimit -Ss 65536
%endif
CFLAGS="$RPM_OPT_FLAGS" \
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
./configure \
-bindir %{_bindir} \
-libdir %{_libdir}/ocaml \
@ -418,6 +419,10 @@ fi
%changelog
* Thu Sep 11 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-3
- Use -fno-strict-aliasing when building the compiler (RHBZ#990540).
- ppc, ppc64, ppc64le: Mark stack as non-executable.
* Tue Sep 9 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-2
- Fix bug in argument parsing (RHBZ#1139790).