From 21198e4d1a1f7d41c48d08791b257479d257aba6 Mon Sep 17 00:00:00 2001 From: sewardj Date: Tue, 11 Apr 2000 16:49:20 +0000 Subject: [PATCH] [project @ 2000-04-11 16:49:20 by sewardj] Fix bitrot to allow (standalone) StgHugs to be built on Solaris, so we can Purify it. --- ghc/interpreter/interface.c | 9 +++++---- ghc/interpreter/object.c | 2 ++ ghc/rts/ForeignCall.c | 8 ++++---- ghc/rts/Main.c | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ghc/interpreter/interface.c b/ghc/interpreter/interface.c index 4884670..ce57edc 100644 --- a/ghc/interpreter/interface.c +++ b/ghc/interpreter/interface.c @@ -7,8 +7,8 @@ * Hugs version 1.4, December 1997 * * $RCSfile: interface.c,v $ - * $Revision: 1.50 $ - * $Date: 2000/04/10 15:24:26 $ + * $Revision: 1.51 $ + * $Date: 2000/04/11 16:49:20 $ * ------------------------------------------------------------------------*/ #include "hugsbasictypes.h" @@ -2609,7 +2609,6 @@ Type type; { SymX(lseek) \ SymX(write) \ Sym(getrusage) \ - Sym(gettimeofday) \ SymX(realloc) \ SymX(getcwd) \ SymX(free) \ @@ -2676,7 +2675,10 @@ Type type; { SymX(gmtime) \ Sym(setitimer) \ Sym(chmod) \ + Sym(gettimeofday) \ +#define EXTERN_SYMS_solaris2 \ + SymX(gettimeofday) \ #if defined(linux_TARGET_OS) @@ -2717,7 +2719,6 @@ OSym rtsTab[] #undef SymX -void init_stack; /* A kludge to assist Win32 debugging. */ diff --git a/ghc/interpreter/object.c b/ghc/interpreter/object.c index 4da4e06..762b382 100644 --- a/ghc/interpreter/object.c +++ b/ghc/interpreter/object.c @@ -1371,8 +1371,10 @@ static int ocResolve_ELF ( ObjectCode* oc, int verb ) (void*)P, (void*)S, (void*)A ); */ switch (ELF32_R_TYPE(info)) { +# if defined(linux_TARGET_OS) case R_386_32: *pP = S + A; break; case R_386_PC32: *pP = S + A - P; break; +# endif default: fprintf(stderr, "unhandled ELF relocation type %d\n", ELF32_R_TYPE(info)); diff --git a/ghc/rts/ForeignCall.c b/ghc/rts/ForeignCall.c index 182853e..38158ce 100644 --- a/ghc/rts/ForeignCall.c +++ b/ghc/rts/ForeignCall.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- - * $Id: ForeignCall.c,v 1.13 2000/03/02 10:32:17 sewardj Exp $ + * $Id: ForeignCall.c,v 1.14 2000/04/11 16:49:20 sewardj Exp $ * * (c) The GHC Team 1994-1999. * @@ -178,7 +178,7 @@ static void universal_call_c_generic unsigned int *p = (unsigned int*) args; #define ARG(n) (p[n*2]) -#define CMP(str) ((n_args + 1 == strlen(str)) && \ +#define CMP(str) ((n_args + 1 == (int)strlen(str)) && \ (!strncmp(str,argstr,n_args + 1))) #define CALL(retType,callTypes,callVals) \ @@ -248,7 +248,7 @@ int ccall ( CFunDescriptor* d, return 1; /* unlikely, but ... */ p = (unsigned int*) &arg_vec[1]; - for (i = 0; i < d->num_args; i++) { + for (i = 0; i < (int)(d->num_args); i++) { switch (d->arg_tys[i]) { case INT_REP: @@ -686,7 +686,7 @@ StgAddr createAdjThunk ( StgStablePtr stableptr, createAdjThunk_x86 ( stableptr, typestr, callconv ); #else 0; - #warn foreign export not implemented on this architecture +#warning foreign export not implemented on this architecture #endif } diff --git a/ghc/rts/Main.c b/ghc/rts/Main.c index a90556e..564e74f 100644 --- a/ghc/rts/Main.c +++ b/ghc/rts/Main.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Main.c,v 1.22 2000/04/03 16:26:01 simonmar Exp $ + * $Id: Main.c,v 1.23 2000/04/11 16:49:20 sewardj Exp $ * * (c) The GHC Team 1998-2000 * @@ -43,7 +43,7 @@ EXTFUN(__init_PrelMain); /* Hack: we assume that we're building a batch-mode system unless * INTERPRETER is set */ -# ifndef INTERPRETER /* Hack */ +#ifndef INTERPRETER /* Hack */ int main(int argc, char *argv[]) { int exit_status; -- 1.7.10.4