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 3a02209c15)
This commit is contained in:
Richard W.M. Jones 2012-05-29 13:00:47 +02:00
parent 90e2e22e98
commit 859c4d14d7
1 changed files with 37 additions and 2 deletions

View File

@ -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@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@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.