Fix GHCi for amd64 (s/EM_X86_64/EM_AMD64/ noticed by Don Steward). Tested

on amd64 by ckuethe@ (thanks).
Add a man page.
This commit is contained in:
kili 2007-09-16 20:05:12 +00:00
parent 0b641c20d7
commit 3c468d6f7d
3 changed files with 27 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.24 2007/07/22 22:37:25 kili Exp $
# $OpenBSD: Makefile,v 1.25 2007/09/16 20:05:12 kili Exp $
#
# Ancient versions based on Simon Marlow's port script for FreeBSD:
# $FreeBSD: ports/lang/ghc/Makefile,v 1.13 2002/08/22 12:53:38 obraun Exp $
@ -8,7 +8,7 @@ COMMENT-main= compiler for the functional language Haskell
COMMENT-doc= documentation for GHC
DISTNAME= ghc-${MODGHC_VER}
PKGNAME-main= ghc-${MODGHC_VER}p0
PKGNAME-main= ghc-${MODGHC_VER}p1
PKGNAME-doc= ghc-doc-${MODGHC_VER}
CATEGORIES= lang
HOMEPAGE= http://www.haskell.org/ghc/
@ -30,6 +30,7 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
PKG_ARCH-doc= *
BUILD_DEPENDS= ::textproc/libxslt
LIB_DEPENDS-main= gmp::devel/gmp
RUN_DEPENDS-doc=
RUN_DEPENDS-main=
@ -90,7 +91,7 @@ CONFIGURE_STYLE= gnu dest
CONFIGURE_ARGS+= --with-gmp-includes=${LOCALBASE}/include \
--with-gmp-libraries=${LOCALBASE}/lib
FAKE_FLAGS+= "stage=2"
FAKE_FLAGS+= stage=2
post-extract:
@mv ${WRKDIR}/testsuite ${WRKSRC}
@ -145,15 +146,19 @@ do-build:
.endif
# Create scripts for the Cabal package registry that will be used for
# @exec and @unexec.
# @exec and @unexec. And generate a man page.
post-build:
cd ${WRKBUILD} && sh ${FILESDIR}/mkregunreg.sh ${PREFIX}
cd ${WRKBUILD}/docs/man && \
env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ghc.1
post-install:
rm ${PREFIX}/lib/ghc/package.conf
${INSTALL_SCRIPT} ${WRKBUILD}/{un,}register.sh ${PREFIX}/lib/ghc
${INSTALL_DATA_DIR} ${DOC_DIR}
cd ${WRKDIR} && umask 022 && pax -rw ${DOC_FILES} ${DOC_DIR}
${INSTALL_MAN_DIR} ${PREFIX}/man/man1
${INSTALL_MAN} ${WRKBUILD}/docs/man/ghc.1 ${PREFIX}/man/man1
do-regress:
cd ${WRKSRC}/testsuite/tests/ghc-regress && \

View File

@ -1,14 +1,13 @@
$OpenBSD: patch-rts_Linker_c,v 1.1 2007/07/21 17:14:58 kili Exp $
$OpenBSD: patch-rts_Linker_c,v 1.2 2007/09/16 20:05:12 kili Exp $
We don't have MAP_ANONYMOUS (which is the same as MAP_ANON on Linux,
but the latter has been deprecated). We also don't have that MAP_32BIT
Linux provides for amd64, so just zap that flag to 0. Note that
this isn't enough to make ghci work on amd64. The definite solution
would be real dynamic libraries created and used by GHC, so we could
drop most of that home-brewn linking code at all.
Linux provides for amd64, so just zap that flag to 0. In addition
EM_X86_64 is called EM_AMD64 on OpenBSD, so just replace it to
reenable GHCi (noted by dons).
--- rts/Linker.c.orig Wed Apr 25 19:10:41 2007
+++ rts/Linker.c Wed May 23 13:59:08 2007
+++ rts/Linker.c Sun Sep 16 12:27:02 2007
@@ -73,6 +73,11 @@
#endif
@ -21,3 +20,14 @@ drop most of that home-brewn linking code at all.
#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
# define OBJFORMAT_ELF
#elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
@@ -2923,8 +2928,8 @@ ocVerifyImage_ELF ( ObjectCode* oc )
case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;
#endif
case EM_PPC: IF_DEBUG(linker,debugBelch( "powerpc32" )); break;
-#ifdef EM_X86_64
- case EM_X86_64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
+#ifdef EM_AMD64
+ case EM_AMD64: IF_DEBUG(linker,debugBelch( "x86_64" )); break;
#endif
default: IF_DEBUG(linker,debugBelch( "unknown" ));
errorBelch("%s: unknown architecture", oc->fileName);

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.2 2007/07/21 17:14:58 kili Exp $
@comment $OpenBSD: PLIST-main,v 1.3 2007/09/16 20:05:12 kili Exp $
@pkgpath lang/ghc
@unexec /usr/bin/env HOME=/nonexistent %D/lib/ghc/unregister.sh
bin/ghc
@ -1600,4 +1600,5 @@ lib/ghc/register.sh
lib/ghc/template-hsc.h
lib/ghc/unlit
lib/ghc/unregister.sh
@man man/man1/ghc.1
@exec /usr/bin/env HOME=/nonexistent %D/lib/ghc/register.sh