Fix build on platforms on which we don't have register info
authorIan Lynagh <ian@well-typed.com>
Sat, 27 Oct 2012 12:37:45 +0000 (13:37 +0100)
committerIan Lynagh <ian@well-typed.com>
Sat, 27 Oct 2012 12:37:45 +0000 (13:37 +0100)
includes/ghc.mk
includes/stg/RtsMachRegs.h

index dd38a6d..85df1da 100644 (file)
@@ -34,7 +34,7 @@ includes_H_FILES := $(subst /./,/,$(includes_H_FILES))
 # Options
 #
 ifeq "$(GhcUnregisterised)" "YES"
-includes_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER
+includes_CC_OPTS += -DUSE_MINIINTERPRETER
 endif
 
 includes_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
@@ -125,6 +125,9 @@ endif
        @echo "#define $(TargetOS_CPP)_TARGET_OS  1" >> $@  
        @echo "#define TARGET_OS  \"$(TargetOS_CPP)\"" >> $@
        @echo "#define $(TargetVendor_CPP)_TARGET_VENDOR  1" >> $@
+ifeq "$(GhcUnregisterised)" "YES"
+       @echo "#define UnregisterisedCompiler 1" >> $@
+endif
        @echo >> $@
        @echo "#endif /* __GHCPLATFORM_H__ */"          >> $@
        @echo "Done."
index f78cb1f..1eae6a5 100644 (file)
 #ifndef RTSMACHREGS_H
 #define RTSMACHREGS_H
 
+#ifdef UnregisterisedCompiler
+#ifndef NO_REGS
+#define NO_REGS
+#endif
+#endif
+
 /*
  * Defining NO_REGS causes no global registers to be used.  NO_REGS is
  * typically defined by GHC, via a command-line option passed to gcc,