1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
--- libsigsegv-2.2/configure.orig 2005-09-02 09:57:18.000000000 +0200
+++ libsigsegv-2.2/configure 2005-09-02 09:58:06.000000000 +0200
@@ -22882,206 +22882,6 @@
echo "${ECHO_T}$sv_cv_fault_macosdarwin7_ppc" >&6
-if test "$sv_cv_fault_macosdarwin7_ppc" != yes; then
-
-
-
-
- echo "$as_me:$LINENO: checking whether a fault handler according to MacOSX/Darwin5 PowerPC works" >&5
-echo $ECHO_N "checking whether a fault handler according to MacOSX/Darwin5 PowerPC works... $ECHO_C" >&6
-if test "${sv_cv_fault_macosdarwin5_ppc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test "$cross_compiling" = yes; then
- case "$host" in
- powerpc-*-darwin5*) sv_cv_fault_macosdarwin5_ppc=yes ;;
- *)
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include <signal.h>
-#include "$srcdir/src/fault-macosdarwin5-powerpc.c"
-void sigsegv_handler (int sig, int code, struct sigcontext *scp)
-{
- void *fault_address = (void *) (get_fault_addr (scp));
-}
-
-int
-main ()
-{
-struct sigaction action;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- sv_cv_fault_macosdarwin5_ppc="guessing no"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-sv_cv_fault_macosdarwin5_ppc=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ;;
- esac
-
-else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <signal.h>
-#if HAVE_SYS_SIGNAL_H
-# include <sys/signal.h>
-#endif
-#include "$srcdir/src/fault-macosdarwin5-powerpc.c"
-#include <sys/types.h>
-#include <sys/mman.h>
-#if HAVE_MMAP_DEVZERO
-# include <fcntl.h>
-# ifndef MAP_FILE
-# define MAP_FILE 0
-# endif
-#endif
-#ifndef PROT_NONE
-# define PROT_NONE 0
-#endif
-#if HAVE_MMAP_ANON
-# define zero_fd -1
-# define map_flags MAP_ANON | MAP_PRIVATE
-#elif HAVE_MMAP_ANONYMOUS
-# define zero_fd -1
-# define map_flags MAP_ANONYMOUS | MAP_PRIVATE
-#elif HAVE_MMAP_DEVZERO
-static int zero_fd;
-# define map_flags MAP_FILE | MAP_PRIVATE
-#endif
-unsigned long page;
-int handler_called = 0;
-void sigsegv_handler (int sig, int code, struct sigcontext *scp)
-{
- void *fault_address = (void *) (get_fault_addr (scp));
- handler_called++;
- if (handler_called == 10)
- exit (4);
- if (fault_address != (void*)(page + 0x678))
- exit (3);
- if (mprotect ((void *) page, 0x10000, PROT_READ | PROT_WRITE) < 0)
- exit (2);
-}
-void crasher (unsigned long p)
-{
- *(int *) (p + 0x678) = 42;
-}
-int main ()
-{
- void *p;
- struct sigaction action;
- /* Preparations. */
-#if !HAVE_MMAP_ANON && !HAVE_MMAP_ANONYMOUS && HAVE_MMAP_DEVZERO
- zero_fd = open ("/dev/zero", O_RDONLY, 0644);
-#endif
- /* Setup some mmaped memory. */
-#ifdef __hpux
- /* HP-UX 10 mmap() often fails when given a hint. So give the OS complete
- freedom about the address range. */
- p = mmap ((void *) 0, 0x10000, PROT_READ | PROT_WRITE, map_flags, zero_fd, 0);
-#else
- p = mmap ((void *) 0x12340000, 0x10000, PROT_READ | PROT_WRITE, map_flags, zero_fd, 0);
-#endif
- if (p == (void *)(-1))
- exit (2);
- page = (unsigned long) p;
- /* Make it read-only. */
- if (mprotect ((void *) page, 0x10000, PROT_READ) < 0)
- exit (2);
- /* Install the SIGSEGV handler. */
- sigemptyset(&action.sa_mask);
-
- action.sa_handler = (void (*) (int)) &sigsegv_handler;
- action.sa_flags = 0;
-
- sigaction (SIGSEGV, &action, (struct sigaction *) NULL);
- sigaction (SIGBUS, &action, (struct sigaction *) NULL);
- /* The first write access should invoke the handler and then complete. */
- crasher (page);
- /* The second write access should not invoke the handler. */
- crasher (page);
- /* Check that the handler was called only once. */
- if (handler_called != 1)
- exit (1);
- /* Test passed! */
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- sv_cv_fault_macosdarwin5_ppc=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-sv_cv_fault_macosdarwin5_ppc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-fi
-echo "$as_me:$LINENO: result: $sv_cv_fault_macosdarwin5_ppc" >&5
-echo "${ECHO_T}$sv_cv_fault_macosdarwin5_ppc" >&6
-
-fi
-
-
-
-
-
echo "$as_me:$LINENO: checking whether a fault handler according to Hurd works" >&5
echo $ECHO_N "checking whether a fault handler according to Hurd works... $ECHO_C" >&6
if test "${sv_cv_fault_hurd+set}" = set; then
|