
On Mon, Sep 15, 2003 at 03:18:43PM +0100, Simon Marlow wrote:
Am I right in thinking that by just putting
GhcUnregisterised=YES SplitObjs=NO
in mk/build.mk every time you build GHC it ought to not only work on arches with bit-rotted mangler support but also those with none attempted? Where work means compiles the same set of programs, but the result (as well as the compilation) will be slower?
Yes, with the caveat that this applies only to the the code *generated* by the GHC you're building.
Ah, and also no GHCi or TH on Linux unless you are x86, sparc or IA64. The GHCi section at the bottom of http://www.haskell.org/ghc/docs/latest/html/building/sec-porting-ghc.html looks like it might be a bit optimistic to me. A case for "switch (ehdr->e_machine)" must be added at least, and it looks as though some other tweaking and handling of relocations (I guess the ones in there are the ones that it belched on during porting?) is generally necessary.
Sure, shipping an unregisterised port is completely acceptable.
OK, I uploaded s390, hppa and alpha unregisterised for Debian unstable
earlier today, with ppc to follow shortly I hope (x86, sparc and ia64
are already there registerised).
I needed to apply the following patches to get them to build (this is
largely to files that only matter for registerised building, but it was
easier to fix them than hack the Makefiles):
Numerous additions to configure/configure.in. I can add these in CVS, but
I'm not sure if I should add
+s390-ibm-linux*)
+ HostPlatform=s390-ibm-linux
+ TargetPlatform=s390-ibm-linux #hack
+ BuildPlatform=s390-ibm-linux #hack
+ HostPlatform_CPP='s390_ibm_linux'
+ HostArch_CPP='s390'
+ HostVendor_CPP='ibm'
+ HostOS_CPP='linux'
+ ;;
as it is or with unknown instead of ibm?
powerpc:
--- ghc6-6.0.1.orig/ghc/compiler/nativeGen/MachCode.lhs
+++ ghc6-6.0.1/ghc/compiler/nativeGen/MachCode.lhs
@@ -41,7 +41,7 @@
NatM, thenNat, returnNat, mapNat,
mapAndUnzipNat, mapAccumLNat,
getDeltaNat, setDeltaNat, getUniqueNat,
- IF_OS_darwin(addImportNat COMMA,)
+ IF_ARCH_powerpc(addImportNat COMMA,)
ncgPrimopMoan,
ncg_target_is_32bit
)
[ addImportNat is later used in a #if powerpc_TARGET_ARCH - I don't know
which is actually right, but as long as it compiles it doesn't matter
for an unreg build ]
alpha:
--- ghc6-6.0.1.orig/ghc/includes/Stg.h
+++ ghc6-6.0.1/ghc/includes/Stg.h
@@ -33,6 +33,8 @@
# endif
#endif
+#include "TailCalls.h"
+
/* Configuration */
#include "config.h"
@@ -186,7 +188,6 @@
#include "SMP.h"
#include "MachRegs.h"
#include "Regs.h"
-#include "TailCalls.h"
#include "Block.h"
/* RTS public interface */
--- ghc6-6.0.1.orig/ghc/includes/TailCalls.h
+++ ghc6-6.0.1/ghc/includes/TailCalls.h
@@ -83,7 +83,9 @@
#ifdef alpha_TARGET_ARCH
+#ifdef IN_STG_CODE
register void *_procedure __asm__("$27");
+#endif
#define JMP_(cont) \
do { _procedure = (void *)(cont); \
--- ghc6-6.0.1.orig/ghc/rts/Adjustor.c
+++ ghc6-6.0.1/ghc/rts/Adjustor.c
@@ -73,7 +73,7 @@
#if defined(alpha_TARGET_ARCH)
/* To get the definition of PAL_imb: */
-#include