summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2011-04-25 17:55:08 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2011-04-25 17:55:08 +0000
commitf0cf776fa1fe0b3d742ac0e3b29bb1d0d4f73d7e (patch)
treee2a54c6a713875d085bff02bfac6c363624e7d17 /dev-lang
parentUpdate live ebuild (diff)
downloadgentoo-2-f0cf776fa1fe0b3d742ac0e3b29bb1d0d4f73d7e.tar.gz
gentoo-2-f0cf776fa1fe0b3d742ac0e3b29bb1d0d4f73d7e.tar.bz2
gentoo-2-f0cf776fa1fe0b3d742ac0e3b29bb1d0d4f73d7e.zip
Added support for x86-macos/ppc-macos/x85-solaric/ppc-solaris systems by Fabian Groffen <grobian@gentoo.org>.
(Portage version: 2.1.9.42/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ghc/ChangeLog13
-rw-r--r--dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch43
-rw-r--r--dev-lang/ghc/files/ghc-6.12.3-darwin8.patch18
-rw-r--r--dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch34
-rw-r--r--dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch30
-rw-r--r--dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch37
-rw-r--r--dev-lang/ghc/files/ghc-apply-gmp-hack11
-rw-r--r--dev-lang/ghc/ghc-6.12.3-r2.ebuild (renamed from dev-lang/ghc/ghc-6.12.3-r1.ebuild)102
8 files changed, 271 insertions, 17 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog
index 1c307a436bbc..458e5b7ee165 100644
--- a/dev-lang/ghc/ChangeLog
+++ b/dev-lang/ghc/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for dev-lang/ghc
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.203 2011/03/27 19:44:17 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.204 2011/04/25 17:55:08 slyfox Exp $
+
+*ghc-6.12.3-r2 (25 Apr 2011)
+
+ 25 Apr 2011; Sergei Trofimovich <slyfox@gentoo.org> -ghc-6.12.3-r1.ebuild,
+ +ghc-6.12.3-r2.ebuild, +files/ghc-6.12.3-configure-CHOST-prefix.patch,
+ +files/ghc-6.12.3-darwin8.patch,
+ +files/ghc-6.12.3-mach-o-relocation-limit.patch,
+ +files/ghc-6.12.3-pic-powerpc.patch,
+ +files/ghc-6.12.3-powerpc-darwin-no-mmap.patch, files/ghc-apply-gmp-hack:
+ Added support for x86-macos/ppc-macos/x85-solaric/ppc-solaris systems by
+ Fabian Groffen <grobian@gentoo.org>.
*ghc-6.12.3-r1 (27 Mar 2011)
diff --git a/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch b/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch
new file mode 100644
index 000000000000..926237ba8064
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch
@@ -0,0 +1,43 @@
+Strip versioning components from *HOST for Darwin and Solaris
+
+--- aclocal.m4
++++ aclocal.m4
+@@ -1358,6 +1358,12 @@
+ freebsd*)
+ $2="freebsd"
+ ;;
++ darwin*)
++ $2="darwin"
++ ;;
++ solaris2.*)
++ $2="solaris2"
++ ;;
+ *)
+ echo "Unknown OS $1"
+ exit 1
+--- configure.ac
++++ configure.ac
+@@ -227,6 +227,7 @@
+ fi
+ build=`echo "$build" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'`
+ [build=`echo "$build" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket
++build=`echo "$build" | sed -e 's/-darwin.*$/-darwin/' -e 's/-solaris2.*$/-solaris/'`
+
+ # We have to run these unconditionally, but we may discard their
+ # results in the following code
+@@ -262,6 +263,7 @@
+ fi
+ host=`echo "$host" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'`
+ [host=`echo "$host" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket
++host=`echo "$host" | sed -e 's/-darwin.*$/-darwin/' -e 's/-solaris2.*$/-solaris/'`
+
+ if test "$host_alias" = ""
+ then
+@@ -284,6 +286,7 @@
+ fi
+ target=`echo "$target" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'`
+ [target=`echo "$target" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket
++target=`echo "$target" | sed -e 's/-darwin.*$/-darwin/' -e 's/-solaris2.*$/-solaris/'`
+
+ if test "$target_alias" = ""
+ then
diff --git a/dev-lang/ghc/files/ghc-6.12.3-darwin8.patch b/dev-lang/ghc/files/ghc-6.12.3-darwin8.patch
new file mode 100644
index 000000000000..c971eb25eed6
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.12.3-darwin8.patch
@@ -0,0 +1,18 @@
+Workaround headers problem in Darwin 8 as well.
+
+--- rts/PosixSource.h
++++ rts/PosixSource.h
+@@ -11,6 +11,13 @@
+
+ #include <ghcplatform.h>
+
++#if defined(darwin_HOST_OS)
++/* unfortunately the hack below only works for Darwin 9 and
++ * above, so as hack include sys/types early (before setting
++ * _POSIX_C_SOURCE) (this obviously obsoletes the hack below) */
++#include <sys/types.h>
++#endif
++
+ #define _POSIX_SOURCE 1
+ #define _POSIX_C_SOURCE 199506L
+ #define _XOPEN_SOURCE 500
diff --git a/dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch b/dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch
new file mode 100644
index 000000000000..93752ea76f7e
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch
@@ -0,0 +1,34 @@
+http://hackage.haskell.org/trac/ghc/attachment/ticket/3260/mach-o-relocation-limit.patch
+
+Sat May 8 23:24:11 JST 2010 pho@cielonegro.org
+ * Work around for Mach-O relocation limit
+
+ Mach-O has a limitation on the length of relocation addresses. No
+ segments can be larger than 2^24 - 1 bytes (approx 16 MiB; See
+ /usr/include/mach-o/reloc.h). Static GHCi libraries are merged large
+ objects so they tend to exceed this limit.
+
+--- rules/build-package-way.mk
++++ rules/build-package-way.mk
+@@ -83,8 +83,21 @@
+ ifneq "$4" "0"
+ BINDIST_LIBS += $$($1_$2_GHCI_LIB)
+ endif
++
++ifeq "$$(darwin_HOST_OS)" "1"
++# Mach-O has a limitation on the length of relocation addresses. No
++# segments can be larger than 2^24 - 1 bytes (approx 16 MiB; See
++# /usr/include/mach-o/reloc.h). Static GHCi libraries are merged large
++# objects so they tend to exceed this limit.
++$$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
++ "$$(LD)" -r -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $$($1_$2_EXTRA_OBJS) \
++ || ( echo "Warning: creating dummy $$@" && \
++ touch empty.c && \
++ "$(CC)" $(SRC_CC_OPTS) $(CONF_CC_OPTS) -c empty.c -o $$@ )
++else
+ $$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
+ "$$(LD)" -r -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $$($1_$2_EXTRA_OBJS)
++endif
+
+ $(call all-target,$1_$2,$$($1_$2_GHCI_LIB))
+ endif
diff --git a/dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch b/dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch
new file mode 100644
index 000000000000..e71109920820
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch
@@ -0,0 +1,30 @@
+From 1414e10a1470061e850b7ce2aa6350a428ade2e9 Mon Sep 17 00:00:00 2001
+From: pho@cielonegro.org <unknown>
+Date: Sat, 8 May 2010 14:39:00 +0000
+Subject: [PATCH] PIC support for PowerPC
+
+PPC.CodeGen.getRegister was not properly handling PicBaseReg.
+It seems working with this patch, but I'm not sure this change is correct.
+---
+ compiler/nativeGen/PPC/CodeGen.hs | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
+index 1215b2e..a1b55ce 100644
+--- a/compiler/nativeGen/PPC/CodeGen.hs
++++ b/compiler/nativeGen/PPC/CodeGen.hs
+@@ -377,6 +377,11 @@ iselExpr64 expr
+
+ getRegister :: CmmExpr -> NatM Register
+
++getRegister (CmmReg (CmmGlobal PicBaseReg))
++ = do
++ reg <- getPicBaseNat archWordSize
++ return (Fixed archWordSize reg nilOL)
++
+ getRegister (CmmReg reg)
+ = return (Fixed (cmmTypeSize (cmmRegType reg))
+ (getRegisterReg reg) nilOL)
+--
+1.7.4.1
+
diff --git a/dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch b/dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch
new file mode 100644
index 000000000000..a438c0d57b90
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch
@@ -0,0 +1,37 @@
+Tue Nov 30 06:30:14 PST 2010 pho@cielonegro.org
+ * FIX #1845 (unconditional relative branch out of range)
+
+ Don't use mmap on powerpc-apple-darwin as mmap doesn't support
+ reallocating but we need to allocate jump islands just after each
+ object images. Otherwise relative branches to jump islands can fail
+ due to 24-bits displacement overflow.
+diff -rN -u old-ghc/rts/Linker.c new-ghc/rts/Linker.c
+--- old-ghc/rts/Linker.c 2011-04-19 01:37:03.000000000 -0700
++++ new-ghc/rts/Linker.c 2011-04-19 01:37:04.000000000 -0700
+@@ -69,7 +69,15 @@
+ #include <sys/wait.h>
+ #endif
+
+-#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(darwin_HOST_OS)
++#if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
++ defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
++ defined(openbsd_HOST_OS ) || \
++ ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) )
++/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
++ * reallocating but we need to allocate jump islands just after each
++ * object images. Otherwise relative branches to jump islands can fail
++ * due to 24-bits displacement overflow.
++ */
+ #define USE_MMAP
+ #include <fcntl.h>
+ #include <sys/mman.h>
+@@ -1841,6 +1849,9 @@
+ int fd;
+ #else
+ FILE *f;
++# if defined(darwin_HOST_OS)
++ int misalignment;
++# endif
+ #endif
+ IF_DEBUG(linker, debugBelch("loadObj %s\n", path));
+
diff --git a/dev-lang/ghc/files/ghc-apply-gmp-hack b/dev-lang/ghc/files/ghc-apply-gmp-hack
index a0b4ab8ffd9c..32a3a8f1f7cf 100644
--- a/dev-lang/ghc/files/ghc-apply-gmp-hack
+++ b/dev-lang/ghc/files/ghc-apply-gmp-hack
@@ -1,6 +1,4 @@
-# this script is expected to be sourced by ghc ebuilds built against libgmp.so.3 library
-#
-# > source "${FILESDIR}/ghc-apply-gmp-hack"
+# This script is expected to be sourced by ghc ebuilds built against libgmp.so.3 library
#
# What it does and why it works:
# > GMP 5.0 is upwardly source and binary compatible with 4.x, and 3.x versions,
@@ -24,7 +22,7 @@
#
# Blames should be directed to Sergei Trofimovich <slyfox@gentoo.org>
-# should be used:
+# should be used as:
# > inherit multilib
# > ...
# > # somewhere in src_unpack() { # as early as possible, right after unpacking source/binary
@@ -33,8 +31,9 @@
local libdir_name=$1
# let's see if we are in affected system
if has_version '>=dev-libs/gmp-5.0.1'; then
- local libgmpso3=$ROOT/usr/$libdir_name/libgmp.so.3
- local libgmpso10=$ROOT/usr/$libdir_name/libgmp.so.10
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
+ local libgmpso3=${EROOT}/usr/$libdir_name/libgmp.so.3
+ local libgmpso10=${EROOT}/usr/$libdir_name/libgmp.so.10
# bother user only if things won't work for him
if [[ ! -e "$libgmpso3" ]]; then
diff --git a/dev-lang/ghc/ghc-6.12.3-r1.ebuild b/dev-lang/ghc/ghc-6.12.3-r2.ebuild
index 238ff4fd138f..312987b9a829 100644
--- a/dev-lang/ghc/ghc-6.12.3-r1.ebuild
+++ b/dev-lang/ghc/ghc-6.12.3-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.12.3-r1.ebuild,v 1.1 2011/03/27 19:44:17 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.12.3-r2.ebuild,v 1.1 2011/04/25 17:55:08 slyfox Exp $
# Brief explanation of the bootstrap logic:
#
@@ -48,17 +48,24 @@ arch_binaries="$arch_binaries ppc? ( mirror://gentoo/ghc-bin-${PV}-ppc.tbz2 )"
# various ports:
arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
+# prefix ports:
+arch_binaries="$arch_binaries x86-macos? ( http://www.haskell.org/ghc/dist/6.10.1/maeder/ghc-6.10.1-i386-apple-darwin.tar.bz2 )"
+arch_binaries="$arch_binaries ppc-macos? ( http://www.haskell.org/ghc/dist/6.10.1/maeder/ghc-6.10.1-powerpc-apple-darwin.tar.bz2 )"
+arch_binaries="$arch_binaries x86-solaris? ( http://www.haskell.org/ghc/dist/6.10.4/maeder/ghc-6.10.4-i386-unknown-solaris2.tar.bz2 )"
+arch_binaries="$arch_binaries sparc-solaris? ( http://www.haskell.org/ghc/dist/6.10.4/maeder/ghc-6.10.4-sparc-sun-solaris2.tar.bz2 )"
+
SRC_URI="!binary? ( http://darcs.haskell.org/download/dist/${PV}/${P}-src.tar.bz2 )
!ghcbootstrap? ( $arch_binaries )"
LICENSE="BSD"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+KEYWORDS="~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE="binary doc ghcbootstrap"
RDEPEND="
!dev-lang/ghc-bin
- >=sys-devel/gcc-2.95.3
- >=sys-devel/binutils-2.17
+ !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 )
+ kernel_linux? ( >=sys-devel/binutils-2.17 )
+ kernel_SunOS? ( >=sys-devel/binutils-2.17 )
>=dev-lang/perl-5.6.1
>=dev-libs/gmp-4.1
!<dev-haskell/haddock-2.4.2
@@ -203,11 +210,18 @@ src_unpack() {
# Create the ${S} dir if we're using the binary version
use binary && mkdir "${S}"
- base_src_unpack
+ # the Solaris and Darwin binaries from ghc (maeder) need to be
+ # unpacked separately, so prevent them from being unpacked
+ local ONLYA=${A}
+ case ${CHOST} in
+ *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;;
+ esac
+ unpack ${ONLYA}
}
src_prepare() {
- source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)"
+ [[ ${CHOST} != *-darwin* ]] && \
+ source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)"
ghc_setup_cflags
@@ -232,7 +246,64 @@ src_prepare() {
mv "${WORKDIR}/usr" "${S}"
else
if ! use ghcbootstrap; then
- relocate_ghc "${WORKDIR}"
+ case ${CHOST} in
+ *-darwin* | *-solaris*)
+ mkdir "${WORKDIR}"/ghc-bin-installer || die
+ pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
+ use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
+ use x86-solaris && unpack ghc-6.10.4-i386-unknown-solaris2.tar.bz2
+ use ppc-macos && unpack ghc-6.10.1-powerpc-apple-darwin.tar.bz2
+ use x86-macos && unpack ghc-6.10.1-i386-apple-darwin.tar.bz2
+ popd > /dev/null
+
+ pushd "${WORKDIR}"/ghc-bin-installer/ghc-6.10.? > /dev/null || die
+ # fix the binaries so they run, on Solaris we need an
+ # LD_LIBRARY_PATH which has our prefix libdirs, on
+ # Darwin we need to replace the frameworks with our libs
+ # from the prefix fix before installation, because some
+ # of the tools are actually used during configure/make
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ # http://hackage.haskell.org/trac/ghc/ticket/2942
+ pushd utils/haddock/dist-install/build > /dev/null
+ ln -s Haddock haddock >& /dev/null # fails on IN-sensitive
+ popd > /dev/null
+
+ local readline_framework=GNUreadline.framework/GNUreadline
+ local gmp_framework=/opt/local/lib/libgmp.3.dylib
+ local ncurses_file=/opt/local/lib/libncurses.5.dylib
+ for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
+ install_name_tool -change \
+ ${readline_framework} \
+ "${EPREFIX}"/lib/libreadline.dylib \
+ ${binary} || die
+ install_name_tool -change \
+ ${gmp_framework} \
+ "${EPREFIX}"/usr/lib/libgmp.dylib \
+ ${binary} || die
+ install_name_tool -change \
+ ${ncurses_file} \
+ "${EPREFIX}"/usr/lib/libncurses.dylib \
+ ${binary} || die
+ done
+ # we don't do frameworks!
+ sed -i \
+ -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
+ -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
+ rts/package.conf.in || die
+ fi
+
+ # it is autoconf, but we really don't want to give it too
+ # much arguments, in fact we do the make in-place anyway
+ ./configure --prefix="${WORKDIR}"/usr || die
+ make install || die
+ popd > /dev/null
+ ;;
+ *)
+ relocate_ghc "${WORKDIR}"
+ ;;
+ esac
fi
sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_CFLAGS}|" \
@@ -263,6 +334,7 @@ src_prepare() {
epatch "${FILESDIR}/ghc-6.12.1-configure-CHOST.patch"
epatch "${FILESDIR}/ghc-6.12.2-configure-CHOST-part2.patch"
epatch "${FILESDIR}/ghc-6.12.3-configure-CHOST-freebsd.patch"
+ epatch "${FILESDIR}/ghc-6.12.3-configure-CHOST-prefix.patch"
# -r and --relax are incompatible
epatch "${FILESDIR}/ghc-6.12.3-ia64-fixed-relax.patch"
@@ -283,7 +355,9 @@ src_prepare() {
epatch "${FILESDIR}/ghc-6.12.3-autoconf-2.66-4252.patch"
# ticket 2615, linker scripts
- epatch "${FILESDIR}/ghc-6.12.3-ticket-2615-linker-script.patch"
+ # breaks Darwin
+ [[ ${CHOST} != *-darwin* ]] && \
+ epatch "${FILESDIR}/ghc-6.12.3-ticket-2615-linker-script.patch"
# export typechecker internals even if ghci is disabled
# http://hackage.haskell.org/trac/ghc/ticket/3558
@@ -293,6 +367,11 @@ src_prepare() {
# TPE (Trusted Path Execution) protection.
epatch "${FILESDIR}/ghc-6.12.3-libffi-incorrect-detection-of-selinux.patch"
+ epatch "${FILESDIR}"/${P}-pic-powerpc.patch
+ epatch "${FILESDIR}"/${P}-darwin8.patch
+ epatch "${FILESDIR}"/${P}-mach-o-relocation-limit.patch
+ epatch "${FILESDIR}"/${P}-powerpc-darwin-no-mmap.patch
+
if use prefix; then
# Make configure find docbook-xsl-stylesheets from Prefix
sed -i -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' configure.ac || die
@@ -315,7 +394,11 @@ src_configure() {
# We also need to use the GHC_CFLAGS flags when building ghc itself
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk
+ case $($(tc-getAS) -v 2>&1 </dev/null) in
+ *"GNU Binutils"*) # GNU ld
+ echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk
+ ;;
+ esac
# We can't depend on haddock except when bootstrapping when we
# must build docs and include them into the binary .tbz2 package
@@ -378,7 +461,6 @@ src_compile() {
src_install() {
if use binary; then
- mkdir -p "${ED}"
mv "${S}/usr" "${ED}"
# Remove the docs if not requested