From 31bf86cfb0e64e11c8554325b39046669055ec83 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 14 Apr 2014 21:25:10 +0100 Subject: [PATCH] Fix aarch64 relocation problems again. Earlier patch was dropped accidentally. --- ...-ocamldoc-and-camlp4opt-aarch64-only.patch | 38 ----------------- ...arm64-Align-code-and-data-to-8-bytes.patch | 41 +++++++++++++++++++ ...-no_arg-and-get_arg-helper-functions.patch | 2 +- ...such-as-flag-arg-as-well-as-flag-arg.patch | 2 +- 0013-Add-support-for-ppc64le.patch | 2 +- ocaml.spec | 31 ++++---------- 6 files changed, 51 insertions(+), 65 deletions(-) delete mode 100644 0010-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch create mode 100644 0010-arm64-Align-code-and-data-to-8-bytes.patch diff --git a/0010-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch b/0010-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch deleted file mode 100644 index 015964c..0000000 --- a/0010-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0ebe44d283e56056fec1691bdc052c92d70c892d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 30 Dec 2013 20:32:03 +0000 -Subject: [PATCH 10/13] 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.5.3 - diff --git a/0010-arm64-Align-code-and-data-to-8-bytes.patch b/0010-arm64-Align-code-and-data-to-8-bytes.patch new file mode 100644 index 0000000..e1a946b --- /dev/null +++ b/0010-arm64-Align-code-and-data-to-8-bytes.patch @@ -0,0 +1,41 @@ +From 848ca220af9224a5cc7abb64f32b89ed54c21121 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 24 Mar 2014 05:50:28 -0500 +Subject: [PATCH 10/13] 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 + diff --git a/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch b/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch index 9814a84..5368a9f 100644 --- a/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch +++ b/0011-arg-Add-no_arg-and-get_arg-helper-functions.patch @@ -1,4 +1,4 @@ -From 6a342793f40250c78931afa32961646f20bc5ba4 Mon Sep 17 00:00:00 2001 +From 251d3447bb10550320f43512d8886561c1298f74 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Apr 2014 11:17:07 +0100 Subject: [PATCH 11/13] arg: Add no_arg and get_arg helper functions. diff --git a/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch b/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch index 048370c..9768344 100644 --- a/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch +++ b/0012-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch @@ -1,4 +1,4 @@ -From 0d0204c395b4015804d12bcd871b74dd0cb38bdb Mon Sep 17 00:00:00 2001 +From 57955b8a4d4cf7732cb87964f5e124ab713e084b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Apr 2014 11:21:40 +0100 Subject: [PATCH 12/13] arg: Allow flags such as --flag=arg as well as --flag diff --git a/0013-Add-support-for-ppc64le.patch b/0013-Add-support-for-ppc64le.patch index e6cc1f6..0607fa3 100644 --- a/0013-Add-support-for-ppc64le.patch +++ b/0013-Add-support-for-ppc64le.patch @@ -1,4 +1,4 @@ -From 6099b2f59acea92e0d39fd1fb4c280812223d341 Mon Sep 17 00:00:00 2001 +From d9ec3ac29493999687b0f7daa23f4888bc57c7be Mon Sep 17 00:00:00 2001 From: Michel Normand Date: Tue, 18 Mar 2014 09:15:47 -0400 Subject: [PATCH 13/13] Add support for ppc64le. diff --git a/ocaml.spec b/ocaml.spec index b0f7013..a3ef683 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,6 +1,6 @@ Name: ocaml Version: 4.01.0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: OCaml compiler and programming environment @@ -37,7 +37,7 @@ Patch0007: 0007-yacc-Use-mkstemp-instead-of-mktemp.patch # Aarch64 patches. Patch0008: 0008-Port-to-the-ARM-64-bits-AArch64-architecture-experim.patch Patch0009: 0009-Updated-with-latest-versions-from-FSF.patch -Patch0010: 0010-Disable-ocamldoc-and-camlp4opt-aarch64-only.patch +Patch0010: 0010-arm64-Align-code-and-data-to-8-bytes.patch # NON-upstream patch to allow '--flag=arg' as an alternative to '--flag arg'. Patch0011: 0011-arg-Add-no_arg-and-get_arg-helper-functions.patch @@ -247,28 +247,7 @@ git config user.email "noone@example.com" git config user.name "no one" git add . git commit -a -q -m "%{version} baseline" -# Should use: -#git am %{patches} - 4.01.0-13 +- Fix aarch64 relocation problems again. + Earlier patch was dropped accidentally. + * Wed Apr 9 2014 Richard W.M. Jones - 4.01.0-12 - Add ppc64le support (thanks: Michel Normand) (RHBZ#1077767).