diff options
-rw-r--r-- | asmrun/signals.c | 22 | ||||
-rwxr-xr-x | configure | 13 | ||||
-rw-r--r-- | otherlibs/threads/scheduler.c | 10 | ||||
-rw-r--r-- | otherlibs/unix/signals.c | 4 |
4 files changed, 32 insertions, 17 deletions
diff --git a/asmrun/signals.c b/asmrun/signals.c index 11e53dd0c..21fae51e4 100644 --- a/asmrun/signals.c +++ b/asmrun/signals.c @@ -35,6 +35,18 @@ (((unsigned long *)((ctx)->sc_regs))[2 + (regno)]) #endif +#if defined(TARGET_power) && defined(SYS_aix) +#ifdef _AIXVERSION_430 +#define STRUCT_SIGCONTEXT struct __sigcontext +#define CONTEXT_GPR(ctx, regno) \ + ((ctx)->__sc_jmpbuf.__jmp_context.__gpr[regno]) +#else +#define STRUCT_SIGCONTEXT struct sigcontext +#define CONTEXT_GPR(ctx, regno) \ + ((ctx)->sc_jmpbuf.jmp_context.gpr[regno]) +#endif +#endif + volatile int async_signal_mode = 0; volatile int pending_signal = 0; volatile int force_major_slice = 0; @@ -127,7 +139,7 @@ void leave_blocking_section(void) #if defined(TARGET_alpha) || defined(TARGET_mips) void handle_signal(int sig, int code, struct sigcontext * context) #elif defined(TARGET_power) && defined(SYS_aix) -void handle_signal(int sig, int code, struct sigcontext * context) +void handle_signal(int sig, int code, STRUCT_SIGCONTEXT * context) #elif defined(TARGET_power) && defined(SYS_elf) void handle_signal(int sig, struct sigcontext * context) #elif defined(TARGET_power) && defined(SYS_rhapsody) @@ -165,7 +177,7 @@ void handle_signal(int sig) #endif #if defined(TARGET_power) && defined(SYS_aix) /* Cached in register 30 */ - context->sc_jmpbuf.jmp_context.gpr[30] = (ulong_t) young_limit; + CONTEXT_GPR(context, 30) = (ulong_t) young_limit; #endif #if defined(TARGET_power) && defined(SYS_elf) /* Cached in register 30 */ @@ -367,7 +379,7 @@ static void trap_handler(int sig) #endif #if defined(TARGET_power) && defined(SYS_aix) -static void trap_handler(int sig, int code, struct sigcontext * context) +static void trap_handler(int sig, int code, STRUCT_SIGCONTEXT * context) { /* Unblock SIGTRAP */ sigset_t mask; @@ -375,8 +387,8 @@ static void trap_handler(int sig, int code, struct sigcontext * context) sigaddset(&mask, SIGTRAP); sigprocmask(SIG_UNBLOCK, &mask, NULL); /* Recover young_ptr and caml_exception_pointer from registers 31 and 29 */ - caml_exception_pointer = (char *) context->sc_jmpbuf.jmp_context.gpr[29]; - young_ptr = (char *) context->sc_jmpbuf.jmp_context.gpr[31]; + caml_exception_pointer = (char *) CONTEXT_GPR(context, 29); + young_ptr = (char *) CONTEXT_GPR(context, 31); array_bound_error(); } #endif @@ -193,8 +193,6 @@ case "$bytecc,$host" in bytecclinkopts="-Wl,-T,12000000 -Wl,-D,14000000" # Tell gcc that we can use 32-bit code addresses for threaded code echo "#define ARCH_CODE32" >> m.h;; - gcc*) - bytecccompopts="-fno-defer-pop $gcc_warnings";; cc,mips-*-irix6*) # Add -n32 flag to ensure compatibility with native-code compiler bytecccompopts="-n32" @@ -207,6 +205,13 @@ case "$bytecc,$host" in *,alpha-*-unicos*) # For the Cray T3E bytecccompopts="-DUMK";; + gcc*,powerpc-*-aix4.3*) + # Avoid name-space pollution by requiring Unix98-conformant includes + bytecccompopts="-fno-defer-pop $gcc_warnings -D_XOPEN_SOURCE=500";; + *,powerpc-*-aix4.3*) + bytecccompopts="-D_XOPEN_SOURCE=500";; + gcc*) + bytecccompopts="-fno-defer-pop $gcc_warnings";; esac # Configure compiler to use in further tests @@ -371,6 +376,10 @@ case "$arch,$nativecc,$system,$host_type" in hppa,gcc*,hpux,*hpux10*) nativecccompopts="$gcc_warnings" nativecclinkopts="-Wl,+vnocompatwarnings";; + power,gcc*,aix,*aix4.3*) + nativecccompopts="$gcc_warnings -D_XOPEN_SOURCE=500";; + power,*,aix,*aix4.3*) + nativecccompopts="-D_XOPEN_SOURCE=500";; *,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix" nativecclinkopts="-posix";; *,*,rhapsody,*) nativecccompopts="$gcc_warnings -DSHRINKED_GNUC";; diff --git a/otherlibs/threads/scheduler.c b/otherlibs/threads/scheduler.c index 895e4a26d..e05fbe576 100644 --- a/otherlibs/threads/scheduler.c +++ b/otherlibs/threads/scheduler.c @@ -48,16 +48,6 @@ #include <sys/select.h> #endif -#ifndef FD_ISSET -/* Assume old-style BSD 4.2 fd sets */ -typedef int fd_set; -#define FD_SETSIZE (sizeof(int) * 8) -#define FD_SET(fd,fds) (*(fds) |= 1 << (fd)) -#define FD_CLR(fd,fds) (*(fds) &= ~(1 << (fd))) -#define FD_ISSET(fd,fds) (*(fds) & (1 << (fd))) -#define FD_ZERO(fds) (*(fds) = 0) -#endif - #ifndef HAS_WAITPID #define waitpid(pid,status,opts) wait4(pid,status,opts,NULL) #endif diff --git a/otherlibs/unix/signals.c b/otherlibs/unix/signals.c index 1a075d312..9810d7439 100644 --- a/otherlibs/unix/signals.c +++ b/otherlibs/unix/signals.c @@ -21,6 +21,10 @@ #include <signals.h> #include "unixsupport.h" +#ifndef NSIG +#define NSIG 32 +#endif + #ifdef POSIX_SIGNALS static void decode_sigset(value vset, sigset_t * set) |