2005-02-13 20:26:56 -05:00
|
|
|
$OpenBSD: patch-distrib_hc-build,v 1.4 2005/02/14 01:26:56 dons Exp $
|
2004-04-26 19:48:50 -04:00
|
|
|
SplitObjs just slows things down, and can overrun ulimits. It does
|
|
|
|
produce smaller binaries though...
|
|
|
|
|
|
|
|
Help ghc find libgmp.a
|
2004-01-08 15:33:23 -05:00
|
|
|
|
|
|
|
And GHC produces stack_smash_handler() core dumps on sparc
|
|
|
|
unless propolice is turned off. This used to happen on x86, but
|
|
|
|
has been fixed. Someone want to fix this on sparc?
|
|
|
|
|
2004-04-26 19:48:50 -04:00
|
|
|
For some odd reason the existing regex doesn't want to remove all *.o
|
|
|
|
and *.a files from the libraries. Can't work out why.
|
2004-01-08 15:33:23 -05:00
|
|
|
|
2004-04-26 19:48:50 -04:00
|
|
|
Touch some things so that 'make fake' doesn't rebuild the compiler
|
2004-01-08 15:33:23 -05:00
|
|
|
|
2005-02-13 20:26:56 -05:00
|
|
|
Make stage=2 after everything else, so as to get a working ghci. Unknown
|
|
|
|
why ghci doesn't work just via .hc files.
|
|
|
|
|
|
|
|
--- distrib/hc-build.orig Wed Sep 3 21:15:19 2003
|
|
|
|
+++ distrib/hc-build Wed Feb 2 13:00:23 2005
|
|
|
|
@@ -29,20 +29,30 @@ fi
|
2004-04-26 19:48:50 -04:00
|
|
|
case "$configopts" in
|
|
|
|
*--enable-hc-boot-unregisterised*)
|
|
|
|
cat >mk/build.mk <<END
|
|
|
|
-GhcWithInterpreter=NO
|
|
|
|
GhcWithNativeCodeGen=NO
|
|
|
|
SplitObjs=NO
|
|
|
|
-GhcLibWays=
|
|
|
|
+SRC_HC_OPTS+=-L\$(LOCALBASE)/lib
|
|
|
|
+SRC_CC_OPTS+=-L\$(LOCALBASE)/lib
|
|
|
|
END
|
|
|
|
;;
|
|
|
|
|
2003-09-01 16:32:14 -04:00
|
|
|
*)
|
|
|
|
cat >mk/build.mk <<END
|
|
|
|
# empty
|
|
|
|
+SplitObjs=NO
|
|
|
|
+SRC_HC_OPTS+=-L\$(LOCALBASE)/lib
|
|
|
|
+SRC_CC_OPTS+=-L\$(LOCALBASE)/lib
|
|
|
|
END
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2004-01-08 15:33:23 -05:00
|
|
|
+if [ `uname -m` == "sparc" ] ; then
|
|
|
|
+ echo "SRC_HC_OPTS+=-optc-fno-stack-protector" >> mk/build.mk
|
|
|
|
+ echo "SRC_CC_OPTS+=-fno-stack-protector" >> mk/build.mk
|
|
|
|
+fi
|
|
|
|
+
|
2003-09-01 16:32:14 -04:00
|
|
|
+export CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
|
|
|
|
+
|
|
|
|
echo "*** Building compiler..."
|
|
|
|
./configure --enable-hc-boot $configopts
|
|
|
|
|
2005-02-13 20:26:56 -05:00
|
|
|
@@ -77,7 +87,7 @@ PRIMOP_BITS="primop-data-decl.hs-incl \
|
2003-09-01 16:32:14 -04:00
|
|
|
# Remove the old libraries. Don't use make clean, because we don't
|
|
|
|
# want to delete the .hs files generated from the .hsc files, because
|
|
|
|
# we don't have hsc2hs built yet.
|
|
|
|
-find libraries hslibs | grep '\.\(o\|a\)$' | xargs rm -f
|
|
|
|
+find libraries hslibs | grep '\.[oa]$' | xargs rm -f
|
|
|
|
|
|
|
|
# Do includes and RTS now
|
|
|
|
$MAKE -C ghc/includes boot && $MAKE -C ghc/includes all
|
2005-02-13 20:26:56 -05:00
|
|
|
@@ -95,6 +105,10 @@ $MAKE -C hslibs boot all
|
2004-04-26 19:48:50 -04:00
|
|
|
# The reconfigure step updates a few files, which can lead to
|
|
|
|
# unnecessary recompilations. Touch a bunch of things here to avoid
|
|
|
|
# having to recompile stuff that we've already built.
|
|
|
|
-(cd ghc/compiler; touch $PRIMOP_BITS parser/hschooks.o prelude/PrimOp.o main/Config.hs main/Config.o ghc-*)
|
2005-02-13 20:26:56 -05:00
|
|
|
+#(cd ghc/compiler/; touch $PRIMOP_BITS main/Config.hs stage1/parser/hschooks.o stage1/prelude/PrimOp.o stage1/main/Config.o stage1/ghc-* ghc-inplace)
|
2003-09-01 16:32:14 -04:00
|
|
|
|
|
|
|
# At this point, the tree should be safe to do 'make install' in.
|
2005-02-13 20:26:56 -05:00
|
|
|
+
|
|
|
|
+# now, ghci doesn't work when build via .hc, so make stage=2, and build
|
|
|
|
+# it via .hs
|
|
|
|
+(cd ghc/compiler; touch prelude/primops.txt ; gmake boot stage=2 && gmake stage=2)
|