mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 05:12:33 +00:00
Estimated hours taken: 24
Ensure that the none.gc and none grades compile using a compiler
other than gcc. This is not completely tested as lcc on linux can't
generate code for boehm_gc, and 'cc -std1' on the alpha runs out of
memory while trying to link the compiler. However the compiler does
bootstrap using just gcc and also with lcc with boehm_gc compiled by
gcc.
configure.in:
-Wl,opt1,opt2 syntax is not supported by lcc instead use -Wlopt1
-Wopt2.
compiler/export.m:
Only output a label declaration if that label is exported, as the
static label declarations are not legal C.
library/io.m:
compiler/stack_layout.m:
Replace escape sequence \x with \\x in pragma c code.
library/array.m:
library/std_util.m:
Define what the struct is before using it, so the correct size for the
struct can be calculated.
library/private_builtin.m:
Replace escape sequence \x with \\x in pragma c code.
Ensure that there is at least one local variable so that the
structure definition for holding the local vars contains something.
runtime/mercury_faultaddr.h:
Remove an unnecessary cast.
runtime/mercury_reg_workarounds.h:
#include sys/time.h for FD_ZERO().
runtime/mercury_stack_trace.h:
Remove an extraneous ',' which was causing warnings.
59 lines
1.5 KiB
C
59 lines
1.5 KiB
C
/*
|
|
** Copyright (C) 1998-1999 The University of Melbourne.
|
|
** This file may only be copied under the terms of the GNU Library General
|
|
** Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
*/
|
|
|
|
/*
|
|
** mercury_faultaddr.h:
|
|
** Macros for determining the fault address of a signal.
|
|
** This is usually non-portable, so architecture specific versions
|
|
** are given here, so a single macro can be used elsewhere in the
|
|
** system (in particular, this code is necessary both in the
|
|
** runtime and in the configuration scripts).
|
|
*/
|
|
|
|
#ifndef MERCURY_FAULT_ADDR_H
|
|
#define MERCURY_FAULT_ADDR_H
|
|
|
|
|
|
#if defined(__i386__)
|
|
|
|
#define MR_GET_FAULT_ADDR(sc) \
|
|
((void *) (sc).cr2)
|
|
|
|
#elif defined(__mc68000__)
|
|
|
|
#define MR_GET_FAULT_ADDR(sc) \
|
|
({ \
|
|
struct sigcontext *scp = (struct sigcontext *) sc; \
|
|
int format = (scp->sc_formatvec >> 12) & 0xf; \
|
|
unsigned long *framedata = (unsigned long *)(scp + 1); \
|
|
unsigned long ea; \
|
|
if (format == 0xa || format == 0xb) \
|
|
/* 68020/030 */ \
|
|
ea = framedata[2]; \
|
|
else if (format == 7) \
|
|
/* 68040 */ \
|
|
ea = framedata[3]; \
|
|
else if (format == 4) { \
|
|
/* 68060 */ \
|
|
ea = framedata[0]; \
|
|
if (framedata[1] & 0x08000000) \
|
|
/* correct addr on misaligned access */ \
|
|
ea = (ea+4095)&(~4095); \
|
|
} \
|
|
(void *)ea; \
|
|
})
|
|
#else
|
|
|
|
/*
|
|
** This space deliberately left blank.
|
|
**
|
|
** We will get a compile error if it is used but not defined.
|
|
*/
|
|
|
|
#endif
|
|
|
|
#endif /* not MERCURY_FAULT_ADDR_H */
|