summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2007-05-15 09:37:31 +0000
committerAlexis Ballier <aballier@gentoo.org>2007-05-15 09:37:31 +0000
commitd494a5db9b6751473cbd13231e154243ce7820b7 (patch)
treebe8d5d8e2266bb9b88b1ec4b3f16e3a07e74c147 /dev-lang/ocaml
parentPrepare for new-style virtual/flim. (diff)
downloadgentoo-2-d494a5db9b6751473cbd13231e154243ce7820b7.tar.gz
gentoo-2-d494a5db9b6751473cbd13231e154243ce7820b7.tar.bz2
gentoo-2-d494a5db9b6751473cbd13231e154243ce7820b7.zip
Optimize ocamlp4 for size on hppa, bug #178256
(Portage version: 2.1.2.7)
Diffstat (limited to 'dev-lang/ocaml')
-rw-r--r--dev-lang/ocaml/ChangeLog7
-rw-r--r--dev-lang/ocaml/files/ocaml-3.09.3-hppa-optimize-for-size-ocamlp4.patch25
-rw-r--r--dev-lang/ocaml/ocaml-3.09.3-r1.ebuild7
3 files changed, 37 insertions, 2 deletions
diff --git a/dev-lang/ocaml/ChangeLog b/dev-lang/ocaml/ChangeLog
index f2d94a301d1e..1e71c4076e48 100644
--- a/dev-lang/ocaml/ChangeLog
+++ b/dev-lang/ocaml/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-lang/ocaml
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ChangeLog,v 1.109 2007/05/14 22:37:06 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ChangeLog,v 1.110 2007/05/15 09:37:31 aballier Exp $
+
+ 15 May 2007; Alexis Ballier <aballier@gentoo.org>
+ +files/ocaml-3.09.3-hppa-optimize-for-size-ocamlp4.patch,
+ ocaml-3.09.3-r1.ebuild:
+ Optimize ocamlp4 for size on hppa, bug #178256
14 May 2007; Alexis Ballier <aballier@gentoo.org>
+files/ocaml-3.09.3-call_ld_with_proper_flags.patch,
diff --git a/dev-lang/ocaml/files/ocaml-3.09.3-hppa-optimize-for-size-ocamlp4.patch b/dev-lang/ocaml/files/ocaml-3.09.3-hppa-optimize-for-size-ocamlp4.patch
new file mode 100644
index 000000000000..3a9aed3e4c16
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-3.09.3-hppa-optimize-for-size-ocamlp4.patch
@@ -0,0 +1,25 @@
+Ocaml native code generation for hppa has a bug
+It can produce too big assembler files (>64k) that are invalid
+See bug : http://bugs.gentoo.org/show_bug.cgi?id=178256
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=342704
+http://caml.inria.fr/mantis/view.php?id=4147
+http://caml.inria.fr/mantis/view.php?id=3937
+
+This bug seems to have always existed but was never encountered
+In 3.09 releases, ocamlp4 has grown bigger and bigger and triggers it
+We just tell ocamlopt to optimize for size rather than for speed
+and the produced assembler is thus valid...
+
+Index: ocaml-3.09.3-patched/camlp4/config/Makefile.tpl
+===================================================================
+--- ocaml-3.09.3-patched.orig/camlp4/config/Makefile.tpl
++++ ocaml-3.09.3-patched/camlp4/config/Makefile.tpl
+@@ -37,7 +37,7 @@ TEST_DIRECTORY=test `basename "$<"` = "$
+ .ml.cmx:
+ @$(TEST_DIRECTORY)
+ @$(CAMLP4_COMM) $< -o $*.ppo
+- $(OCAMLOPT) $(OCAMLCFLAGS) -c -impl $*.ppo
++ $(OCAMLOPT) $(OCAMLCFLAGS) -compact -inline 0 -c -impl $*.ppo
+ rm -f $*.ppo
+
+ .ml.p.cmx:
diff --git a/dev-lang/ocaml/ocaml-3.09.3-r1.ebuild b/dev-lang/ocaml/ocaml-3.09.3-r1.ebuild
index ad5ee27fd8ba..32c376d72f5a 100644
--- a/dev-lang/ocaml/ocaml-3.09.3-r1.ebuild
+++ b/dev-lang/ocaml/ocaml-3.09.3-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.09.3-r1.ebuild,v 1.11 2007/05/14 22:37:06 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.09.3-r1.ebuild,v 1.12 2007/05/15 09:37:31 aballier Exp $
inherit flag-o-matic eutils multilib pax-utils versionator toolchain-funcs
@@ -61,6 +61,11 @@ src_unpack() {
# See comment in the patch
epatch "${FILESDIR}/${P}-call_ld_with_proper_flags.patch"
+ # Ocaml native code generation for hppa has a bug
+ # See comments in the patch
+ # http://bugs.gentoo.org/show_bug.cgi?id=178256
+ use hppa && epatch "${FILESDIR}/${P}-hppa-optimize-for-size-ocamlp4.patch"
+
# Change the configure script to add the CFLAGS to bytecccompopts, LDFLAGS
# to bytecclinkopts.
sed -i -e "s,bytecccompopts=\"\",bytecccompopts=\"\${CFLAGS}\"," \