Include a fix for aarch64 relocation problems

http://caml.inria.fr/mantis/view.php?id=6283
This commit is contained in:
Richard W.M. Jones 2014-03-24 11:12:36 +00:00
parent 0666b78faf
commit bf77c63265
13 changed files with 58 additions and 51 deletions

View File

@ -362,5 +362,5 @@ index 0000000..7191b83
+/yacc/ocamlyacc
+/yacc/version.h
--
1.8.4.2
1.8.5.3

View File

@ -14,5 +14,5 @@ diff --git a/compilerlibs/.exists b/compilerlibs/.exists
new file mode 100644
index 0000000..e69de29
--
1.8.4.2
1.8.5.3

View File

@ -236,5 +236,5 @@ index 0000000..e28800f
+ header.units
+ end
--
1.8.4.2
1.8.5.3

View File

@ -22,5 +22,5 @@ index 117f576..cad227d 100644
ocamlmklib.mlp >> ocamlmklib.ml
--
1.8.4.2
1.8.5.3

View File

@ -23,5 +23,5 @@ index 07b1c35..39b38dc 100755
cclibs="$cclibs $mathlib"
--
1.8.4.2
1.8.5.3

View File

@ -2126,5 +2126,5 @@ index 39b38dc..9b02664 100755
aspp="$bytecc -c";;
sparc,*,solaris) as='as'
--
1.8.4.2
1.8.5.3

View File

@ -21,5 +21,5 @@ index f6cac60..3067000 100644
#endif
--
1.8.4.2
1.8.5.3

View File

@ -161,5 +161,5 @@ index 869d030..b8c6f11 100644
Examples ([cmd] is assumed to be the command name):
--
1.8.4.2
1.8.5.3

View File

@ -2276,5 +2276,5 @@ index d67a643..82b699e 100644
Emit.begin_assembly();
let ic = open_in filename in
--
1.8.4.2
1.8.5.3

View File

@ -712,5 +712,5 @@ index e76eaf4..8b612ab 100755
os=-coff
;;
--
1.8.4.2
1.8.5.3

View File

@ -1,38 +0,0 @@
From 55f34d6a262a7e29172ad52ef2d6688ac2c02381 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 30 Dec 2013 20:32:03 +0000
Subject: [PATCH 11/11] Disable ocamldoc and camlp4opt (aarch64 only)
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 10c80d2..e0a7d9e 100644
--- a/Makefile
+++ b/Makefile
@@ -686,8 +686,8 @@ alldepend::
ocamldoc: ocamlc ocamlyacc ocamllex otherlibraries
cd ocamldoc && $(MAKE) all
-ocamldoc.opt: ocamlc.opt ocamlyacc ocamllex
- cd ocamldoc && $(MAKE) opt.opt
+#ocamldoc.opt: ocamlc.opt ocamlyacc ocamllex
+# cd ocamldoc && $(MAKE) opt.opt
partialclean::
cd ocamldoc && $(MAKE) clean
@@ -734,8 +734,8 @@ alldepend::
camlp4out: ocamlc ocamlbuild.byte
./build/camlp4-byte-only.sh
-camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot ocamlbuild.native
- ./build/camlp4-native-only.sh
+#camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot ocamlbuild.native
+# ./build/camlp4-native-only.sh
# Ocamlbuild
#ifeq ($(OCAMLBUILD_NOBOOT),"yes")
--
1.8.4.2

View File

@ -0,0 +1,41 @@
From 260b93c0dda0075112623fc2533c07406d3c8278 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 24 Mar 2014 05:50:28 -0500
Subject: [PATCH 11/11] arm64: Align code and data to 8 bytes.
Insufficient alignment seems to be the cause of relocation errors when
linking large native code OCaml programs:
(.text+0xc): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlOdoc_type' defined in .data section in odoc_type.o
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
(.text+0x10): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
PR#6283 http://caml.inria.fr/mantis/view.php?id=6283
---
asmcomp/arm64/emit.mlp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp
index fc9649c..4e7c4b0 100644
--- a/asmcomp/arm64/emit.mlp
+++ b/asmcomp/arm64/emit.mlp
@@ -651,7 +651,7 @@ let fundecl fundecl =
call_gc_sites := [];
bound_error_sites := [];
` .text\n`;
- ` .align 2\n`;
+ ` .align 3\n`;
` .globl {emit_symbol fundecl.fun_name}\n`;
` .type {emit_symbol fundecl.fun_name}, %function\n`;
`{emit_symbol fundecl.fun_name}:\n`;
@@ -692,6 +692,7 @@ let emit_item = function
let data l =
` .data\n`;
+ ` .align 3\n`;
List.iter emit_item l
(* Beginning / end of an assembly file *)
--
1.8.5.3

View File

@ -1,6 +1,6 @@
Name: ocaml
Version: 4.01.0
Release: 8%{?dist}
Release: 9%{?dist}
Summary: OCaml compiler and programming environment
@ -40,7 +40,7 @@ Patch0008: 0008-stdlib-arg-Allow-flags-such-as-flag-arg-as-well-as-f.patch
# Aarch64 patches.
Patch0009: 0009-Port-to-the-ARM-64-bits-AArch64-architecture-experim.patch
Patch0010: 0010-Updated-with-latest-versions-from-FSF.patch
Patch0011: 0011-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch
Patch0011: 0011-arm64-Align-code-and-data-to-8-bytes.patch
BuildRequires: ncurses-devel
BuildRequires: gdbm-devel
@ -259,7 +259,7 @@ git am %{_sourcedir}/0008-stdlib-arg-Allow-flags-such-as-flag-arg-as-well-as-f.p
%ifarch aarch64
git am %{_sourcedir}/0009-Port-to-the-ARM-64-bits-AArch64-architecture-experim.patch </dev/null
git am %{_sourcedir}/0010-Updated-with-latest-versions-from-FSF.patch </dev/null
git am %{_sourcedir}/0011-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch </dev/null
git am %{_sourcedir}/0011-arm64-Align-code-and-data-to-8-bytes.patch </dev/null
%endif
@ -560,6 +560,10 @@ fi
%changelog
* Mon Mar 24 2014 Richard W.M. Jones <rjones@redhat.com> - 4.01.0-9
- Include a fix for aarch64 relocation problems
http://caml.inria.fr/mantis/view.php?id=6283
* Wed Jan 8 2014 Richard W.M. Jones <rjones@redhat.com> - 4.01.0-8
- Don't use ifarch around Patch lines, as it means the patch files
don't get included in the spec file.