Commit 04089f99 authored by Simon Marlow's avatar Simon Marlow
Browse files

improve panic messages a bit, with the GHC version and platform

parent aa056e7f
...@@ -261,9 +261,9 @@ stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile ...@@ -261,9 +261,9 @@ stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
@echo "#ifndef __PLATFORM_H__" >$@ @echo "#ifndef __PLATFORM_H__" >$@
@echo "#define __PLATFORM_H__" >>$@ @echo "#define __PLATFORM_H__" >>$@
@echo >> $@ @echo >> $@
@echo "#define BuildPlatform_TYPE $(BuildPlatform_CPP)" >> $@ @echo "#define BuildPlatform_NAME \"$(BUILDPLATFORM)\"" >> $@
@echo "#define HostPlatform_TYPE $(HostPlatform_CPP)" >> $@ @echo "#define HostPlatform_NAME \"$(HOSTPLATFORM)\"" >> $@
@echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@ @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
@echo >> $@ @echo >> $@
@echo "#define $(BuildPlatform_CPP)_BUILD 1" >> $@ @echo "#define $(BuildPlatform_CPP)_BUILD 1" >> $@
@echo "#define $(HostPlatform_CPP)_HOST 1" >> $@ @echo "#define $(HostPlatform_CPP)_HOST 1" >> $@
...@@ -307,9 +307,9 @@ stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile ...@@ -307,9 +307,9 @@ stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
@echo "#ifndef __PLATFORM_H__" >$@ @echo "#ifndef __PLATFORM_H__" >$@
@echo "#define __PLATFORM_H__" >>$@ @echo "#define __PLATFORM_H__" >>$@
@echo >> $@ @echo >> $@
@echo "#define BuildPlatform_TYPE $(HostPlatform_CPP)" >> $@ @echo "#define BuildPlatform_NAME \"$(HOSTPLATFORM)\"" >> $@
@echo "#define HostPlatform_TYPE $(TargetPlatform_CPP)" >> $@ @echo "#define HostPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
@echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@ @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
@echo >> $@ @echo >> $@
@echo "#define $(HostPlatform_CPP)_BUILD 1" >> $@ @echo "#define $(HostPlatform_CPP)_BUILD 1" >> $@
@echo "#define $(TargetPlatform_CPP)_HOST 1" >> $@ @echo "#define $(TargetPlatform_CPP)_HOST 1" >> $@
......
...@@ -120,11 +120,10 @@ showGhcException (InstallationError str) ...@@ -120,11 +120,10 @@ showGhcException (InstallationError str)
showGhcException (Interrupted) showGhcException (Interrupted)
= showString "interrupted" = showString "interrupted"
showGhcException (Panic s) showGhcException (Panic s)
= showString ("panic! (the `impossible' happened, GHC version " = showString ("panic! (the 'impossible' happened)\n"
++ cProjectVersion ++ "):\n\t" ++ " (GHC version " ++ cProjectVersion ++ " for " ++ TargetPlatform_NAME ++ "):\n\t"
++ s ++ "\n\n" ++ s ++ "\n\n"
++ "Please report this as a compiler bug. See:\n" ++ "Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\n")
++ " http://www.haskell.org/ghc/reportabug\n")
#if __GLASGOW_HASKELL__ < 603 #if __GLASGOW_HASKELL__ < 603
myMkTyConApp = mkAppTy myMkTyConApp = mkAppTy
......
...@@ -124,6 +124,8 @@ SRC_HC_OPTS += -static ...@@ -124,6 +124,8 @@ SRC_HC_OPTS += -static
endif endif
# SRC_HC_OPTS += -fPIC # SRC_HC_OPTS += -fPIC
RtsMessages_CC_OPTS += -DProjectVersion=\"$(ProjectVersion)\"
ifeq "$(way)" "mp" ifeq "$(way)" "mp"
SRC_HC_OPTS += -I$$PVM_ROOT/include SRC_HC_OPTS += -I$$PVM_ROOT/include
endif endif
......
...@@ -107,6 +107,9 @@ isGUIApp() ...@@ -107,6 +107,9 @@ isGUIApp()
} }
#endif #endif
#define xstr(s) str(s)
#define str(s) #s
void void
rtsFatalInternalErrorFn(char *s, va_list ap) rtsFatalInternalErrorFn(char *s, va_list ap)
{ {
...@@ -135,7 +138,8 @@ rtsFatalInternalErrorFn(char *s, va_list ap) ...@@ -135,7 +138,8 @@ rtsFatalInternalErrorFn(char *s, va_list ap)
} }
vfprintf(stderr, s, ap); vfprintf(stderr, s, ap);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, " Please report this as a compiler bug. See:\n http://www.haskell.org/ghc/reportabug\n"); fprintf(stderr, " (GHC version %s for %s)\n", ProjectVersion, xstr(HostPlatform_TYPE));
fprintf(stderr, " Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\n");
fflush(stderr); fflush(stderr);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment