- Fix build on -CURRENT by importing some gcc33 fixes

- Fix linker issue on -CURRENT by not using SplitObjs, same as:
   http://www.haskell.org/pipermail/glasgow-haskell-users/2003-June/005289.html
- Use libgmp from ports on -CURRENT (saves further patching)
- Bump PORTREVISION

PR:		ports/60155
Submitted by:	Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
Approved by:	maintainer
This commit is contained in:
Oliver Braun 2003-12-12 16:33:17 +00:00
parent 0fe91a205b
commit 4c99d59e5e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=95673
14 changed files with 212 additions and 4 deletions

View File

@ -6,6 +6,7 @@
PORTNAME= ghc
PORTVERSION= 5.04.3
PORTREVISION= 1
CATEGORIES= lang haskell
MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \
http://www.haskell.org/ghc/dist/${PORTVERSION}/FreeBSD/:boot
@ -25,12 +26,19 @@ DISTFILES= ${SRC_DIST}
DISTFILES+= ${BOOT_DIST}
.else
DISTFILES+= ${BOOT_DIST5}
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-ghc-compiler-nativeGen-MachMisc.lhs \
${FILESDIR}/extra-patch-ghc-compiler-nativeGen-RegAllocInfo.lhs \
${FILESDIR}/extra-patch-ghc-rts-RtsFlags.c \
${FILESDIR}/extra-patch-ghc-rts-rts.conf.in \
${FILESDIR}/extra-patch-ghc-utils-prof-cgprof-cgprof.c
LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
.endif
MAINTAINER= simonmar@microsoft.com
COMMENT= A Compiler for the functional language Haskell
USE_PERL5= yes
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
@ -49,6 +57,13 @@ BOOT_GHC= ${BOOT_DIR}/bin/i386-unknown-freebsd/ghc-${PORTVERSION}
CONFIGURE_ARGS= --with-ghc=${BOOT_GHC}
# specifying CONFIGURE_TARGET doesn't work for some reason.
CONFIGURE_TARGET=
# libgmp:
.if ${OSVERSION} >= 500000
CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
PLIST_SUB+= GMP="@comment "
.else
PLIST_SUB+= GMP=""
.endif
# override TMPDIR because /tmp often doesn't have enough space
# to build some of the larger libraries.
@ -64,10 +79,13 @@ pre-everything::
@${ECHO_CMD} "Building GHC without profiling libraries."
.endif
.if defined(WITHOUT_PROFILE)
post-extract:
.if defined(WITHOUT_PROFILE)
@${ECHO} >>${WRKSRC}/mk/build.mk GhcLibWays=
.endif
.if ${OSVERSION} >= 500000
@${ECHO} >>${WRKSRC}/mk/build.mk SplitObjs=NO
.endif
post-patch:
@${PERL} -pi -e 's/DrIFT/DrIFT-ghc/g; \
@ -77,6 +95,7 @@ post-patch:
${WRKSRC}/hslibs/tools/DrIFT/Makefile \
${WRKSRC}/hslibs/tools/DtdToHaskell/Makefile \
${WRKSRC}/hslibs/tools/Xtract/Makefile
@${REINPLACE_CMD} s+%%LOCALBASE%%+${LOCALBASE}+ ${WRKSRC}/ghc/rts/rts.conf.in
pre-configure:
@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})

View File

@ -0,0 +1,15 @@
--- ghc/compiler/nativeGen/MachMisc.lhs.orig Thu Dec 11 11:42:12 2003
+++ ghc/compiler/nativeGen/MachMisc.lhs Thu Dec 11 11:44:02 2003
@@ -71,11 +71,11 @@
fmtAsmLbl :: String -> String -- for formatting labels
fmtAsmLbl s
- = IF_ARCH_alpha(
{- The alpha assembler likes temporary labels to look like $L123
instead of L123. (Don't toss the L, because then Lf28
turns into $f28.)
-}
+ = IF_ARCH_alpha(
'$' : s
,{-otherwise-}
'.':'L':s

View File

@ -0,0 +1,28 @@
--- ghc/compiler/nativeGen/RegAllocInfo.lhs.orig Tue Jan 29 17:52:32 2002
+++ ghc/compiler/nativeGen/RegAllocInfo.lhs Thu Dec 11 13:30:50 2003
@@ -808,9 +808,9 @@
{-I386: spill above stack pointer leaving 3 words/spill-}
,IF_ARCH_i386 ( let off_w = (off-delta) `div` 4
- in case regClass vreg of
- RcInteger -> MOV L (OpReg dyn) (OpAddr (spRel off_w))
- _ -> GST F80 dyn (spRel off_w) -- RcFloat/RcDouble
+ in case regClass vreg of {
+ RcInteger -> MOV L (OpReg dyn) (OpAddr (spRel off_w));
+ _ -> GST F80 dyn (spRel off_w)} -- RcFloat/RcDouble
{-SPARC: spill below frame pointer leaving 2 words/spill-}
,IF_ARCH_sparc(
@@ -831,9 +831,9 @@
IF_ARCH_alpha( LD sz dyn (spRel (- (off `div` 8)))
,IF_ARCH_i386 ( let off_w = (off-delta) `div` 4
- in case regClass vreg of
- RcInteger -> MOV L (OpAddr (spRel off_w)) (OpReg dyn)
- _ -> GLD F80 (spRel off_w) dyn -- RcFloat/RcDouble
+ in case regClass vreg of {
+ RcInteger -> MOV L (OpAddr (spRel off_w)) (OpReg dyn);
+ _ -> GLD F80 (spRel off_w) dyn} -- RcFloat/RcDouble
,IF_ARCH_sparc(
let off_w = 1 + (off `div` 4)

View File

@ -0,0 +1,12 @@
--- ghc/rts/RtsFlags.c.orig Thu Dec 11 15:13:07 2003
+++ ghc/rts/RtsFlags.c Thu Dec 11 15:13:17 2003
@@ -1383,8 +1383,7 @@
} else if (RtsFlags.GranFlags.proc > MAX_PROC ||
RtsFlags.GranFlags.proc < 1)
{
- fprintf(stderr,"setupRtsFlags: no more than %u processors
-allowed\n",
+ fprintf(stderr,"setupRtsFlags: no more than %u processors allowed\n",
MAX_PROC);
*error = rtsTrue;
}

View File

@ -0,0 +1,10 @@
--- ghc/rts/rts.conf.in.orig Thu Dec 11 15:53:05 2003
+++ ghc/rts/rts.conf.in Thu Dec 11 16:08:54 2003
@@ -134,6 +134,7 @@
, "-u", "GHCziWeak_runFinalizzerBatch_closure"
, "-u", "__stginit_Prelude"
#endif
+ , "-L%%LOCALBASE%%/lib"
]
#ifdef HAVE_FRAMEWORK_HASKELLSUPPORT
, extra_frameworks = [ "HaskellSupport" ]

View File

@ -0,0 +1,20 @@
--- ghc/utils/prof/cgprof/cgprof.c.orig Thu Dec 11 11:50:34 2003
+++ ghc/utils/prof/cgprof/cgprof.c Thu Dec 11 11:51:47 2003
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------
- * $Id: cgprof.c,v 1.1 2000/04/05 10:06:36 simonmar Exp $
+ * $Id: cgprof.c,v 1.2 2002/10/05 22:18:46 panne Exp $
*
* Copyright (C) 1995-2000 University of Oxford
*
@@ -1183,8 +1183,8 @@
} /* end of new for loop */
*nonodes = symbol_table_next;
- fprintf(log,"%s: read %d lines from profile.Graph contains %i nodes.
- \n",Pgm,nolines,symbol_table_next);
+ fprintf(log,"%s: read %d lines from profile.Graph contains %i nodes.\n",
+ Pgm,nolines,symbol_table_next);
free_cc_matrix(cc_m); /* be nice and clean up the cost centre matrix */
}

View File

@ -819,7 +819,7 @@ lib/ghc-%%GHC_VERSION%%/libHStext_cbits.a
lib/ghc-%%GHC_VERSION%%/libHSutil.a
lib/ghc-%%GHC_VERSION%%/libHSutil_cbits.a
%%PROFILE%%lib/ghc-%%GHC_VERSION%%/libHSutil_p.a
lib/ghc-%%GHC_VERSION%%/libgmp.a
%%GMP%%lib/ghc-%%GHC_VERSION%%/libgmp.a
lib/ghc-%%GHC_VERSION%%/package.conf
lib/ghc-%%GHC_VERSION%%/parse-gcstats.prl
lib/ghc-%%GHC_VERSION%%/process-gcstats.prl

View File

@ -6,6 +6,7 @@
PORTNAME= ghc
PORTVERSION= 5.04.3
PORTREVISION= 1
CATEGORIES= lang haskell
MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \
http://www.haskell.org/ghc/dist/${PORTVERSION}/FreeBSD/:boot
@ -25,12 +26,19 @@ DISTFILES= ${SRC_DIST}
DISTFILES+= ${BOOT_DIST}
.else
DISTFILES+= ${BOOT_DIST5}
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-ghc-compiler-nativeGen-MachMisc.lhs \
${FILESDIR}/extra-patch-ghc-compiler-nativeGen-RegAllocInfo.lhs \
${FILESDIR}/extra-patch-ghc-rts-RtsFlags.c \
${FILESDIR}/extra-patch-ghc-rts-rts.conf.in \
${FILESDIR}/extra-patch-ghc-utils-prof-cgprof-cgprof.c
LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
.endif
MAINTAINER= simonmar@microsoft.com
COMMENT= A Compiler for the functional language Haskell
USE_PERL5= yes
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
@ -49,6 +57,13 @@ BOOT_GHC= ${BOOT_DIR}/bin/i386-unknown-freebsd/ghc-${PORTVERSION}
CONFIGURE_ARGS= --with-ghc=${BOOT_GHC}
# specifying CONFIGURE_TARGET doesn't work for some reason.
CONFIGURE_TARGET=
# libgmp:
.if ${OSVERSION} >= 500000
CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
PLIST_SUB+= GMP="@comment "
.else
PLIST_SUB+= GMP=""
.endif
# override TMPDIR because /tmp often doesn't have enough space
# to build some of the larger libraries.
@ -64,10 +79,13 @@ pre-everything::
@${ECHO_CMD} "Building GHC without profiling libraries."
.endif
.if defined(WITHOUT_PROFILE)
post-extract:
.if defined(WITHOUT_PROFILE)
@${ECHO} >>${WRKSRC}/mk/build.mk GhcLibWays=
.endif
.if ${OSVERSION} >= 500000
@${ECHO} >>${WRKSRC}/mk/build.mk SplitObjs=NO
.endif
post-patch:
@${PERL} -pi -e 's/DrIFT/DrIFT-ghc/g; \
@ -77,6 +95,7 @@ post-patch:
${WRKSRC}/hslibs/tools/DrIFT/Makefile \
${WRKSRC}/hslibs/tools/DtdToHaskell/Makefile \
${WRKSRC}/hslibs/tools/Xtract/Makefile
@${REINPLACE_CMD} s+%%LOCALBASE%%+${LOCALBASE}+ ${WRKSRC}/ghc/rts/rts.conf.in
pre-configure:
@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})

View File

@ -0,0 +1,15 @@
--- ghc/compiler/nativeGen/MachMisc.lhs.orig Thu Dec 11 11:42:12 2003
+++ ghc/compiler/nativeGen/MachMisc.lhs Thu Dec 11 11:44:02 2003
@@ -71,11 +71,11 @@
fmtAsmLbl :: String -> String -- for formatting labels
fmtAsmLbl s
- = IF_ARCH_alpha(
{- The alpha assembler likes temporary labels to look like $L123
instead of L123. (Don't toss the L, because then Lf28
turns into $f28.)
-}
+ = IF_ARCH_alpha(
'$' : s
,{-otherwise-}
'.':'L':s

View File

@ -0,0 +1,28 @@
--- ghc/compiler/nativeGen/RegAllocInfo.lhs.orig Tue Jan 29 17:52:32 2002
+++ ghc/compiler/nativeGen/RegAllocInfo.lhs Thu Dec 11 13:30:50 2003
@@ -808,9 +808,9 @@
{-I386: spill above stack pointer leaving 3 words/spill-}
,IF_ARCH_i386 ( let off_w = (off-delta) `div` 4
- in case regClass vreg of
- RcInteger -> MOV L (OpReg dyn) (OpAddr (spRel off_w))
- _ -> GST F80 dyn (spRel off_w) -- RcFloat/RcDouble
+ in case regClass vreg of {
+ RcInteger -> MOV L (OpReg dyn) (OpAddr (spRel off_w));
+ _ -> GST F80 dyn (spRel off_w)} -- RcFloat/RcDouble
{-SPARC: spill below frame pointer leaving 2 words/spill-}
,IF_ARCH_sparc(
@@ -831,9 +831,9 @@
IF_ARCH_alpha( LD sz dyn (spRel (- (off `div` 8)))
,IF_ARCH_i386 ( let off_w = (off-delta) `div` 4
- in case regClass vreg of
- RcInteger -> MOV L (OpAddr (spRel off_w)) (OpReg dyn)
- _ -> GLD F80 (spRel off_w) dyn -- RcFloat/RcDouble
+ in case regClass vreg of {
+ RcInteger -> MOV L (OpAddr (spRel off_w)) (OpReg dyn);
+ _ -> GLD F80 (spRel off_w) dyn} -- RcFloat/RcDouble
,IF_ARCH_sparc(
let off_w = 1 + (off `div` 4)

View File

@ -0,0 +1,12 @@
--- ghc/rts/RtsFlags.c.orig Thu Dec 11 15:13:07 2003
+++ ghc/rts/RtsFlags.c Thu Dec 11 15:13:17 2003
@@ -1383,8 +1383,7 @@
} else if (RtsFlags.GranFlags.proc > MAX_PROC ||
RtsFlags.GranFlags.proc < 1)
{
- fprintf(stderr,"setupRtsFlags: no more than %u processors
-allowed\n",
+ fprintf(stderr,"setupRtsFlags: no more than %u processors allowed\n",
MAX_PROC);
*error = rtsTrue;
}

View File

@ -0,0 +1,10 @@
--- ghc/rts/rts.conf.in.orig Thu Dec 11 15:53:05 2003
+++ ghc/rts/rts.conf.in Thu Dec 11 16:08:54 2003
@@ -134,6 +134,7 @@
, "-u", "GHCziWeak_runFinalizzerBatch_closure"
, "-u", "__stginit_Prelude"
#endif
+ , "-L%%LOCALBASE%%/lib"
]
#ifdef HAVE_FRAMEWORK_HASKELLSUPPORT
, extra_frameworks = [ "HaskellSupport" ]

View File

@ -0,0 +1,20 @@
--- ghc/utils/prof/cgprof/cgprof.c.orig Thu Dec 11 11:50:34 2003
+++ ghc/utils/prof/cgprof/cgprof.c Thu Dec 11 11:51:47 2003
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------------
- * $Id: cgprof.c,v 1.1 2000/04/05 10:06:36 simonmar Exp $
+ * $Id: cgprof.c,v 1.2 2002/10/05 22:18:46 panne Exp $
*
* Copyright (C) 1995-2000 University of Oxford
*
@@ -1183,8 +1183,8 @@
} /* end of new for loop */
*nonodes = symbol_table_next;
- fprintf(log,"%s: read %d lines from profile.Graph contains %i nodes.
- \n",Pgm,nolines,symbol_table_next);
+ fprintf(log,"%s: read %d lines from profile.Graph contains %i nodes.\n",
+ Pgm,nolines,symbol_table_next);
free_cc_matrix(cc_m); /* be nice and clean up the cost centre matrix */
}

View File

@ -819,7 +819,7 @@ lib/ghc-%%GHC_VERSION%%/libHStext_cbits.a
lib/ghc-%%GHC_VERSION%%/libHSutil.a
lib/ghc-%%GHC_VERSION%%/libHSutil_cbits.a
%%PROFILE%%lib/ghc-%%GHC_VERSION%%/libHSutil_p.a
lib/ghc-%%GHC_VERSION%%/libgmp.a
%%GMP%%lib/ghc-%%GHC_VERSION%%/libgmp.a
lib/ghc-%%GHC_VERSION%%/package.conf
lib/ghc-%%GHC_VERSION%%/parse-gcstats.prl
lib/ghc-%%GHC_VERSION%%/process-gcstats.prl