ports/60155: [patch] lang/ghc: Unbreak on -CURRENT + improvements

Volker Stolz stolz at i2.informatik.rwth-aachen.de
Thu Dec 11 16:00:48 UTC 2003


>Number:         60155
>Category:       ports
>Synopsis:       [patch] lang/ghc: Unbreak on -CURRENT + improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 11 08:00:36 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Volker Stolz
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Lehrstuhl für Informatik II
>Environment:
System: FreeBSD menelaos.informatik.rwth-aachen.de 4.9-STABLE FreeBSD 4.9-STABLE #12: Mon Dec 8 15:14:27 CET 2003 root at menelaos.informatik.rwth-aachen.de:/usr/obj/usr/src/sys/MENELAOS i386


>Description:
- 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 (saves further patching)
- Bump PORTREVISION

Successfully builds "hello world" on -CURRENT.
>How-To-Repeat:
>Fix:
Add 5 patch files:
patch-ghc-compiler-nativeGen-MachMisc.lhs
patch-ghc-compiler-nativeGen-RegAllocInfo.lhs
patch-ghc-rts-RtsFlags.c
patch-ghc-rts-rts.conf.in
patch-ghc-utils-prof-cgprof-cgprof.c

--- ghc5-patch begins here ---
diff -urN /usr/ports/lang/ghc/Makefile ghc/Makefile
--- /usr/ports/lang/ghc/Makefile	Tue May  6 22:10:06 2003
+++ ghc/Makefile	Thu Dec 11 16:48:06 2003
@@ -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
@@ -30,7 +31,10 @@
 MAINTAINER=	simonmar at microsoft.com
 COMMENT=	A Compiler for the functional language Haskell
 
+LIB_DEPENDS=	gmp.6:${PORTSDIR}/math/libgmp4
+
 USE_PERL5=	yes
+USE_REINPLACE=	yes
 USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
 
@@ -49,6 +53,8 @@
 CONFIGURE_ARGS= --with-ghc=${BOOT_GHC}
 # specifying CONFIGURE_TARGET doesn't work for some reason.
 CONFIGURE_TARGET=
+# libgmp:
+CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
 
 # override TMPDIR because /tmp often doesn't have enough space
 # to build some of the larger libraries.
@@ -64,10 +70,13 @@
 	@${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 +86,7 @@
 			${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})
diff -urN /usr/ports/lang/ghc/files/patch-ghc-compiler-nativeGen-MachMisc.lhs ghc/files/patch-ghc-compiler-nativeGen-MachMisc.lhs
--- /usr/ports/lang/ghc/files/patch-ghc-compiler-nativeGen-MachMisc.lhs	Thu Jan  1 01:00:00 1970
+++ ghc/files/patch-ghc-compiler-nativeGen-MachMisc.lhs	Thu Dec 11 11:47:48 2003
@@ -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
diff -urN /usr/ports/lang/ghc/files/patch-ghc-compiler-nativeGen-RegAllocInfo.lhs ghc/files/patch-ghc-compiler-nativeGen-RegAllocInfo.lhs
--- /usr/ports/lang/ghc/files/patch-ghc-compiler-nativeGen-RegAllocInfo.lhs	Thu Jan  1 01:00:00 1970
+++ ghc/files/patch-ghc-compiler-nativeGen-RegAllocInfo.lhs	Thu Dec 11 14:09:00 2003
@@ -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)
diff -urN /usr/ports/lang/ghc/files/patch-ghc-rts-RtsFlags.c ghc/files/patch-ghc-rts-RtsFlags.c
--- /usr/ports/lang/ghc/files/patch-ghc-rts-RtsFlags.c	Thu Jan  1 01:00:00 1970
+++ ghc/files/patch-ghc-rts-RtsFlags.c	Thu Dec 11 15:13:53 2003
@@ -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;
+ 		}
diff -urN /usr/ports/lang/ghc/files/patch-ghc-rts-rts.conf.in ghc/files/patch-ghc-rts-rts.conf.in
--- /usr/ports/lang/ghc/files/patch-ghc-rts-rts.conf.in	Thu Jan  1 01:00:00 1970
+++ ghc/files/patch-ghc-rts-rts.conf.in	Thu Dec 11 16:09:19 2003
@@ -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" ]
diff -urN /usr/ports/lang/ghc/files/patch-ghc-utils-prof-cgprof-cgprof.c ghc/files/patch-ghc-utils-prof-cgprof-cgprof.c
--- /usr/ports/lang/ghc/files/patch-ghc-utils-prof-cgprof-cgprof.c	Thu Jan  1 01:00:00 1970
+++ ghc/files/patch-ghc-utils-prof-cgprof-cgprof.c	Thu Dec 11 11:52:50 2003
@@ -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 */
+ }
--- ghc5-patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list