The following hacks allowed me to get through installation process of ghc-2.04 under IRIX 6.2: 1. hi-boot target is missing when compiling with ghc-0.29. Probably a rule like the following is not needed thanks to makedepend but it is not going to hurt either. The second chunk of this patch adds a dependency "util/Argv.o : util/FastString.hi" which for some reason is not generated automatically. diff -urd -w ghc-2.04-orig/ghc/compiler/Makefile ghc-2.04/ghc/compiler/Makefile --- ghc-2.04-orig/ghc/compiler/Makefile Thu Jun 5 03:23:50 1997 +++ ghc-2.04/ghc/compiler/Makefile Sat Jun 7 12:47:33 1997 @@ -303,10 +303,15 @@ $(RM) $@ $(UNLIT) $< $@ || ( $(RM) $@ && exit 1 ) @chmod 444 $@ + +hi-boot :: + echo $(patsubst %.lhi,%.hi,$(wildcard */*.lhi)) + endif boot :: hi-boot + #----------------------------------------------------------------------------- # Linking @@ -401,3 +406,5 @@ parser/U_ttype.o : parser/hspincl.h parser/printtree.o : parser/hspincl.h reader/ReadPrefix.o : parser/hspincl.h + +util/Argv.o : util/FastString.hi ======================= 2. This patch removes an insignificant warning about redefining `INTLIKE_closures' with a const keyword. diff -urd -w ghc-2.04-orig/ghc/includes/SMClosures.lh ghc-2.04/ghc/includes/SMClosures.lh --- ghc-2.04-orig/ghc/includes/SMClosures.lh Mon Mar 17 20:19:27 1997 +++ ghc-2.04/ghc/includes/SMClosures.lh Sat Jun 7 12:40:24 1997 @@ -1106,7 +1106,7 @@ #define INTLIKE_CLOSURE_NoNONPTRS(closure) (1L) /* Array of static intlike closures */ -extern P_ INTLIKE_closures; +extern const P_ INTLIKE_closures; /* Range of static intlike closures MAX_INTLIKE, MIN_INTLIKE is in GhcConstants.lh */ ======================= 3. Signals.lc code uses irix6_TARGET_OS symbol which, as far as I can see, is never defined. The following patch does not fix this but corrects sigaction.sa_handler usage and cleans up some warnings which show up under IRIX. (I used #elif because ghc already requires GNU cpp/gcc additional capabilities.) If you want to compile ghc right now rename irix6_TARGET_OS to irix_TARGET_OS. diff -urd -w ghc-2.04-orig/ghc/runtime/main/Signals.lc ghc-2.04/ghc/runtime/main/Signals.lc --- ghc-2.04-orig/ghc/runtime/main/Signals.lc Tue May 27 01:22:02 1997 +++ ghc-2.04/ghc/runtime/main/Signals.lc Sat Jun 7 16:17:01 1997 @@ -172,16 +172,37 @@ #endif } -# else /* Not SunOS 4, FreeBSD, or Linux(a.out) */ +# elif defined(irix6_TARGET_OS) -# if defined(irix_TARGET_OS) -# ifndef irix6_TARGET_OS /* will this do for irix-6.x ? ToDo: check. (SOF 5/97) */ - /* certainly BOGUS (WDP 94/05) -- copied from /usr/include/sys/siginfo.h */ -# define si_addr _data._fault._addr -# endif -# endif +static void +segv_handler(int sig, siginfo_t *sip, void *dummy) +{ + fflush(stdout); + if (sip == NULL) { + fprintf(stderr, "Segmentation fault caught, address unknown\n"); + } else { + if (sip->si_addr >= (void *) stks_space + && sip->si_addr < (void *) (stks_space + RTSflags.GcFlags.stksSize)) + StackOverflow(); -#if defined(cygwin32_TARGET_OS) + fprintf(stderr, "Segmentation fault caught, address = %08lx\n", (W_) sip->si_addr); + } + abort(); +} + +int +install_segv_handler(STG_NO_ARGS) +{ + struct sigaction action; + + action.sa_sigaction = segv_handler; + sigemptyset(&action.sa_mask); + action.sa_flags = SA_SIGINFO; + + return sigaction(SIGSEGV, &action, NULL); +} + +# elif defined(cygwin32_TARGET_OS) /* The signal handlers in cygwin32 (beta14) are only passed the signal number, no sigcontext/siginfo is passed as event data..sigh. For @@ -217,7 +238,12 @@ } -#else /* !defined(cygwin32_TARGET_OS) */ +# else /* ?_TARGET_OS */ + +# ifdef irix_TARGET_OS + /* certainly BOGUS (WDP 94/05) -- copied from /usr/include/sys/siginfo. */ +# define si_addr _data._fault._addr +# endif static void segv_handler(int sig, siginfo_t *sip) @@ -248,9 +274,7 @@ return sigaction(SIGSEGV, &action, NULL); } -#endif /* not cygwin32_TARGET_OS */ - -# endif /* not SunOS 4 */ +#endif /* _TARGET_OS */ #endif /* STACK_CHECK_BY_PAGE_FAULT */ ======================= 4. Autoconf is used for checking of existence of readline/readline.h include file but there are no provisions for adding local include directories to the search path. Adding --site-includes and --with-readline switches to configure could help solve this problem and allow removal of ReadlineIncludePath variable from build.mk. For the time being the following patch causes configure autodetection results to be ignored. diff -urd -w ghc-2.04-orig/hslibs/ghc/cbits/ghcReadline.h ghc-2.04/hslibs/ghc/cbits/ghcReadline.h --- ghc-2.04-orig/hslibs/ghc/cbits/ghcReadline.h Tue Mar 18 23:48:24 1997 +++ ghc-2.04/hslibs/ghc/cbits/ghcReadline.h Sat Jun 7 11:45:41 1997 @@ -4,9 +4,7 @@ /* Included to see the defn. the HAVE_* below */ #include "config.h" -#if HAVE_READLINE_READLINE_H #include "readline/readline.h" -#endif /* For some reason the following 3 aren't defined in readline.h */ extern int rl_mark; ======================= 5. An attempt to 'make txt' in 'docs' directory fails because lit2text does not accept '-c' option. It also loops infinitely on installing.lit. The following changes make it work somehow though it is far from perfect. diff -urd -w ghc-2.04-orig/mk/suffix.mk ghc-2.04/mk/suffix.mk --- ghc-2.04-orig/mk/suffix.mk Thu Jun 5 04:17:20 1997 +++ ghc-2.04/mk/suffix.mk Sat Jun 7 17:20:49 1997 @@ -181,7 +181,7 @@ %.txt : %.lit @$(RM) $@ - $(LIT2TEXT) -c $(LIT2TEXT_OPTS) -o $@ $< + $(LIT2TEXT) $(LIT2TEXT_OPTS) -o $@ $< @chmod 444 $@ %.ihtml : %.lit diff -urd -w ghc-2.04-orig/literate/lit-reader.prl ghc-2.04/literate/lit-reader.prl --- ghc-2.04-orig/literate/lit-reader.prl Mon Mar 17 20:23:02 1997 +++ ghc-2.04/literate/lit-reader.prl Sat Jun 7 18:00:54 1997 @@ -474,7 +474,7 @@ $Nodename_sec{&htmlize_text($label_name)} = $S if $Lit2html; $Sec_aliases[$S] .= "$label_name,"; } - s/\\label\{([^\}]+)\}// if $Lit2texi; + s/\\label\{([^\}]+)\}// if ($Lit2texi || $Lit2text); s/\\label\{/\\label!_\{/ if $Lit2latex; # temp } s/\\label!_\{/\\label\{/g if $Lit2latex; # untemp