[ocaml-camomile/f17] Remove ExcludeArch ppc64.
Richard W.M. Jones
rjones at fedoraproject.org
Wed May 30 11:43:45 UTC 2012
commit 859c4d14d7a7ca21872896880d25c13f93ce08da
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue May 29 13:00:47 2012 +0200
Remove ExcludeArch ppc64.
- Add sed hack to reduce size of long entry function which breaks
ppc64 code generator. See comment in spec file for full details.
(cherry picked from commit 3a02209c1513781435c9a5f7668b8e5ab47a1de4)
ocaml-camomile.spec | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 deletions(-)
---
diff --git a/ocaml-camomile.spec b/ocaml-camomile.spec
index 968498f..64383ab 100644
--- a/ocaml-camomile.spec
+++ b/ocaml-camomile.spec
@@ -3,7 +3,7 @@
Name: ocaml-camomile
Version: 0.8.3
-Release: 2%{?dist}
+Release: 4%{?dist}
Summary: Unicode library for OCaml
Group: Development/Libraries
@@ -14,7 +14,7 @@ License: LGPLv2+
URL: http://sourceforge.net/projects/camomile/
Source0: http://downloads.sourceforge.net/camomile/camomile-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-ExcludeArch: ppc64 sparc64 s390 s390x
+ExcludeArch: sparc64 s390 s390x
BuildRequires: ocaml, ocaml-findlib-devel, ocaml-ocamldoc, ocaml-camlp4-devel
@@ -60,6 +60,36 @@ applications that use %{name}.
%patch1 -p1
+# This is a horrible hack to work around a bug in our ppc64 code
+# generator. For some reason which we don't fully understand it barfs
+# on the long entry function created by the series of alias commands
+# at the end of public/charEncoding.ml:
+#
+# let () = alias "IANA/csGB2312" "GB2312"
+# let () = alias "IANA/GB2312" "GB2312"
+# (* etc for 573 lines *)
+#
+# Use a sed script to change to the equivalent code:
+#
+# let aliases = [
+# "IANA/csGB2312", "GB2312";
+# "IANA/GB2312", "GB2312";
+# (* etc *)
+# ] ;; List.iter (fun (a,b) -> alias a b) aliases
+#
+# The equivalent code contains just data plus a small entry function
+# so it doesn't break the ppc64 generator. It's likely also to be
+# more efficient. Since the code is equivalent, we do this
+# transformation on all arches, not just ppc64.
+#
+# - RWMJ 2012-05-30
+
+mv public/charEncoding.ml public/charEncoding.ml.orig
+sed -e 's/let () = alias \("[^[:space:]]*"\) \("[^[:space:]]*"\)/\1, \2;/' \
+ -e 's/(\* IANA \*)/let aliases = [/' \
+ -e '$ i] ;; List.iter (fun (a,b) -> alias a b) aliases' \
+ public/charEncoding.ml.orig > public/charEncoding.ml
+
%build
./configure --prefix=%{_prefix} --datadir=%{_datadir} --libdir=%{_libdir}
@@ -120,6 +150,11 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Wed May 30 2012 Richard W.M. Jones <rjones at redhat.com> - 0.8.3-4
+- Remove ExcludeArch ppc64.
+- Add sed hack to reduce size of long entry function which breaks
+ ppc64 code generator. See comment in spec file for full details.
+
* Sat May 19 2012 Richard W.M. Jones <rjones at redhat.com> - 0.8.3-2
- Include workaround for segfault in gen_mappings.ml on ARM.
- Bump release and rebuild for new OCaml on ARM.
More information about the scm-commits
mailing list